aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-igep0020.c
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2011-05-12 17:31:03 -0400
committerTony Lindgren <tony@atomide.com>2011-05-17 06:31:15 -0400
commit2a60997a538cf60a3b5ebcfa2b9909c868e7aa20 (patch)
tree22993711aa54358ba767af6bda97f5dfb5b99f0d /arch/arm/mach-omap2/board-igep0020.c
parent0d4ab9a58ff6d29e84b6f29a5084323f0374ef6a (diff)
omap: igep0020: add support for IGEP3
Add IGEP3 machine support to board-igep0020 Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Enric Balletbo i Serra <eballetbo@iseebcn.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-igep0020.c')
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c103
1 files changed, 80 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index ea7cbc69f7cd..0d6d583e8b3c 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -55,6 +55,11 @@
55#define IGEP2_RC_GPIO_WIFI_NRESET 139 55#define IGEP2_RC_GPIO_WIFI_NRESET 139
56#define IGEP2_RC_GPIO_BT_NRESET 137 56#define IGEP2_RC_GPIO_BT_NRESET 137
57 57
58#define IGEP3_GPIO_LED0_GREEN 54
59#define IGEP3_GPIO_LED0_RED 53
60#define IGEP3_GPIO_LED1_RED 16
61#define IGEP3_GPIO_USBH_NRESET 183
62
58/* 63/*
59 * IGEP2 Hardware Revision Table 64 * IGEP2 Hardware Revision Table
60 * 65 *
@@ -69,6 +74,7 @@
69 74
70#define IGEP2_BOARD_HWREV_B 0 75#define IGEP2_BOARD_HWREV_B 0
71#define IGEP2_BOARD_HWREV_C 1 76#define IGEP2_BOARD_HWREV_C 1
77#define IGEP3_BOARD_HWREV 2
72 78
73static u8 hwrev; 79static u8 hwrev;
74 80
@@ -76,6 +82,11 @@ static void __init igep2_get_revision(void)
76{ 82{
77 u8 ret; 83 u8 ret;
78 84
85 if (machine_is_igep0030()) {
86 hwrev = IGEP3_BOARD_HWREV;
87 return;
88 }
89
79 omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT); 90 omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
80 91
81 if (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) { 92 if (gpio_request_one(IGEP2_GPIO_LED1_RED, GPIOF_IN, "GPIO_HW0_REV")) {
@@ -332,24 +343,40 @@ static struct platform_device igep_led_device = {
332 343
333static void __init igep_leds_init(void) 344static void __init igep_leds_init(void)
334{ 345{
335 igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED; 346 if (machine_is_igep0020()) {
336 igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN; 347 igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
337 igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED; 348 igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
349 igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
350 } else {
351 igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
352 igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
353 igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
354 }
338 355
339 platform_device_register(&igep_led_device); 356 platform_device_register(&igep_led_device);
340} 357}
341 358
342#else 359#else
343static struct gpio igep_gpio_leds[] __initdata = { 360static struct gpio igep_gpio_leds[] __initdata = {
344 { IGEP2_GPIO_LED0_RED, GPIOF_OUT_INIT_LOW, "gpio-led:red:d0" }, 361 { -EINVAL, GPIOF_OUT_INIT_LOW, "gpio-led:red:d0" },
345 { IGEP2_GPIO_LED0_GREEN, GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" }, 362 { -EINVAL, GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" },
346 { IGEP2_GPIO_LED1_RED, GPIOF_OUT_INIT_LOW, "gpio-led:red:d1" }, 363 { -EINVAL, GPIOF_OUT_INIT_LOW, "gpio-led:red:d1" },
347}; 364};
348 365
349static inline void igep_leds_init(void) 366static inline void igep_leds_init(void)
350{ 367{
351 int i; 368 int i;
352 369
370 if (machine_is_igep0020()) {
371 igep_gpio_leds[0].gpio = IGEP2_GPIO_LED0_RED;
372 igep_gpio_leds[1].gpio = IGEP2_GPIO_LED0_GREEN;
373 igep_gpio_leds[2].gpio = IGEP2_GPIO_LED1_RED;
374 } else {
375 igep_gpio_leds[0].gpio = IGEP3_GPIO_LED0_RED;
376 igep_gpio_leds[1].gpio = IGEP3_GPIO_LED0_GREEN;
377 igep_gpio_leds[2].gpio = IGEP3_GPIO_LED1_RED;
378 }
379
353 if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) { 380 if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) {
354 pr_warning("IGEP v2: Could not obtain leds gpios\n"); 381 pr_warning("IGEP v2: Could not obtain leds gpios\n");
355 return; 382 return;
@@ -386,6 +413,9 @@ static int igep_twl_gpio_setup(struct device *dev,
386 igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; 413 igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1;
387#endif 414#endif
388 415
416 if (machine_is_igep0030())
417 return 0;
418
389 /* 419 /*
390 * REVISIT: need ehci-omap hooks for external VBUS 420 * REVISIT: need ehci-omap hooks for external VBUS
391 * power switch and overcurrent detect 421 * power switch and overcurrent detect
@@ -548,18 +578,20 @@ static void __init igep_i2c_init(void)
548{ 578{
549 int ret; 579 int ret;
550 580
551 /* 581 if (machine_is_igep0020()) {
552 * Bus 3 is attached to the DVI port where devices like the pico DLP 582 /*
553 * projector don't work reliably with 400kHz 583 * Bus 3 is attached to the DVI port where devices like the
554 */ 584 * pico DLP projector don't work reliably with 400kHz
555 ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo, 585 */
556 ARRAY_SIZE(igep2_i2c3_boardinfo)); 586 ret = omap_register_i2c_bus(3, 100, igep2_i2c3_boardinfo,
557 if (ret) 587 ARRAY_SIZE(igep2_i2c3_boardinfo));
558 pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret); 588 if (ret)
559 589 pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
560 igep_twldata.codec = &igep2_codec_data; 590
561 igep_twldata.keypad = &igep2_keypad_pdata; 591 igep_twldata.codec = &igep2_codec_data;
562 igep_twldata.vpll2 = &igep2_vpll2; 592 igep_twldata.keypad = &igep2_keypad_pdata;
593 igep_twldata.vpll2 = &igep2_vpll2;
594 }
563 595
564 omap3_pmic_init("twl4030", &igep_twldata); 596 omap3_pmic_init("twl4030", &igep_twldata);
565} 597}
@@ -575,6 +607,17 @@ static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = {
575 .reset_gpio_port[2] = -EINVAL, 607 .reset_gpio_port[2] = -EINVAL,
576}; 608};
577 609
610static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = {
611 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
612 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
613 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
614
615 .phy_reset = true,
616 .reset_gpio_port[0] = -EINVAL,
617 .reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
618 .reset_gpio_port[2] = -EINVAL,
619};
620
578#ifdef CONFIG_OMAP_MUX 621#ifdef CONFIG_OMAP_MUX
579static struct omap_board_mux board_mux[] __initdata = { 622static struct omap_board_mux board_mux[] __initdata = {
580 { .reg_offset = OMAP_MUX_TERMINATOR }, 623 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -597,7 +640,7 @@ static void __init igep_wlan_bt_init(void)
597 igep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD; 640 igep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD;
598 igep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET; 641 igep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET;
599 igep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET; 642 igep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET;
600 } else if (hwrev == IGEP2_BOARD_HWREV_C) { 643 } else if (hwrev == IGEP2_BOARD_HWREV_C || machine_is_igep0030()) {
601 igep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD; 644 igep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD;
602 igep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET; 645 igep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET;
603 igep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET; 646 igep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET;
@@ -645,10 +688,14 @@ static void __init igep_init(void)
645 */ 688 */
646 igep_wlan_bt_init(); 689 igep_wlan_bt_init();
647 690
648 omap_display_init(&igep2_dss_data); 691 if (machine_is_igep0020()) {
649 igep2_display_init(); 692 omap_display_init(&igep2_dss_data);
650 igep2_init_smsc911x(); 693 igep2_display_init();
651 usbhs_init(&igep2_usbhs_bdata); 694 igep2_init_smsc911x();
695 usbhs_init(&igep2_usbhs_bdata);
696 } else {
697 usbhs_init(&igep3_usbhs_bdata);
698 }
652} 699}
653 700
654MACHINE_START(IGEP0020, "IGEP v2 board") 701MACHINE_START(IGEP0020, "IGEP v2 board")
@@ -660,3 +707,13 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
660 .init_machine = igep_init, 707 .init_machine = igep_init,
661 .timer = &omap_timer, 708 .timer = &omap_timer,
662MACHINE_END 709MACHINE_END
710
711MACHINE_START(IGEP0030, "IGEP OMAP3 module")
712 .boot_params = 0x80000100,
713 .reserve = omap_reserve,
714 .map_io = omap3_map_io,
715 .init_early = igep_init_early,
716 .init_irq = omap_init_irq,
717 .init_machine = igep_init,
718 .timer = &omap_timer,
719MACHINE_END