提交 b5b64fa6 编写于 作者: W Wenyou Yang 提交者: Ulf Hansson

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: NWenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 e9fb05d5
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <linux/atmel_pdc.h> #include <linux/atmel_pdc.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/pinctrl/consumer.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -2568,6 +2569,8 @@ static int atmci_runtime_suspend(struct device *dev) ...@@ -2568,6 +2569,8 @@ static int atmci_runtime_suspend(struct device *dev)
clk_disable_unprepare(host->mck); clk_disable_unprepare(host->mck);
pinctrl_pm_select_sleep_state(dev);
return 0; return 0;
} }
...@@ -2575,6 +2578,8 @@ static int atmci_runtime_resume(struct device *dev) ...@@ -2575,6 +2578,8 @@ static int atmci_runtime_resume(struct device *dev)
{ {
struct atmel_mci *host = dev_get_drvdata(dev); struct atmel_mci *host = dev_get_drvdata(dev);
pinctrl_pm_select_default_state(dev);
return clk_prepare_enable(host->mck); return clk_prepare_enable(host->mck);
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册