]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/board-omap3beagle.c
support LED signals on Beagle
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-omap3beagle.c
index 093150c97c001916a9faddde912dd6450aabf5c7..88d25b11c3b571d9ab04eee8f3957c986af4ba14 100644 (file)
@@ -43,6 +43,7 @@
 #include <mach/common.h>
 #include <mach/gpmc.h>
 #include <mach/nand.h>
+#include <mach/mux.h>
 
 
 #define GPMC_CS0_BASE  0x60
@@ -114,19 +115,26 @@ static struct twl4030_usb_data beagle_usb_data = {
        .usb_mode       = T2_USB_MODE_ULPI,
 };
 
+static struct gpio_led gpio_leds[];
+
 static int beagle_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
 {
-       /* request_gpio(gpio + 0, "mmc0_cd");
-        * gpio_direction_input(gpio + 0);
+       /* gpio + 0 is "mmc0_cd" (input/IRQ) */
+
+       /* REVISIT: need ehci-omap hooks for external VBUS
+        * power switch and overcurrent detect
         */
 
        gpio_request(gpio + 1, "EHCI_nOC");
        gpio_direction_input(gpio + 1);
 
-       /* gpio + 18 + 0 == ledA, nEN_USB_PWR (out)
-        * gpio + 18 + 1 == ledB, PMU_STAT (out, a LED)
-        */
+       /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+       gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+       gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+
+       /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+       gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
        return 0;
 }
@@ -135,6 +143,7 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
        .gpio_base      = OMAP_MAX_GPIO_LINES,
        .irq_base       = TWL4030_GPIO_IRQ_BASE,
        .irq_end        = TWL4030_GPIO_IRQ_END,
+       .use_leds       = true,
        .pullups        = BIT(1),
        .pulldowns      = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
                                | BIT(15) | BIT(16) | BIT(17),
@@ -197,6 +206,11 @@ static struct gpio_led gpio_leds[] = {
                .default_trigger        = "mmc0",
                .gpio                   = 149,
        },
+       {
+               .name                   = "beagleboard::pmu_stat",
+               .gpio                   = -EINVAL,      /* gets replaced */
+               .active_low             = true,
+       },
 };
 
 static struct gpio_led_platform_data gpio_led_info = {
@@ -291,7 +305,17 @@ static void __init omap3_beagle_init(void)
        omap_board_config = omap3_beagle_config;
        omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
        omap_serial_init();
+
+       omap_cfg_reg(AH8_34XX_GPIO29);
+       gpio_request(29, "mmc0_wp");
+       gpio_direction_input(29);
        hsmmc_init();
+
+       omap_cfg_reg(J25_34XX_GPIO170);
+       gpio_request(170, "DVI_nPD");
+       /* REVISIT leave DVI powered down until it's needed ... */
+       gpio_direction_output(170, true);
+
        usb_musb_init();
        usb_ehci_init();
        omap3beagle_flash_init();