aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-nomadik/cpu-8815.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-01-04 19:00:59 -0500
committerLinus Walleij <linus.walleij@linaro.org>2013-01-28 17:23:54 -0500
commit1b542757179675162865f2b5b5fdbcc8b9118f2a (patch)
tree8831fe8463697c2db30f5fbd468f698a177282fb /arch/arm/mach-nomadik/cpu-8815.c
parentf8635abd38776a413d1e84c79353693b8ecf45c9 (diff)
ARM: nomadik: move pin maps to cpu file
Move the pinctrl maps over to the CPU file and register them right before the pin controller itself. This way the pinmaps will also benefit the device tree boot. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-nomadik/cpu-8815.c')
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 7c8e3487f4eb..0114d4f878a1 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -28,6 +28,7 @@
28#include <linux/irqchip.h> 28#include <linux/irqchip.h>
29#include <linux/platform_data/clk-nomadik.h> 29#include <linux/platform_data/clk-nomadik.h>
30#include <linux/platform_data/pinctrl-nomadik.h> 30#include <linux/platform_data/pinctrl-nomadik.h>
31#include <linux/pinctrl/machine.h>
31#include <linux/platform_data/clocksource-nomadik-mtu.h> 32#include <linux/platform_data/clocksource-nomadik-mtu.h>
32#include <linux/of_irq.h> 33#include <linux/of_irq.h>
33#include <linux/of_address.h> 34#include <linux/of_address.h>
@@ -89,6 +90,48 @@ void cpu8815_add_gpios(resource_size_t *base, int num, int irq,
89 } 90 }
90} 91}
91 92
93static unsigned long out_low[] = { PIN_OUTPUT_LOW };
94static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
95static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
96static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
97
98static struct pinctrl_map __initdata nhk8815_pinmap[] = {
99 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
100 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
101 /* Hog in MMC/SD card mux */
102 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
103 /* MCCLK */
104 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
105 /* MCCMD */
106 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
107 /* MCCMDDIR */
108 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
109 /* MCDAT3-0 */
110 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
111 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
112 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
113 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
114 /* MCDAT0DIR */
115 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
116 /* MCDAT31DIR */
117 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
118 /* MCMSFBCLK */
119 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
120 /* CD input GPIO */
121 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
122 /* CD bias drive */
123 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
124 /* I2C0 */
125 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
126 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
127 /* I2C1 */
128 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
129 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
130 /* I2C2 */
131 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
132 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
133};
134
92static inline void 135static inline void
93cpu8815_add_pinctrl(struct device *parent, const char *name) 136cpu8815_add_pinctrl(struct device *parent, const char *name)
94{ 137{
@@ -98,6 +141,7 @@ cpu8815_add_pinctrl(struct device *parent, const char *name)
98 .id = -1, 141 .id = -1,
99 }; 142 };
100 143
144 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
101 platform_device_register_full(&pdevinfo); 145 platform_device_register_full(&pdevinfo);
102} 146}
103 147