@@ -1831,6 +1831,7 @@ void mmc_power_up(struct mmc_host *host, u32 ocr)
* time required to reach a stable voltage.
*/
mmc_delay(10);
+ mmc_pwrseq_post_ios_power_on(host);
}
void mmc_power_off(struct mmc_host *host)
@@ -68,6 +68,14 @@ void mmc_pwrseq_post_power_on(struct mmc_host *host)
pwrseq->ops->post_power_on(host);
}
+void mmc_pwrseq_post_ios_power_on(struct mmc_host *host)
+{
+ struct mmc_pwrseq *pwrseq = host->pwrseq;
+
+ if (pwrseq && pwrseq->ops->post_ios_power_on)
+ pwrseq->ops->post_ios_power_on(host);
+}
+
void mmc_pwrseq_power_off(struct mmc_host *host)
{
struct mmc_pwrseq *pwrseq = host->pwrseq;
@@ -13,6 +13,7 @@
struct mmc_pwrseq_ops {
void (*pre_power_on)(struct mmc_host *host);
void (*post_power_on)(struct mmc_host *host);
+ void (*post_ios_power_on)(struct mmc_host *host);
void (*power_off)(struct mmc_host *host);
};
@@ -31,6 +32,7 @@ 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_post_ios_power_on(struct mmc_host *host);
void mmc_pwrseq_power_off(struct mmc_host *host);
void mmc_pwrseq_free(struct mmc_host *host);
@@ -44,6 +46,7 @@ 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_post_ios_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) {}
Currently, ->pre_power_on() callback is called at the beginning of the mmc_power_up() function before MMC_POWER_UP and MMC_POWER_ON sequences. The callback ->post_power_on() is called at the end of the mmc_power_up() function. Some SDIO Chipsets require to gate the clock after than the vqmmc supply is powered on and then toggle the reset line. Currently, there is no way for doing this. This commit introduces a new callback ->post_ios_power_on(), that is called at the end of the mmc_power_up() function after the mmc_set_ios() operation. In this way the entire power sequences can be done from this function after the enablement of the power supply. Signed-off-by: Romain Perier <romain.perier@collabora.com> --- Changes in v2: - Added missing declaration for mmc_pwrseq_post_ios_power_on when CONFIG_OF is disabled. drivers/mmc/core/core.c | 1 + drivers/mmc/core/pwrseq.c | 8 ++++++++ drivers/mmc/core/pwrseq.h | 3 +++ 3 files changed, 12 insertions(+)