diff options
author | Heiko Stübner <heiko@sntech.de> | 2012-11-18 13:50:05 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-12-06 13:54:33 -0500 |
commit | fe007c02f9659f5c0ae6f3ceaf45076df92cc88e (patch) | |
tree | b874b12eb1d26a7dd0837e0b69fb5b41bcffbba4 /drivers/mmc/host/sdhci-s3c.c | |
parent | 0aa55c2367f082876f92660312214cd20c6a024b (diff) |
mmc: sdhci-s3c: fix missing clock for gpio card-detect
2abeb5c5ded2 ("Add clk_(enable/disable) in runtime suspend/resume")
added the capability to stop the clocks when the device is runtime
suspended, but forgot to handle the case of the card-detect using
an external gpio.
Therefore in the case that runtime-pm is enabled, start the io-clock
when a card is inserted and stop it again once it is removed.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-s3c.c')
-rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index a54dd5d7a5f9..c9ec725884e5 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -373,18 +373,25 @@ static struct sdhci_ops sdhci_s3c_ops = { | |||
373 | static void sdhci_s3c_notify_change(struct platform_device *dev, int state) | 373 | static void sdhci_s3c_notify_change(struct platform_device *dev, int state) |
374 | { | 374 | { |
375 | struct sdhci_host *host = platform_get_drvdata(dev); | 375 | struct sdhci_host *host = platform_get_drvdata(dev); |
376 | struct sdhci_s3c *sc = sdhci_priv(host); | ||
376 | unsigned long flags; | 377 | unsigned long flags; |
377 | 378 | ||
378 | if (host) { | 379 | if (host) { |
379 | spin_lock_irqsave(&host->lock, flags); | 380 | spin_lock_irqsave(&host->lock, flags); |
380 | if (state) { | 381 | if (state) { |
381 | dev_dbg(&dev->dev, "card inserted.\n"); | 382 | dev_dbg(&dev->dev, "card inserted.\n"); |
383 | #ifdef CONFIG_PM_RUNTIME | ||
384 | clk_prepare_enable(sc->clk_io); | ||
385 | #endif | ||
382 | host->flags &= ~SDHCI_DEVICE_DEAD; | 386 | host->flags &= ~SDHCI_DEVICE_DEAD; |
383 | host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; | 387 | host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; |
384 | } else { | 388 | } else { |
385 | dev_dbg(&dev->dev, "card removed.\n"); | 389 | dev_dbg(&dev->dev, "card removed.\n"); |
386 | host->flags |= SDHCI_DEVICE_DEAD; | 390 | host->flags |= SDHCI_DEVICE_DEAD; |
387 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; | 391 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; |
392 | #ifdef CONFIG_PM_RUNTIME | ||
393 | clk_disable_unprepare(sc->clk_io); | ||
394 | #endif | ||
388 | } | 395 | } |
389 | tasklet_schedule(&host->card_tasklet); | 396 | tasklet_schedule(&host->card_tasklet); |
390 | spin_unlock_irqrestore(&host->lock, flags); | 397 | spin_unlock_irqrestore(&host->lock, flags); |