Commit 276e090f authored by Johan Rudholm's avatar Johan Rudholm Committed by Chris Ball

mmc: core: Add mmc_power_cycle

Add mmc_power_cycle which can be used to power cycle for instance
SD-cards.
Signed-off-by: default avatarJohan Rudholm <johan.rudholm@stericsson.com>
Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Tested-by: default avatarWei WANG <wei_wang@realsil.com.cn>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 3f8a7fab
...@@ -1470,6 +1470,14 @@ void mmc_power_off(struct mmc_host *host) ...@@ -1470,6 +1470,14 @@ void mmc_power_off(struct mmc_host *host)
mmc_host_clk_release(host); mmc_host_clk_release(host);
} }
void mmc_power_cycle(struct mmc_host *host)
{
mmc_power_off(host);
/* Wait at least 1 ms according to SD spec */
mmc_delay(1);
mmc_power_up(host);
}
/* /*
* Cleanup when the last reference to the bus operator is dropped. * Cleanup when the last reference to the bus operator is dropped.
*/ */
......
...@@ -45,6 +45,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, ...@@ -45,6 +45,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage,
void mmc_set_timing(struct mmc_host *host, unsigned int timing); void mmc_set_timing(struct mmc_host *host, unsigned int timing);
void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
void mmc_power_off(struct mmc_host *host); void mmc_power_off(struct mmc_host *host);
void mmc_power_cycle(struct mmc_host *host);
static inline void mmc_delay(unsigned int ms) static inline void mmc_delay(unsigned int ms)
{ {
......
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