diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-igep0020.c')
-rw-r--r-- | arch/arm/mach-omap2/board-igep0020.c | 124 |
1 files changed, 74 insertions, 50 deletions
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 5e035a58b809..0afa3011db0f 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | 20 | ||
21 | #include <linux/regulator/machine.h> | 21 | #include <linux/regulator/machine.h> |
22 | #include <linux/regulator/fixed.h> | ||
22 | #include <linux/i2c/twl.h> | 23 | #include <linux/i2c/twl.h> |
23 | #include <linux/mmc/host.h> | 24 | #include <linux/mmc/host.h> |
24 | 25 | ||
@@ -136,16 +137,9 @@ static struct mtd_partition igep2_onenand_partitions[] = { | |||
136 | }, | 137 | }, |
137 | }; | 138 | }; |
138 | 139 | ||
139 | static int igep2_onenand_setup(void __iomem *onenand_base, int freq) | ||
140 | { | ||
141 | /* nothing is required to be setup for onenand as of now */ | ||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | static struct omap_onenand_platform_data igep2_onenand_data = { | 140 | static struct omap_onenand_platform_data igep2_onenand_data = { |
146 | .parts = igep2_onenand_partitions, | 141 | .parts = igep2_onenand_partitions, |
147 | .nr_parts = ARRAY_SIZE(igep2_onenand_partitions), | 142 | .nr_parts = ARRAY_SIZE(igep2_onenand_partitions), |
148 | .onenand_setup = igep2_onenand_setup, | ||
149 | .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ | 143 | .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ |
150 | }; | 144 | }; |
151 | 145 | ||
@@ -159,35 +153,34 @@ static struct platform_device igep2_onenand_device = { | |||
159 | 153 | ||
160 | static void __init igep2_flash_init(void) | 154 | static void __init igep2_flash_init(void) |
161 | { | 155 | { |
162 | u8 cs = 0; | 156 | u8 cs = 0; |
163 | u8 onenandcs = GPMC_CS_NUM + 1; | 157 | u8 onenandcs = GPMC_CS_NUM + 1; |
164 | 158 | ||
165 | while (cs < GPMC_CS_NUM) { | 159 | for (cs = 0; cs < GPMC_CS_NUM; cs++) { |
166 | u32 ret = 0; | 160 | u32 ret; |
167 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | 161 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); |
168 | 162 | ||
169 | /* Check if NAND/oneNAND is configured */ | 163 | /* Check if NAND/oneNAND is configured */ |
170 | if ((ret & 0xC00) == 0x800) | 164 | if ((ret & 0xC00) == 0x800) |
171 | /* NAND found */ | 165 | /* NAND found */ |
172 | pr_err("IGEP v2: Unsupported NAND found\n"); | 166 | pr_err("IGEP2: Unsupported NAND found\n"); |
173 | else { | 167 | else { |
174 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); | 168 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); |
175 | if ((ret & 0x3F) == (ONENAND_MAP >> 24)) | 169 | if ((ret & 0x3F) == (ONENAND_MAP >> 24)) |
176 | /* ONENAND found */ | 170 | /* ONENAND found */ |
177 | onenandcs = cs; | 171 | onenandcs = cs; |
178 | } | 172 | } |
179 | cs++; | ||
180 | } | 173 | } |
174 | |||
181 | if (onenandcs > GPMC_CS_NUM) { | 175 | if (onenandcs > GPMC_CS_NUM) { |
182 | pr_err("IGEP v2: Unable to find configuration in GPMC\n"); | 176 | pr_err("IGEP2: Unable to find configuration in GPMC\n"); |
183 | return; | 177 | return; |
184 | } | 178 | } |
185 | 179 | ||
186 | if (onenandcs < GPMC_CS_NUM) { | 180 | igep2_onenand_data.cs = onenandcs; |
187 | igep2_onenand_data.cs = onenandcs; | 181 | |
188 | if (platform_device_register(&igep2_onenand_device) < 0) | 182 | if (platform_device_register(&igep2_onenand_device) < 0) |
189 | pr_err("IGEP v2: Unable to register OneNAND device\n"); | 183 | pr_err("IGEP2: Unable to register OneNAND device\n"); |
190 | } | ||
191 | } | 184 | } |
192 | 185 | ||
193 | #else | 186 | #else |
@@ -254,12 +247,8 @@ static inline void __init igep2_init_smsc911x(void) | |||
254 | static inline void __init igep2_init_smsc911x(void) { } | 247 | static inline void __init igep2_init_smsc911x(void) { } |
255 | #endif | 248 | #endif |
256 | 249 | ||
257 | static struct omap_board_config_kernel igep2_config[] __initdata = { | 250 | static struct regulator_consumer_supply igep2_vmmc1_supply = |
258 | }; | 251 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); |
259 | |||
260 | static struct regulator_consumer_supply igep2_vmmc1_supply = { | ||
261 | .supply = "vmmc", | ||
262 | }; | ||
263 | 252 | ||
264 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 253 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
265 | static struct regulator_init_data igep2_vmmc1 = { | 254 | static struct regulator_init_data igep2_vmmc1 = { |
@@ -276,6 +265,52 @@ static struct regulator_init_data igep2_vmmc1 = { | |||
276 | .consumer_supplies = &igep2_vmmc1_supply, | 265 | .consumer_supplies = &igep2_vmmc1_supply, |
277 | }; | 266 | }; |
278 | 267 | ||
268 | static struct regulator_consumer_supply igep2_vio_supply = | ||
269 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | ||
270 | |||
271 | static struct regulator_init_data igep2_vio = { | ||
272 | .constraints = { | ||
273 | .min_uV = 1800000, | ||
274 | .max_uV = 1800000, | ||
275 | .apply_uV = 1, | ||
276 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
277 | | REGULATOR_MODE_STANDBY, | ||
278 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
279 | | REGULATOR_CHANGE_MODE | ||
280 | | REGULATOR_CHANGE_STATUS, | ||
281 | }, | ||
282 | .num_consumer_supplies = 1, | ||
283 | .consumer_supplies = &igep2_vio_supply, | ||
284 | }; | ||
285 | |||
286 | static struct regulator_consumer_supply igep2_vmmc2_supply = | ||
287 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | ||
288 | |||
289 | static struct regulator_init_data igep2_vmmc2 = { | ||
290 | .constraints = { | ||
291 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
292 | .always_on = 1, | ||
293 | }, | ||
294 | .num_consumer_supplies = 1, | ||
295 | .consumer_supplies = &igep2_vmmc2_supply, | ||
296 | }; | ||
297 | |||
298 | static struct fixed_voltage_config igep2_vwlan = { | ||
299 | .supply_name = "vwlan", | ||
300 | .microvolts = 3300000, | ||
301 | .gpio = -EINVAL, | ||
302 | .enabled_at_boot = 1, | ||
303 | .init_data = &igep2_vmmc2, | ||
304 | }; | ||
305 | |||
306 | static struct platform_device igep2_vwlan_device = { | ||
307 | .name = "reg-fixed-voltage", | ||
308 | .id = 0, | ||
309 | .dev = { | ||
310 | .platform_data = &igep2_vwlan, | ||
311 | }, | ||
312 | }; | ||
313 | |||
279 | static struct omap2_hsmmc_info mmc[] = { | 314 | static struct omap2_hsmmc_info mmc[] = { |
280 | { | 315 | { |
281 | .mmc = 1, | 316 | .mmc = 1, |
@@ -317,6 +352,7 @@ static struct gpio_led igep2_gpio_leds[] = { | |||
317 | .name = "gpio-led:green:d1", | 352 | .name = "gpio-led:green:d1", |
318 | .default_trigger = "heartbeat", | 353 | .default_trigger = "heartbeat", |
319 | .gpio = -EINVAL, /* gets replaced */ | 354 | .gpio = -EINVAL, /* gets replaced */ |
355 | .active_low = 1, | ||
320 | }, | 356 | }, |
321 | }; | 357 | }; |
322 | 358 | ||
@@ -342,24 +378,21 @@ static void __init igep2_leds_init(void) | |||
342 | static inline void igep2_leds_init(void) | 378 | static inline void igep2_leds_init(void) |
343 | { | 379 | { |
344 | if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) && | 380 | if ((gpio_request(IGEP2_GPIO_LED0_RED, "gpio-led:red:d0") == 0) && |
345 | (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) { | 381 | (gpio_direction_output(IGEP2_GPIO_LED0_RED, 0) == 0)) |
346 | gpio_export(IGEP2_GPIO_LED0_RED, 0); | 382 | gpio_export(IGEP2_GPIO_LED0_RED, 0); |
347 | gpio_set_value(IGEP2_GPIO_LED0_RED, 0); | 383 | else |
348 | } else | ||
349 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n"); | 384 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n"); |
350 | 385 | ||
351 | if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) && | 386 | if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "gpio-led:green:d0") == 0) && |
352 | (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) { | 387 | (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 0) == 0)) |
353 | gpio_export(IGEP2_GPIO_LED0_GREEN, 0); | 388 | gpio_export(IGEP2_GPIO_LED0_GREEN, 0); |
354 | gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); | 389 | else |
355 | } else | ||
356 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); | 390 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); |
357 | 391 | ||
358 | if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) && | 392 | if ((gpio_request(IGEP2_GPIO_LED1_RED, "gpio-led:red:d1") == 0) && |
359 | (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { | 393 | (gpio_direction_output(IGEP2_GPIO_LED1_RED, 0) == 0)) |
360 | gpio_export(IGEP2_GPIO_LED1_RED, 0); | 394 | gpio_export(IGEP2_GPIO_LED1_RED, 0); |
361 | gpio_set_value(IGEP2_GPIO_LED1_RED, 0); | 395 | else |
362 | } else | ||
363 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); | 396 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); |
364 | 397 | ||
365 | } | 398 | } |
@@ -373,12 +406,6 @@ static int igep2_twl_gpio_setup(struct device *dev, | |||
373 | omap2_hsmmc_init(mmc); | 406 | omap2_hsmmc_init(mmc); |
374 | 407 | ||
375 | /* | 408 | /* |
376 | * link regulators to MMC adapters ... we "know" the | ||
377 | * regulators will be set up only *after* we return. | ||
378 | */ | ||
379 | igep2_vmmc1_supply.dev = mmc[0].dev; | ||
380 | |||
381 | /* | ||
382 | * REVISIT: need ehci-omap hooks for external VBUS | 409 | * REVISIT: need ehci-omap hooks for external VBUS |
383 | * power switch and overcurrent detect | 410 | * power switch and overcurrent detect |
384 | */ | 411 | */ |
@@ -397,10 +424,9 @@ static int igep2_twl_gpio_setup(struct device *dev, | |||
397 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ | 424 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ |
398 | #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE) | 425 | #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE) |
399 | if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0) | 426 | if ((gpio_request(gpio+TWL4030_GPIO_MAX+1, "gpio-led:green:d1") == 0) |
400 | && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) { | 427 | && (gpio_direction_output(gpio + TWL4030_GPIO_MAX + 1, 1) == 0)) |
401 | gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0); | 428 | gpio_export(gpio + TWL4030_GPIO_MAX + 1, 0); |
402 | gpio_set_value(gpio + TWL4030_GPIO_MAX + 1, 0); | 429 | else |
403 | } else | ||
404 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n"); | 430 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n"); |
405 | #else | 431 | #else |
406 | igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; | 432 | igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; |
@@ -489,15 +515,15 @@ static void __init igep2_display_init(void) | |||
489 | 515 | ||
490 | static struct platform_device *igep2_devices[] __initdata = { | 516 | static struct platform_device *igep2_devices[] __initdata = { |
491 | &igep2_dss_device, | 517 | &igep2_dss_device, |
518 | &igep2_vwlan_device, | ||
492 | }; | 519 | }; |
493 | 520 | ||
494 | static void __init igep2_init_irq(void) | 521 | static void __init igep2_init_irq(void) |
495 | { | 522 | { |
496 | omap_board_config = igep2_config; | 523 | omap2_init_common_infrastructure(); |
497 | omap_board_config_size = ARRAY_SIZE(igep2_config); | 524 | omap2_init_common_devices(m65kxxxxam_sdrc_params, |
498 | omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); | 525 | m65kxxxxam_sdrc_params); |
499 | omap_init_irq(); | 526 | omap_init_irq(); |
500 | omap_gpio_init(); | ||
501 | } | 527 | } |
502 | 528 | ||
503 | static struct twl4030_codec_audio_data igep2_audio_data = { | 529 | static struct twl4030_codec_audio_data igep2_audio_data = { |
@@ -519,7 +545,7 @@ static struct twl4030_platform_data igep2_twldata = { | |||
519 | .gpio = &igep2_twl4030_gpio_pdata, | 545 | .gpio = &igep2_twl4030_gpio_pdata, |
520 | .vmmc1 = &igep2_vmmc1, | 546 | .vmmc1 = &igep2_vmmc1, |
521 | .vpll2 = &igep2_vpll2, | 547 | .vpll2 = &igep2_vpll2, |
522 | 548 | .vio = &igep2_vio, | |
523 | }; | 549 | }; |
524 | 550 | ||
525 | static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = { | 551 | static struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = { |
@@ -577,8 +603,6 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
577 | static struct omap_board_mux board_mux[] __initdata = { | 603 | static struct omap_board_mux board_mux[] __initdata = { |
578 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 604 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
579 | }; | 605 | }; |
580 | #else | ||
581 | #define board_mux NULL | ||
582 | #endif | 606 | #endif |
583 | 607 | ||
584 | #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE) | 608 | #if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE) |