![Srinivas Kandagatla](/assets/img/avatar_default.png)
simple-pwrseq and emmc-pwrseq drivers rely on platform_device structure from of_find_device_by_node(), this works mostly. But, as there is no driver associated with this devices, cases like default/init pinctrl setup would never be performed by pwrseq. This becomes problem when the gpios used in pwrseq require pinctrl setup. Currently most of the common pinctrl setup is done in drivers/base/pinctrl.c by pinctrl_bind_pins(). There are two ways to solve this issue on either convert pwrseq drivers to a proper platform drivers or copy the exact code from pcintrl_bind_pins(). I prefer converting pwrseq to proper drivers so that other cases like setting up clks/parents from dt would also be possible. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
53 lines
1.4 KiB
C
53 lines
1.4 KiB
C
/*
|
|
* Copyright (C) 2014 Linaro Ltd
|
|
*
|
|
* Author: Ulf Hansson <ulf.hansson@linaro.org>
|
|
*
|
|
* License terms: GNU General Public License (GPL) version 2
|
|
*/
|
|
#ifndef _MMC_CORE_PWRSEQ_H
|
|
#define _MMC_CORE_PWRSEQ_H
|
|
|
|
#include <linux/mmc/host.h>
|
|
|
|
struct mmc_pwrseq_ops {
|
|
void (*pre_power_on)(struct mmc_host *host);
|
|
void (*post_power_on)(struct mmc_host *host);
|
|
void (*power_off)(struct mmc_host *host);
|
|
};
|
|
|
|
struct mmc_pwrseq {
|
|
const struct mmc_pwrseq_ops *ops;
|
|
struct device *dev;
|
|
struct list_head pwrseq_node;
|
|
struct module *owner;
|
|
};
|
|
|
|
#ifdef CONFIG_OF
|
|
|
|
int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq);
|
|
void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq);
|
|
|
|
int mmc_pwrseq_alloc(struct mmc_host *host);
|
|
void mmc_pwrseq_pre_power_on(struct mmc_host *host);
|
|
void mmc_pwrseq_post_power_on(struct mmc_host *host);
|
|
void mmc_pwrseq_power_off(struct mmc_host *host);
|
|
void mmc_pwrseq_free(struct mmc_host *host);
|
|
|
|
#else
|
|
|
|
static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
static inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {}
|
|
static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
|
|
static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
|
|
static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
|
|
static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
|
|
static inline void mmc_pwrseq_free(struct mmc_host *host) {}
|
|
|
|
#endif
|
|
|
|
#endif
|