summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/atmel-mci.c
diff options
context:
space:
mode:
authorWenyou Yang <wenyou.yang@atmel.com>2014-11-07 01:48:13 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-26 14:30:52 +0100
commitb5b64fa6cd6bd053db2b89a41792597d08913036 (patch)
treeed360bb147a0b62a3aac778f5d7b0ad3bd49a1b1 /drivers/mmc/host/atmel-mci.c
parentmmc: sdhci: Add HS400 support to SDHCI driver (diff)
downloadlinux-b5b64fa6cd6bd053db2b89a41792597d08913036.tar.xz
linux-b5b64fa6cd6bd053db2b89a41792597d08913036.zip
mmc: atmel-mci: adopt pinctrl support
Amend the atmel mci pin controller to optionally take a pin control handle and set the state of the pins to: - "default" on boot, resume and before performing an transfer. - "sleep" on suspend(). This should make it possible to optimize energy usage for the pins both for the suspend/resume cycle. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r--drivers/mmc/host/atmel-mci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 4df1599583f8..a7b59ba399a1 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -39,6 +39,7 @@
#include <linux/atmel_pdc.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
+#include <linux/pinctrl/consumer.h>
#include <asm/cacheflush.h>
#include <asm/io.h>
@@ -2568,6 +2569,8 @@ static int atmci_runtime_suspend(struct device *dev)
clk_disable_unprepare(host->mck);
+ pinctrl_pm_select_sleep_state(dev);
+
return 0;
}
@@ -2575,6 +2578,8 @@ static int atmci_runtime_resume(struct device *dev)
{
struct atmel_mci *host = dev_get_drvdata(dev);
+ pinctrl_pm_select_default_state(dev);
+
return clk_prepare_enable(host->mck);
}
#endif