aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c45
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c44
2 files changed, 44 insertions, 45 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index d152d7bdf411..2f2c96bee7df 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -24,8 +24,6 @@
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/pinctrl/machine.h>
28#include <linux/platform_data/pinctrl-nomadik.h>
29#include <linux/platform_data/clocksource-nomadik-mtu.h> 27#include <linux/platform_data/clocksource-nomadik-mtu.h>
30#include <asm/sizes.h> 28#include <asm/sizes.h>
31#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -293,51 +291,8 @@ static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = {
293 }, 291 },
294}; 292};
295 293
296static unsigned long out_low[] = { PIN_OUTPUT_LOW };
297static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
298static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
299static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
300
301static struct pinctrl_map __initdata nhk8815_pinmap[] = {
302 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
303 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
304 /* Hog in MMC/SD card mux */
305 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
306 /* MCCLK */
307 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
308 /* MCCMD */
309 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
310 /* MCCMDDIR */
311 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
312 /* MCDAT3-0 */
313 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
314 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
315 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
316 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
317 /* MCDAT0DIR */
318 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
319 /* MCDAT31DIR */
320 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
321 /* MCMSFBCLK */
322 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
323 /* CD input GPIO */
324 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
325 /* CD bias drive */
326 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
327 /* I2C0 */
328 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
329 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
330 /* I2C1 */
331 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
332 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
333 /* I2C2 */
334 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
335 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
336};
337
338static void __init nhk8815_platform_init(void) 294static void __init nhk8815_platform_init(void)
339{ 295{
340 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
341 cpu8815_platform_init(); 296 cpu8815_platform_init();
342 nhk8815_onenand_init(); 297 nhk8815_onenand_init();
343 platform_add_devices(nhk8815_platform_devices, 298 platform_add_devices(nhk8815_platform_devices,
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