aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAndreas Fenkart <afenkart@gmail.com>2014-05-29 04:28:04 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-07-09 05:26:05 -0400
commit97978a4439fb49d05fbc1dfd075e3c5fb22ea956 (patch)
tree8e32a5d0c4a9451489f6ccfc93b1fd70a913e175 /drivers/mmc
parentf945901f9aaff859c6b3244628c766d1939e46e7 (diff)
mmc: omap_hsmmc: switch default/idle pinctrl states in runtime hooks
These are predefined states of the driver model. When not present, as if not set in the device tree, they become no-ops. Explicitly selecting the default state is not needed since the device core layer sets pin mux to "default" state before probe. This is not the simplest implementation, on AM335x at least, we could switch to idle at any point in the suspend hook, only the default state needs to be set before writing to the irq registers or an IRQ might get lost. Acked-by: Balaji T K <balajitk@ti.com> Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e97fb9cb24d5..5167e55c0849 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1998,7 +1998,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1998 const struct of_device_id *match; 1998 const struct of_device_id *match;
1999 dma_cap_mask_t mask; 1999 dma_cap_mask_t mask;
2000 unsigned tx_req, rx_req; 2000 unsigned tx_req, rx_req;
2001 struct pinctrl *pinctrl;
2002 const struct omap_mmc_of_data *data; 2001 const struct omap_mmc_of_data *data;
2003 void __iomem *base; 2002 void __iomem *base;
2004 2003
@@ -2212,11 +2211,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
2212 2211
2213 omap_hsmmc_disable_irq(host); 2212 omap_hsmmc_disable_irq(host);
2214 2213
2215 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
2216 if (IS_ERR(pinctrl))
2217 dev_warn(&pdev->dev,
2218 "pins are not configured from the driver\n");
2219
2220 /* 2214 /*
2221 * For now, only support SDIO interrupt if we have a separate 2215 * For now, only support SDIO interrupt if we have a separate
2222 * wake-up interrupt configured from device tree. This is because 2216 * wake-up interrupt configured from device tree. This is because
@@ -2418,10 +2412,15 @@ static int omap_hsmmc_runtime_suspend(struct device *dev)
2418 goto abort; 2412 goto abort;
2419 } 2413 }
2420 2414
2415 pinctrl_pm_select_idle_state(dev);
2416
2421 WARN_ON(host->flags & HSMMC_WAKE_IRQ_ENABLED); 2417 WARN_ON(host->flags & HSMMC_WAKE_IRQ_ENABLED);
2422 enable_irq(host->wake_irq); 2418 enable_irq(host->wake_irq);
2423 host->flags |= HSMMC_WAKE_IRQ_ENABLED; 2419 host->flags |= HSMMC_WAKE_IRQ_ENABLED;
2420 } else {
2421 pinctrl_pm_select_idle_state(dev);
2424 } 2422 }
2423
2425abort: 2424abort:
2426 spin_unlock_irqrestore(&host->irq_lock, flags); 2425 spin_unlock_irqrestore(&host->irq_lock, flags);
2427 return ret; 2426 return ret;
@@ -2445,9 +2444,14 @@ static int omap_hsmmc_runtime_resume(struct device *dev)
2445 host->flags &= ~HSMMC_WAKE_IRQ_ENABLED; 2444 host->flags &= ~HSMMC_WAKE_IRQ_ENABLED;
2446 } 2445 }
2447 2446
2447 pinctrl_pm_select_default_state(host->dev);
2448
2449 /* irq lost, if pinmux incorrect */
2448 OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR); 2450 OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
2449 OMAP_HSMMC_WRITE(host->base, ISE, CIRQ_EN); 2451 OMAP_HSMMC_WRITE(host->base, ISE, CIRQ_EN);
2450 OMAP_HSMMC_WRITE(host->base, IE, CIRQ_EN); 2452 OMAP_HSMMC_WRITE(host->base, IE, CIRQ_EN);
2453 } else {
2454 pinctrl_pm_select_default_state(host->dev);
2451 } 2455 }
2452 spin_unlock_irqrestore(&host->irq_lock, flags); 2456 spin_unlock_irqrestore(&host->irq_lock, flags);
2453 return 0; 2457 return 0;