mmc: sdhci-s3c: fix missing clock for gpio card-detect
2abeb5c5de
("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>
This commit is contained in:
committed by
Chris Ball
parent
0aa55c2367
commit
fe007c02f9
@@ -373,18 +373,25 @@ static struct sdhci_ops sdhci_s3c_ops = {
|
|||||||
static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
|
static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
|
||||||
{
|
{
|
||||||
struct sdhci_host *host = platform_get_drvdata(dev);
|
struct sdhci_host *host = platform_get_drvdata(dev);
|
||||||
|
struct sdhci_s3c *sc = sdhci_priv(host);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (host) {
|
if (host) {
|
||||||
spin_lock_irqsave(&host->lock, flags);
|
spin_lock_irqsave(&host->lock, flags);
|
||||||
if (state) {
|
if (state) {
|
||||||
dev_dbg(&dev->dev, "card inserted.\n");
|
dev_dbg(&dev->dev, "card inserted.\n");
|
||||||
|
#ifdef CONFIG_PM_RUNTIME
|
||||||
|
clk_prepare_enable(sc->clk_io);
|
||||||
|
#endif
|
||||||
host->flags &= ~SDHCI_DEVICE_DEAD;
|
host->flags &= ~SDHCI_DEVICE_DEAD;
|
||||||
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
|
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(&dev->dev, "card removed.\n");
|
dev_dbg(&dev->dev, "card removed.\n");
|
||||||
host->flags |= SDHCI_DEVICE_DEAD;
|
host->flags |= SDHCI_DEVICE_DEAD;
|
||||||
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
|
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
|
||||||
|
#ifdef CONFIG_PM_RUNTIME
|
||||||
|
clk_disable_unprepare(sc->clk_io);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
tasklet_schedule(&host->card_tasklet);
|
tasklet_schedule(&host->card_tasklet);
|
||||||
spin_unlock_irqrestore(&host->lock, flags);
|
spin_unlock_irqrestore(&host->lock, flags);
|
||||||
|
Reference in New Issue
Block a user