diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2017-05-08 17:49:12 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-20 04:30:09 -0400 |
commit | 773a9ef85f02f6a82f58244f33cb628ad1ecac21 (patch) | |
tree | cdaa4491b80451ccbb9e40e41efa795a99185bb7 | |
parent | dada0194ab45b896c6bae5ce89eb78cf52e215d4 (diff) |
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: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
-rw-r--r-- | drivers/mmc/core/pwrseq.c | 8 | ||||
-rw-r--r-- | drivers/mmc/core/pwrseq.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/core/pwrseq.c b/drivers/mmc/core/pwrseq.c index 9386c4771814..e3ad30fa8307 100644 --- a/drivers/mmc/core/pwrseq.c +++ b/drivers/mmc/core/pwrseq.c | |||
@@ -76,6 +76,14 @@ void mmc_pwrseq_power_off(struct mmc_host *host) | |||
76 | pwrseq->ops->power_off(host); | 76 | pwrseq->ops->power_off(host); |
77 | } | 77 | } |
78 | 78 | ||
79 | void mmc_pwrseq_reset(struct mmc_host *host) | ||
80 | { | ||
81 | struct mmc_pwrseq *pwrseq = host->pwrseq; | ||
82 | |||
83 | if (pwrseq && pwrseq->ops->reset) | ||
84 | pwrseq->ops->reset(host); | ||
85 | } | ||
86 | |||
79 | void mmc_pwrseq_free(struct mmc_host *host) | 87 | void mmc_pwrseq_free(struct mmc_host *host) |
80 | { | 88 | { |
81 | struct mmc_pwrseq *pwrseq = host->pwrseq; | 89 | struct mmc_pwrseq *pwrseq = host->pwrseq; |
diff --git a/drivers/mmc/core/pwrseq.h b/drivers/mmc/core/pwrseq.h index 39c911aa6ebb..819386f4ec61 100644 --- a/drivers/mmc/core/pwrseq.h +++ b/drivers/mmc/core/pwrseq.h | |||
@@ -18,6 +18,7 @@ struct mmc_pwrseq_ops { | |||
18 | void (*pre_power_on)(struct mmc_host *host); | 18 | void (*pre_power_on)(struct mmc_host *host); |
19 | void (*post_power_on)(struct mmc_host *host); | 19 | void (*post_power_on)(struct mmc_host *host); |
20 | void (*power_off)(struct mmc_host *host); | 20 | void (*power_off)(struct mmc_host *host); |
21 | void (*reset)(struct mmc_host *host); | ||
21 | }; | 22 | }; |
22 | 23 | ||
23 | struct mmc_pwrseq { | 24 | struct mmc_pwrseq { |
@@ -36,6 +37,7 @@ int mmc_pwrseq_alloc(struct mmc_host *host); | |||
36 | void mmc_pwrseq_pre_power_on(struct mmc_host *host); | 37 | void mmc_pwrseq_pre_power_on(struct mmc_host *host); |
37 | void mmc_pwrseq_post_power_on(struct mmc_host *host); | 38 | void mmc_pwrseq_post_power_on(struct mmc_host *host); |
38 | void mmc_pwrseq_power_off(struct mmc_host *host); | 39 | void mmc_pwrseq_power_off(struct mmc_host *host); |
40 | void mmc_pwrseq_reset(struct mmc_host *host); | ||
39 | void mmc_pwrseq_free(struct mmc_host *host); | 41 | void mmc_pwrseq_free(struct mmc_host *host); |
40 | 42 | ||
41 | #else | 43 | #else |
@@ -49,6 +51,7 @@ static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; } | |||
49 | static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {} | 51 | static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {} |
50 | static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {} | 52 | static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {} |
51 | static inline void mmc_pwrseq_power_off(struct mmc_host *host) {} | 53 | static inline void mmc_pwrseq_power_off(struct mmc_host *host) {} |
54 | static inline void mmc_pwrseq_reset(struct mmc_host *host) {} | ||
52 | static inline void mmc_pwrseq_free(struct mmc_host *host) {} | 55 | static inline void mmc_pwrseq_free(struct mmc_host *host) {} |
53 | 56 | ||
54 | #endif | 57 | #endif |