#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mmc/host.h>
static DEFINE_MUTEX(pwrseq_list_mutex);
static LIST_HEAD(pwrseq_list);
int mmc_pwrseq_alloc(struct mmc_host *host)
np = of_parse_phandle(host->parent->of_node, "mmc-pwrseq", 0);
mutex_lock(&pwrseq_list_mutex);
list_for_each_entry(p, &pwrseq_list, pwrseq_node) {
if (p->dev->of_node == np) {
if (!try_module_get(p->owner))
"increasing module refcount failed\n");
mutex_unlock(&pwrseq_list_mutex);
dev_info(host->parent, "allocated mmc-pwrseq\n");
void mmc_pwrseq_pre_power_on(struct mmc_host *host)
struct mmc_pwrseq *pwrseq = host->pwrseq;
if (pwrseq && pwrseq->ops->pre_power_on)
pwrseq->ops->pre_power_on(host);
void mmc_pwrseq_post_power_on(struct mmc_host *host)