mvebu: add preliminary support for PCI express
[openwrt.git] / target / linux / mvebu / patches-3.8 / 009-mmc_mvsdio_add_pinctrl.patch
1 On many Marvell SoCs, the pins used for the SDIO interface are part of
2 the MPP pins, that are muxable pins. In order to get the muxing of
3 those pins correct, this commit integrates the mvsdio driver with the
4 pinctrl infrastructure by calling devm_pinctrl_get_select_default()
5 during ->probe().
6
7 Note that we permit this function to fail because not all Marvell
8 platforms have yet been fully converted to using the pinctrl
9 infrastructure.
10
11 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 ---
13  drivers/mmc/host/mvsdio.c |    6 ++++++
14  1 file changed, 6 insertions(+)
15
16 --- a/drivers/mmc/host/mvsdio.c
17 +++ b/drivers/mmc/host/mvsdio.c
18 @@ -25,6 +25,7 @@
19  #include <linux/of_irq.h>
20  #include <linux/mmc/host.h>
21  #include <linux/mmc/slot-gpio.h>
22 +#include <linux/pinctrl/consumer.h>
23  
24  #include <asm/sizes.h>
25  #include <asm/unaligned.h>
26 @@ -692,6 +693,7 @@ static int __init mvsd_probe(struct plat
27         struct resource *r;
28         int ret, irq;
29         int gpio_card_detect, gpio_write_protect;
30 +       struct pinctrl *pinctrl;
31  
32         r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
33         irq = platform_get_irq(pdev, 0);
34 @@ -713,6 +715,10 @@ static int __init mvsd_probe(struct plat
35         host->dev = &pdev->dev;
36         host->res = r;
37  
38 +       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
39 +       if (IS_ERR(pinctrl))
40 +               dev_warn(&pdev->dev, "no pins associated\n");
41 +
42         /* Some non-DT platforms do not pass a clock, and the clock
43            frequency is passed through platform_data. On DT platforms,
44            a clock must always be passed, even if there is no gatable