diff options
Diffstat (limited to 'arch/arm/mach-mx3/armadillo5x0.c')
-rw-r--r-- | arch/arm/mach-mx3/armadillo5x0.c | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c index 776c0ee1b3cd..54aab401dbdf 100644 --- a/arch/arm/mach-mx3/armadillo5x0.c +++ b/arch/arm/mach-mx3/armadillo5x0.c | |||
@@ -33,6 +33,9 @@ | |||
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/mtd/physmap.h> | 34 | #include <linux/mtd/physmap.h> |
35 | #include <linux/io.h> | 35 | #include <linux/io.h> |
36 | #include <linux/input.h> | ||
37 | #include <linux/gpio_keys.h> | ||
38 | #include <linux/i2c.h> | ||
36 | 39 | ||
37 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
38 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
@@ -97,6 +100,47 @@ static int armadillo5x0_pins[] = { | |||
97 | MX31_PIN_FPSHIFT__FPSHIFT, | 100 | MX31_PIN_FPSHIFT__FPSHIFT, |
98 | MX31_PIN_DRDY0__DRDY0, | 101 | MX31_PIN_DRDY0__DRDY0, |
99 | IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ | 102 | IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ |
103 | /* I2C2 */ | ||
104 | MX31_PIN_CSPI2_MOSI__SCL, | ||
105 | MX31_PIN_CSPI2_MISO__SDA, | ||
106 | }; | ||
107 | |||
108 | /* RTC over I2C*/ | ||
109 | #define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4) | ||
110 | |||
111 | static struct i2c_board_info armadillo5x0_i2c_rtc = { | ||
112 | I2C_BOARD_INFO("s35390a", 0x30), | ||
113 | }; | ||
114 | |||
115 | /* GPIO BUTTONS */ | ||
116 | static struct gpio_keys_button armadillo5x0_buttons[] = { | ||
117 | { | ||
118 | .code = KEY_ENTER, /*28*/ | ||
119 | .gpio = IOMUX_TO_GPIO(MX31_PIN_SCLK0), | ||
120 | .active_low = 1, | ||
121 | .desc = "menu", | ||
122 | .wakeup = 1, | ||
123 | }, { | ||
124 | .code = KEY_BACK, /*158*/ | ||
125 | .gpio = IOMUX_TO_GPIO(MX31_PIN_SRST0), | ||
126 | .active_low = 1, | ||
127 | .desc = "back", | ||
128 | .wakeup = 1, | ||
129 | } | ||
130 | }; | ||
131 | |||
132 | static struct gpio_keys_platform_data armadillo5x0_button_data = { | ||
133 | .buttons = armadillo5x0_buttons, | ||
134 | .nbuttons = ARRAY_SIZE(armadillo5x0_buttons), | ||
135 | }; | ||
136 | |||
137 | static struct platform_device armadillo5x0_button_device = { | ||
138 | .name = "gpio-keys", | ||
139 | .id = -1, | ||
140 | .num_resources = 0, | ||
141 | .dev = { | ||
142 | .platform_data = &armadillo5x0_button_data, | ||
143 | } | ||
100 | }; | 144 | }; |
101 | 145 | ||
102 | /* | 146 | /* |
@@ -278,7 +322,7 @@ static struct resource armadillo5x0_smc911x_resources[] = { | |||
278 | }; | 322 | }; |
279 | 323 | ||
280 | static struct smsc911x_platform_config smsc911x_info = { | 324 | static struct smsc911x_platform_config smsc911x_info = { |
281 | .flags = SMSC911X_USE_32BIT, | 325 | .flags = SMSC911X_USE_16BIT, |
282 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | 326 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
283 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | 327 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
284 | }; | 328 | }; |
@@ -300,6 +344,8 @@ static struct imxuart_platform_data uart_pdata = { | |||
300 | 344 | ||
301 | static struct platform_device *devices[] __initdata = { | 345 | static struct platform_device *devices[] __initdata = { |
302 | &armadillo5x0_smc911x_device, | 346 | &armadillo5x0_smc911x_device, |
347 | &mxc_i2c_device1, | ||
348 | &armadillo5x0_button_device, | ||
303 | }; | 349 | }; |
304 | 350 | ||
305 | /* | 351 | /* |
@@ -335,6 +381,18 @@ static void __init armadillo5x0_init(void) | |||
335 | 381 | ||
336 | /* set NAND page size to 2k if not configured via boot mode pins */ | 382 | /* set NAND page size to 2k if not configured via boot mode pins */ |
337 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); | 383 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); |
384 | |||
385 | /* RTC */ | ||
386 | /* Get RTC IRQ and register the chip */ | ||
387 | if (gpio_request(ARMADILLO5X0_RTC_GPIO, "rtc") == 0) { | ||
388 | if (gpio_direction_input(ARMADILLO5X0_RTC_GPIO) == 0) | ||
389 | armadillo5x0_i2c_rtc.irq = gpio_to_irq(ARMADILLO5X0_RTC_GPIO); | ||
390 | else | ||
391 | gpio_free(ARMADILLO5X0_RTC_GPIO); | ||
392 | } | ||
393 | if (armadillo5x0_i2c_rtc.irq == 0) | ||
394 | pr_warning("armadillo5x0_init: failed to get RTC IRQ\n"); | ||
395 | i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1); | ||
338 | } | 396 | } |
339 | 397 | ||
340 | static void __init armadillo5x0_timer_init(void) | 398 | static void __init armadillo5x0_timer_init(void) |