aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-10-29 09:39:30 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-11-04 05:31:46 -0500
commita9a83785def8bf9142b37c86ffcb0fdc93fb851e (patch)
treeeaee4f1a310fa30f3d0c7e56f7d4b43e81587114 /drivers/mmc
parent70ac09358cc52f3ddbf73555dc150d486a7133bb (diff)
ARM: 7562/2: MMCI: fetch pinctrl handle and set default state
This fetches the pinctrl resource for the MMCI driver, and if a "default" state is found, it is activated. Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c18
-rw-r--r--drivers/mmc/host/mmci.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index cd0fbee0b1c..9446c176e74 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -33,6 +33,7 @@
33#include <linux/amba/mmci.h> 33#include <linux/amba/mmci.h>
34#include <linux/pm_runtime.h> 34#include <linux/pm_runtime.h>
35#include <linux/types.h> 35#include <linux/types.h>
36#include <linux/pinctrl/consumer.h>
36 37
37#include <asm/div64.h> 38#include <asm/div64.h>
38#include <asm/io.h> 39#include <asm/io.h>
@@ -1366,6 +1367,23 @@ static int __devinit mmci_probe(struct amba_device *dev,
1366 mmc->f_max = min(host->mclk, fmax); 1367 mmc->f_max = min(host->mclk, fmax);
1367 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); 1368 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
1368 1369
1370 host->pinctrl = devm_pinctrl_get(&dev->dev);
1371 if (IS_ERR(host->pinctrl)) {
1372 ret = PTR_ERR(host->pinctrl);
1373 goto clk_disable;
1374 }
1375
1376 host->pins_default = pinctrl_lookup_state(host->pinctrl,
1377 PINCTRL_STATE_DEFAULT);
1378
1379 /* enable pins to be muxed in and configured */
1380 if (!IS_ERR(host->pins_default)) {
1381 ret = pinctrl_select_state(host->pinctrl, host->pins_default);
1382 if (ret)
1383 dev_warn(&dev->dev, "could not set default pins\n");
1384 } else
1385 dev_warn(&dev->dev, "could not get default pinstate\n");
1386
1369#ifdef CONFIG_REGULATOR 1387#ifdef CONFIG_REGULATOR
1370 /* If we're using the regulator framework, try to fetch a regulator */ 1388 /* If we're using the regulator framework, try to fetch a regulator */
1371 host->vcc = regulator_get(&dev->dev, "vmmc"); 1389 host->vcc = regulator_get(&dev->dev, "vmmc");
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index d437ccf62d6..d34d8c0add8 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -195,6 +195,10 @@ struct mmci_host {
195 unsigned int size; 195 unsigned int size;
196 struct regulator *vcc; 196 struct regulator *vcc;
197 197
198 /* pinctrl handles */
199 struct pinctrl *pinctrl;
200 struct pinctrl_state *pins_default;
201
198#ifdef CONFIG_DMA_ENGINE 202#ifdef CONFIG_DMA_ENGINE
199 /* DMA stuff */ 203 /* DMA stuff */
200 struct dma_chan *dma_current; 204 struct dma_chan *dma_current;