aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorEnric Balletbo i Serra <eballetbo@gmail.com>2010-10-08 13:22:43 -0400
committerTony Lindgren <tony@atomide.com>2010-10-08 13:22:43 -0400
commit5a9fcc9980ae741c4657029c7e92d914072f824a (patch)
treea036ffc397a59137f81a8c0621b878cc85e0f5ea /arch/arm/mach-omap2
parent3f8c48d95f8e4ed3ea241c3e8704b5ff6c423fa4 (diff)
omap3: Fix handling some GPIO's for WLAN-BT combo on IGEP v2
Some GPIO's used by WLAN-BT combo on IGEP v2 depends on hardware revision. This patch handles these GPIO's. ---------------------------------------------------------- | Hw Rev. | WIFI_NPD | WIFI_NRESET | BT_NRESET | ---------------------------------------------------------- | B | gpio94 | gpio95 | - | | B/C (B-compatible) | gpio94 | gpio95 | gpio137 | | C | gpio138 | gpio139 | gpio137 | ---------------------------------------------------------- Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c96
1 files changed, 69 insertions, 27 deletions
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index e70bc872bc26..22f73b4e0b43 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -39,22 +39,28 @@
39#define IGEP2_SMSC911X_CS 5 39#define IGEP2_SMSC911X_CS 5
40#define IGEP2_SMSC911X_GPIO 176 40#define IGEP2_SMSC911X_GPIO 176
41#define IGEP2_GPIO_USBH_NRESET 24 41#define IGEP2_GPIO_USBH_NRESET 24
42#define IGEP2_GPIO_LED0_GREEN 26 42#define IGEP2_GPIO_LED0_GREEN 26
43#define IGEP2_GPIO_LED0_RED 27 43#define IGEP2_GPIO_LED0_RED 27
44#define IGEP2_GPIO_LED1_RED 28 44#define IGEP2_GPIO_LED1_RED 28
45#define IGEP2_GPIO_DVI_PUP 170 45#define IGEP2_GPIO_DVI_PUP 170
46#define IGEP2_GPIO_WIFI_NPD 94 46
47#define IGEP2_GPIO_WIFI_NRESET 95 47#define IGEP2_RB_GPIO_WIFI_NPD 94
48#define IGEP2_RB_GPIO_WIFI_NRESET 95
49#define IGEP2_RB_GPIO_BT_NRESET 137
50#define IGEP2_RC_GPIO_WIFI_NPD 138
51#define IGEP2_RC_GPIO_WIFI_NRESET 139
52#define IGEP2_RC_GPIO_BT_NRESET 137
48 53
49/* 54/*
50 * IGEP2 Hardware Revision Table 55 * IGEP2 Hardware Revision Table
51 * 56 *
52 * -------------------------- 57 * --------------------------------------------------------------------------
53 * | Id. | Hw Rev. | HW0 (28) | 58 * | Id. | Hw Rev. | HW0 (28) | WIFI_NPD | WIFI_NRESET | BT_NRESET |
54 * -------------------------- 59 * --------------------------------------------------------------------------
55 * | 0 | B/C | high | 60 * | 0 | B | high | gpio94 | gpio95 | - |
56 * | 1 | C | low | 61 * | 0 | B/C (B-compatible) | high | gpio94 | gpio95 | gpio137 |
57 * -------------------------- 62 * | 1 | C | low | gpio138 | gpio139 | gpio137 |
63 * --------------------------------------------------------------------------
58 */ 64 */
59 65
60#define IGEP2_BOARD_HWREV_B 0 66#define IGEP2_BOARD_HWREV_B 0
@@ -296,12 +302,14 @@ static struct omap2_hsmmc_info mmc[] = {
296 .gpio_cd = -EINVAL, 302 .gpio_cd = -EINVAL,
297 .gpio_wp = -EINVAL, 303 .gpio_wp = -EINVAL,
298 }, 304 },
305#if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
299 { 306 {
300 .mmc = 2, 307 .mmc = 2,
301 .caps = MMC_CAP_4_BIT_DATA, 308 .caps = MMC_CAP_4_BIT_DATA,
302 .gpio_cd = -EINVAL, 309 .gpio_cd = -EINVAL,
303 .gpio_wp = -EINVAL, 310 .gpio_wp = -EINVAL,
304 }, 311 },
312#endif
305 {} /* Terminator */ 313 {} /* Terminator */
306}; 314};
307 315
@@ -578,6 +586,50 @@ static struct omap_board_mux board_mux[] __initdata = {
578#define board_mux NULL 586#define board_mux NULL
579#endif 587#endif
580 588
589#if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)
590
591static void __init igep2_wlan_bt_init(void)
592{
593 unsigned npd, wreset, btreset;
594
595 /* GPIO's for WLAN-BT combo depends on hardware revision */
596 if (hwrev == IGEP2_BOARD_HWREV_B) {
597 npd = IGEP2_RB_GPIO_WIFI_NPD;
598 wreset = IGEP2_RB_GPIO_WIFI_NRESET;
599 btreset = IGEP2_RB_GPIO_BT_NRESET;
600 } else if (hwrev == IGEP2_BOARD_HWREV_C) {
601 npd = IGEP2_RC_GPIO_WIFI_NPD;
602 wreset = IGEP2_RC_GPIO_WIFI_NRESET;
603 btreset = IGEP2_RC_GPIO_BT_NRESET;
604 } else
605 return;
606
607 /* Set GPIO's for WLAN-BT combo module */
608 if ((gpio_request(npd, "GPIO_WIFI_NPD") == 0) &&
609 (gpio_direction_output(npd, 1) == 0)) {
610 gpio_export(npd, 0);
611 } else
612 pr_warning("IGEP2: Could not obtain gpio GPIO_WIFI_NPD\n");
613
614 if ((gpio_request(wreset, "GPIO_WIFI_NRESET") == 0) &&
615 (gpio_direction_output(wreset, 1) == 0)) {
616 gpio_export(wreset, 0);
617 gpio_set_value(wreset, 0);
618 udelay(10);
619 gpio_set_value(wreset, 1);
620 } else
621 pr_warning("IGEP2: Could not obtain gpio GPIO_WIFI_NRESET\n");
622
623 if ((gpio_request(btreset, "GPIO_BT_NRESET") == 0) &&
624 (gpio_direction_output(btreset, 1) == 0)) {
625 gpio_export(btreset, 0);
626 } else
627 pr_warning("IGEP2: Could not obtain gpio GPIO_BT_NRESET\n");
628}
629#else
630static inline void __init igep2_wlan_bt_init(void) { }
631#endif
632
581static void __init igep2_init(void) 633static void __init igep2_init(void)
582{ 634{
583 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 635 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -596,22 +648,12 @@ static void __init igep2_init(void)
596 igep2_display_init(); 648 igep2_display_init();
597 igep2_init_smsc911x(); 649 igep2_init_smsc911x();
598 650
599 /* GPIO W-LAN + Bluetooth combo module */ 651 /*
600 if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) && 652 * WLAN-BT combo module from MuRata wich has a Marvell WLAN
601 (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) { 653 * (88W8686) + CSR Bluetooth chipset. Uses SDIO interface.
602 gpio_export(IGEP2_GPIO_WIFI_NPD, 0); 654 */
603/* gpio_set_value(IGEP2_GPIO_WIFI_NPD, 0); */ 655 igep2_wlan_bt_init();
604 } else
605 pr_warning("IGEP v2: Could not obtain gpio GPIO_WIFI_NPD\n");
606 656
607 if ((gpio_request(IGEP2_GPIO_WIFI_NRESET, "GPIO_WIFI_NRESET") == 0) &&
608 (gpio_direction_output(IGEP2_GPIO_WIFI_NRESET, 1) == 0)) {
609 gpio_export(IGEP2_GPIO_WIFI_NRESET, 0);
610 gpio_set_value(IGEP2_GPIO_WIFI_NRESET, 0);
611 udelay(10);
612 gpio_set_value(IGEP2_GPIO_WIFI_NRESET, 1);
613 } else
614 pr_warning("IGEP v2: Could not obtain gpio GPIO_WIFI_NRESET\n");
615} 657}
616 658
617MACHINE_START(IGEP0020, "IGEP v2 board") 659MACHINE_START(IGEP0020, "IGEP v2 board")