]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/board-omap3beagle.c
beagle: two more GPIOs
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-omap3beagle.c
index ae677b991ba95910cfbc3b51e2a552ab00f3e0ec..19702c74955d97ac4cbe2921c512e29e8c0b56e5 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,12 +115,40 @@ static struct twl4030_usb_data beagle_usb_data = {
        .usb_mode       = T2_USB_MODE_ULPI,
 };
 
+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_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)
+        */
+
+       return 0;
+}
+
+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,
+       .pullups        = BIT(1),
+       .pulldowns      = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
+                               | BIT(15) | BIT(16) | BIT(17),
+       .setup          = beagle_twl_gpio_setup,
+};
+
 static struct twl4030_platform_data beagle_twldata = {
        .irq_base       = TWL4030_IRQ_BASE,
        .irq_end        = TWL4030_IRQ_END,
 
        /* platform_data for children goes here */
        .usb            = &beagle_usb_data,
+       .gpio           = &beagle_gpio_data,
 };
 
 static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
@@ -258,11 +287,22 @@ static void __init omap3beagle_flash_init(void)
 static void __init omap3_beagle_init(void)
 {
        omap3_beagle_i2c_init();
-       platform_add_devices(omap3_beagle_devices, ARRAY_SIZE(omap3_beagle_devices));
+       platform_add_devices(omap3_beagle_devices,
+                       ARRAY_SIZE(omap3_beagle_devices));
        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();