Commit 773a9ef8 authored by Ulf Hansson's avatar Ulf Hansson

mmc: pwrseq: Add reset callback to the struct mmc_pwrseq_ops

The ->reset() callback is needed to implement a better support for eMMC HW
reset. The following changes will take advantage of the new callback.
Suggested-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
parent dada0194
...@@ -76,6 +76,14 @@ void mmc_pwrseq_power_off(struct mmc_host *host) ...@@ -76,6 +76,14 @@ void mmc_pwrseq_power_off(struct mmc_host *host)
pwrseq->ops->power_off(host); pwrseq->ops->power_off(host);
} }
void mmc_pwrseq_reset(struct mmc_host *host)
{
struct mmc_pwrseq *pwrseq = host->pwrseq;
if (pwrseq && pwrseq->ops->reset)
pwrseq->ops->reset(host);
}
void mmc_pwrseq_free(struct mmc_host *host) void mmc_pwrseq_free(struct mmc_host *host)
{ {
struct mmc_pwrseq *pwrseq = host->pwrseq; struct mmc_pwrseq *pwrseq = host->pwrseq;
......
...@@ -18,6 +18,7 @@ struct mmc_pwrseq_ops { ...@@ -18,6 +18,7 @@ struct mmc_pwrseq_ops {
void (*pre_power_on)(struct mmc_host *host); void (*pre_power_on)(struct mmc_host *host);
void (*post_power_on)(struct mmc_host *host); void (*post_power_on)(struct mmc_host *host);
void (*power_off)(struct mmc_host *host); void (*power_off)(struct mmc_host *host);
void (*reset)(struct mmc_host *host);
}; };
struct mmc_pwrseq { struct mmc_pwrseq {
...@@ -36,6 +37,7 @@ int mmc_pwrseq_alloc(struct mmc_host *host); ...@@ -36,6 +37,7 @@ int mmc_pwrseq_alloc(struct mmc_host *host);
void mmc_pwrseq_pre_power_on(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_post_power_on(struct mmc_host *host);
void mmc_pwrseq_power_off(struct mmc_host *host); void mmc_pwrseq_power_off(struct mmc_host *host);
void mmc_pwrseq_reset(struct mmc_host *host);
void mmc_pwrseq_free(struct mmc_host *host); void mmc_pwrseq_free(struct mmc_host *host);
#else #else
...@@ -49,6 +51,7 @@ static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; } ...@@ -49,6 +51,7 @@ 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_pre_power_on(struct mmc_host *host) {}
static inline void mmc_pwrseq_post_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_power_off(struct mmc_host *host) {}
static inline void mmc_pwrseq_reset(struct mmc_host *host) {}
static inline void mmc_pwrseq_free(struct mmc_host *host) {} static inline void mmc_pwrseq_free(struct mmc_host *host) {}
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment