diff options
Diffstat (limited to 'arch/arm/mach-nomadik')
-rw-r--r-- | arch/arm/mach-nomadik/board-nhk8815.c | 36 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/cpu-8815.c | 13 |
2 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index f4535a7dadf5..66862fb981f9 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | #include <linux/i2c.h> | 24 | #include <linux/i2c.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/pinctrl/machine.h> | ||
26 | #include <asm/hardware/vic.h> | 27 | #include <asm/hardware/vic.h> |
27 | #include <asm/sizes.h> | 28 | #include <asm/sizes.h> |
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
@@ -33,6 +34,7 @@ | |||
33 | 34 | ||
34 | #include <plat/gpio-nomadik.h> | 35 | #include <plat/gpio-nomadik.h> |
35 | #include <plat/mtu.h> | 36 | #include <plat/mtu.h> |
37 | #include <plat/pincfg.h> | ||
36 | 38 | ||
37 | #include <mach/nand.h> | 39 | #include <mach/nand.h> |
38 | #include <mach/fsmc.h> | 40 | #include <mach/fsmc.h> |
@@ -291,8 +293,42 @@ static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = { | |||
291 | }, | 293 | }, |
292 | }; | 294 | }; |
293 | 295 | ||
296 | static unsigned long out_low[] = { PIN_OUTPUT_LOW }; | ||
297 | static unsigned long out_high[] = { PIN_OUTPUT_HIGH }; | ||
298 | static unsigned long in_nopull[] = { PIN_INPUT_NOPULL }; | ||
299 | static unsigned long in_pullup[] = { PIN_INPUT_PULLUP }; | ||
300 | |||
301 | static 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 | }; | ||
328 | |||
294 | static void __init nhk8815_platform_init(void) | 329 | static void __init nhk8815_platform_init(void) |
295 | { | 330 | { |
331 | pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap)); | ||
296 | cpu8815_platform_init(); | 332 | cpu8815_platform_init(); |
297 | nhk8815_onenand_init(); | 333 | nhk8815_onenand_init(); |
298 | platform_add_devices(nhk8815_platform_devices, | 334 | 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 6fd8e46567a4..b617eaed0ce5 100644 --- a/arch/arm/mach-nomadik/cpu-8815.c +++ b/arch/arm/mach-nomadik/cpu-8815.c | |||
@@ -83,6 +83,18 @@ void cpu8815_add_gpios(resource_size_t *base, int num, int irq, | |||
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | static inline void | ||
87 | cpu8815_add_pinctrl(struct device *parent, const char *name) | ||
88 | { | ||
89 | struct platform_device_info pdevinfo = { | ||
90 | .parent = parent, | ||
91 | .name = name, | ||
92 | .id = -1, | ||
93 | }; | ||
94 | |||
95 | platform_device_register_full(&pdevinfo); | ||
96 | } | ||
97 | |||
86 | static int __init cpu8815_init(void) | 98 | static int __init cpu8815_init(void) |
87 | { | 99 | { |
88 | struct nmk_gpio_platform_data pdata = { | 100 | struct nmk_gpio_platform_data pdata = { |
@@ -91,6 +103,7 @@ static int __init cpu8815_init(void) | |||
91 | 103 | ||
92 | cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), | 104 | cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), |
93 | IRQ_GPIO0, &pdata); | 105 | IRQ_GPIO0, &pdata); |
106 | cpu8815_add_pinctrl(NULL, "pinctrl-stn8815"); | ||
94 | amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); | 107 | amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); |
95 | amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0); | 108 | amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0); |
96 | return 0; | 109 | return 0; |