diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-01-20 11:53:15 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-03-12 17:49:03 -0400 |
commit | 51dddfe839a0ebcb5ff61a779e3f2768714f9957 (patch) | |
tree | aeb1a71faf3f8e284cc9af1dd081c673c6051136 /arch | |
parent | dc0b1aa3e2fefa6372f38d7f6d5d33581567a1b5 (diff) |
ARM: u300: configure some pins as an example
To show how the pin configuration is used on the U300, let's
include some configs for two GPIO pins.
ChangeLog v1->v2:
- Provide a better example, set the clock return pin to pull-up
and set the card detect pin to high impedance.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-u300/core.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index f326d3136128..a7b3f36e2262 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mtd/fsmc.h> | 27 | #include <linux/mtd/fsmc.h> |
28 | #include <linux/pinctrl/machine.h> | 28 | #include <linux/pinctrl/machine.h> |
29 | #include <linux/pinctrl/consumer.h> | 29 | #include <linux/pinctrl/consumer.h> |
30 | #include <linux/pinctrl/pinconf-generic.h> | ||
30 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
31 | 32 | ||
32 | #include <asm/types.h> | 33 | #include <asm/types.h> |
@@ -1605,7 +1606,15 @@ static struct platform_device dma_device = { | |||
1605 | }, | 1606 | }, |
1606 | }; | 1607 | }; |
1607 | 1608 | ||
1608 | /* Pinmux settings */ | 1609 | static unsigned long pin_pullup_conf[] = { |
1610 | PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1), | ||
1611 | }; | ||
1612 | |||
1613 | static unsigned long pin_highz_conf[] = { | ||
1614 | PIN_CONF_PACKED(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0), | ||
1615 | }; | ||
1616 | |||
1617 | /* Pin control settings */ | ||
1609 | static struct pinctrl_map __initdata u300_pinmux_map[] = { | 1618 | static struct pinctrl_map __initdata u300_pinmux_map[] = { |
1610 | /* anonymous maps for chip power and EMIFs */ | 1619 | /* anonymous maps for chip power and EMIFs */ |
1611 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"), | 1620 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"), |
@@ -1615,6 +1624,12 @@ static struct pinctrl_map __initdata u300_pinmux_map[] = { | |||
1615 | PIN_MAP_MUX_GROUP_DEFAULT("mmci", "pinctrl-u300", NULL, "mmc0"), | 1624 | PIN_MAP_MUX_GROUP_DEFAULT("mmci", "pinctrl-u300", NULL, "mmc0"), |
1616 | PIN_MAP_MUX_GROUP_DEFAULT("pl022", "pinctrl-u300", NULL, "spi0"), | 1625 | PIN_MAP_MUX_GROUP_DEFAULT("pl022", "pinctrl-u300", NULL, "spi0"), |
1617 | PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-u300", NULL, "uart0"), | 1626 | PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-u300", NULL, "uart0"), |
1627 | /* This pin is used for clock return rather than GPIO */ | ||
1628 | PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO APP GPIO 11", | ||
1629 | pin_pullup_conf), | ||
1630 | /* This pin is used for card detect */ | ||
1631 | PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO MS INS", | ||
1632 | pin_highz_conf), | ||
1618 | }; | 1633 | }; |
1619 | 1634 | ||
1620 | struct u300_mux_hog { | 1635 | struct u300_mux_hog { |
@@ -1640,7 +1655,6 @@ static int __init u300_pinctrl_fetch(void) | |||
1640 | 1655 | ||
1641 | for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) { | 1656 | for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) { |
1642 | struct pinctrl *p; | 1657 | struct pinctrl *p; |
1643 | int ret; | ||
1644 | 1658 | ||
1645 | p = pinctrl_get_select_default(u300_mux_hogs[i].dev); | 1659 | p = pinctrl_get_select_default(u300_mux_hogs[i].dev); |
1646 | if (IS_ERR(p)) { | 1660 | if (IS_ERR(p)) { |