Skip to content

Commit

Permalink
mmc: atmel-mci: adopt pinctrl support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wenyou Yang authored and Ulf Hansson committed Nov 26, 2014
1 parent e9fb05d commit b5b64fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/mmc/host/atmel-mci.c
Original file line number Diff line number Diff line change
@@ -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,13 +2569,17 @@ static int atmci_runtime_suspend(struct device *dev)

clk_disable_unprepare(host->mck);

pinctrl_pm_select_sleep_state(dev);

return 0;
}

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

0 comments on commit b5b64fa

Please sign in to comment.