aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3
diff options
context:
space:
mode:
authorValentin Longchamp <valentin.longchamp@epfl.ch>2009-08-12 05:29:20 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-08-14 06:41:11 -0400
commit8b1a540c245d68a77dbd909359cfc709b6a3a1bf (patch)
treefed3f7298d288e8f3a01c8752fe8432063e5bcdd /arch/arm/mach-mx3
parent77aa561db19229a36859018277f41be88684b487 (diff)
mx31moboard: initialize 4 input gpios for mx31moboard
These gpios are exported to userspace and are here to be used as a selector Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index ac337d264093..d3c6bb26271f 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -76,6 +76,9 @@ static unsigned int moboard_pins[] = {
76 /* LEDs */ 76 /* LEDs */
77 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1, 77 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1,
78 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3, 78 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3,
79 /* SEL */
80 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
81 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
79}; 82};
80 83
81static struct physmap_flash_data mx31moboard_flash_data = { 84static struct physmap_flash_data mx31moboard_flash_data = {
@@ -235,6 +238,34 @@ static struct platform_device mx31moboard_leds_device = {
235 }, 238 },
236}; 239};
237 240
241#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
242#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
243#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
244#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
245
246static void mx31moboard_init_sel_gpios(void)
247{
248 if (!gpio_request(SEL0, "sel0")) {
249 gpio_direction_input(SEL0);
250 gpio_export(SEL0, true);
251 }
252
253 if (!gpio_request(SEL1, "sel1")) {
254 gpio_direction_input(SEL1);
255 gpio_export(SEL1, true);
256 }
257
258 if (!gpio_request(SEL2, "sel2")) {
259 gpio_direction_input(SEL2);
260 gpio_export(SEL2, true);
261 }
262
263 if (!gpio_request(SEL3, "sel3")) {
264 gpio_direction_input(SEL3);
265 gpio_export(SEL3, true);
266 }
267}
268
238static struct platform_device *devices[] __initdata = { 269static struct platform_device *devices[] __initdata = {
239 &mx31moboard_flash, 270 &mx31moboard_flash,
240 &mx31moboard_leds_device, 271 &mx31moboard_leds_device,
@@ -256,6 +287,8 @@ static void __init mxc_board_init(void)
256 mxc_register_device(&mxc_uart_device0, &uart_pdata); 287 mxc_register_device(&mxc_uart_device0, &uart_pdata);
257 mxc_register_device(&mxc_uart_device4, &uart_pdata); 288 mxc_register_device(&mxc_uart_device4, &uart_pdata);
258 289
290 mx31moboard_init_sel_gpios();
291
259 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); 292 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
260 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); 293 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
261 294