From 276e090f9217b69e46d8255132d2667ac5eec51b Mon Sep 17 00:00:00 2001 From: Johan Rudholm Date: Mon, 28 Jan 2013 15:08:25 +0100 Subject: mmc: core: Add mmc_power_cycle Add mmc_power_cycle which can be used to power cycle for instance SD-cards. Signed-off-by: Johan Rudholm Acked-by: Ulf Hansson Tested-by: Wei WANG Signed-off-by: Chris Ball --- drivers/mmc/core/core.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/mmc/core/core.c') diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 39f28af34cb6..789056fbfc93 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1470,6 +1470,14 @@ void mmc_power_off(struct mmc_host *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. */ -- cgit v1.2.3