diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-2430sdp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-2430sdp.c | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 24688efaa445..83fa37211d77 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/partitions.h> | 20 | #include <linux/mtd/partitions.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/i2c/twl4030.h> | ||
22 | #include <linux/err.h> | 23 | #include <linux/err.h> |
23 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
@@ -35,6 +36,7 @@ | |||
35 | #include <mach/common.h> | 36 | #include <mach/common.h> |
36 | #include <mach/gpmc.h> | 37 | #include <mach/gpmc.h> |
37 | 38 | ||
39 | #include "mmc-twl4030.h" | ||
38 | 40 | ||
39 | #define SDP2430_FLASH_CS 0 | 41 | #define SDP2430_FLASH_CS 0 |
40 | #define SDP2430_SMC91X_CS 5 | 42 | #define SDP2430_SMC91X_CS 5 |
@@ -168,13 +170,13 @@ static inline void __init sdp2430_init_smc91x(void) | |||
168 | sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f; | 170 | sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f; |
169 | udelay(100); | 171 | udelay(100); |
170 | 172 | ||
171 | if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) { | 173 | if (gpio_request(OMAP24XX_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { |
172 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", | 174 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", |
173 | OMAP24XX_ETHR_GPIO_IRQ); | 175 | OMAP24XX_ETHR_GPIO_IRQ); |
174 | gpmc_cs_free(eth_cs); | 176 | gpmc_cs_free(eth_cs); |
175 | goto out; | 177 | goto out; |
176 | } | 178 | } |
177 | omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1); | 179 | gpio_direction_input(OMAP24XX_ETHR_GPIO_IRQ); |
178 | 180 | ||
179 | out: | 181 | out: |
180 | clk_disable(gpmc_fck); | 182 | clk_disable(gpmc_fck); |
@@ -197,12 +199,58 @@ static struct omap_board_config_kernel sdp2430_config[] = { | |||
197 | {OMAP_TAG_UART, &sdp2430_uart_config}, | 199 | {OMAP_TAG_UART, &sdp2430_uart_config}, |
198 | }; | 200 | }; |
199 | 201 | ||
202 | |||
203 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { | ||
204 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
205 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
206 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
207 | }; | ||
208 | |||
209 | static struct twl4030_platform_data sdp2430_twldata = { | ||
210 | .irq_base = TWL4030_IRQ_BASE, | ||
211 | .irq_end = TWL4030_IRQ_END, | ||
212 | |||
213 | /* platform_data for children goes here */ | ||
214 | .gpio = &sdp2430_gpio_data, | ||
215 | }; | ||
216 | |||
217 | static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { | ||
218 | { | ||
219 | I2C_BOARD_INFO("twl4030", 0x48), | ||
220 | .flags = I2C_CLIENT_WAKE, | ||
221 | .irq = INT_24XX_SYS_NIRQ, | ||
222 | .platform_data = &sdp2430_twldata, | ||
223 | }, | ||
224 | }; | ||
225 | |||
226 | static int __init omap2430_i2c_init(void) | ||
227 | { | ||
228 | omap_register_i2c_bus(1, 400, NULL, 0); | ||
229 | omap_register_i2c_bus(2, 2600, sdp2430_i2c_boardinfo, | ||
230 | ARRAY_SIZE(sdp2430_i2c_boardinfo)); | ||
231 | return 0; | ||
232 | } | ||
233 | |||
234 | static struct twl4030_hsmmc_info mmc[] __initdata = { | ||
235 | { | ||
236 | .mmc = 1, | ||
237 | .wires = 4, | ||
238 | .gpio_cd = -EINVAL, | ||
239 | .gpio_wp = -EINVAL, | ||
240 | .ext_clock = 1, | ||
241 | }, | ||
242 | {} /* Terminator */ | ||
243 | }; | ||
244 | |||
200 | static void __init omap_2430sdp_init(void) | 245 | static void __init omap_2430sdp_init(void) |
201 | { | 246 | { |
247 | omap2430_i2c_init(); | ||
248 | |||
202 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 249 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
203 | omap_board_config = sdp2430_config; | 250 | omap_board_config = sdp2430_config; |
204 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | 251 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); |
205 | omap_serial_init(); | 252 | omap_serial_init(); |
253 | twl4030_mmc_init(mmc); | ||
206 | } | 254 | } |
207 | 255 | ||
208 | static void __init omap_2430sdp_map_io(void) | 256 | static void __init omap_2430sdp_map_io(void) |