]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-palmte.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-palmte.c
index b58043644a6f55681ba5c66cb1d3a47f03687116..4b2c62b3853d3137d8e86b0affacc6e412bb1445 100644 (file)
@@ -44,6 +44,7 @@
 #include <mach/common.h>
 #include <mach/mcbsp.h>
 #include <mach/omap-alsa.h>
+#include <mach/gpio-switch.h>
 
 static void __init omap_palmte_init_irq(void)
 {
@@ -344,6 +345,37 @@ static void palmte_headphones_detect(void *data, int state)
        }
 }
 
+static struct omap_gpio_switch palmte_switches[] __initdata = {
+       /* Speaker-enable pin is an output */
+       {
+               .name   = "speaker-enable",
+               .gpio   = PALMTE_SPEAKER_GPIO,
+               .type   = OMAP_GPIO_SWITCH_TYPE_ACTIVITY,
+               .flags  = OMAP_GPIO_SWITCH_FLAG_OUTPUT |
+                       OMAP_GPIO_SWITCH_FLAG_INVERTED,
+       },
+       /* Indicates whether power is from DC-IN or battery */
+       {
+               .name   = "dc-in",
+               .gpio   = PALMTE_DC_GPIO,
+               .type   = OMAP_GPIO_SWITCH_TYPE_CONNECTION,
+               .flags  = OMAP_GPIO_SWITCH_FLAG_INVERTED,
+       },
+       /* Indicates whether a USB host is on the other end of the cable */
+       {
+               .name   = "usb",
+               .gpio   = PALMTE_USBDETECT_GPIO,
+               .type   = OMAP_GPIO_SWITCH_TYPE_CONNECTION,
+       },
+       /* High when headphones jack is plugged in */
+       {
+               .name   = "headphones",
+               .gpio   = PALMTE_HEADPHONES_GPIO,
+               .type   = OMAP_GPIO_SWITCH_TYPE_CONNECTION,
+               .notify = palmte_headphones_detect,
+       },
+};
+
 static void __init palmte_misc_gpio_setup(void)
 {
        /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
@@ -369,6 +401,10 @@ static void __init omap_palmte_init(void)
        platform_add_devices(palmte_devices, ARRAY_SIZE(palmte_devices));
 
        spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info));
+
+       omap_register_gpio_switches(palmte_switches,
+                       ARRAY_SIZE(palmte_switches));
+
        palmte_misc_gpio_setup();
        omap_serial_init();
        omap_register_i2c_bus(1, 100, NULL, 0);