Merge current mainline tree into linux-omap tree
[pandora-kernel.git] / arch / arm / mach-omap1 / board-palmte.c
index a0b16a7..2a46765 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
-#include <linux/spi/tsc2102.h>
 #include <linux/interrupt.h>
 #include <linux/apm-emulation.h>
 
@@ -45,6 +44,7 @@
 #include <asm/arch/common.h>
 #include <asm/arch/mcbsp.h>
 #include <asm/arch/omap-alsa.h>
+#include <asm/arch/gpio-switch.h>
 
 static void __init omap_palmte_init_irq(void)
 {
@@ -315,14 +315,6 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
 #define palmte_get_power_status        NULL
 #endif
 
-static struct tsc2102_config palmte_tsc2102_config = {
-       .use_internal   = 0,
-       .monitor        = TSC_BAT1 | TSC_AUX | TSC_TEMP,
-       .temp_at25c     = { 2200, 2615 },
-       .apm_report     = palmte_get_power_status,
-       .alsa_config    = &palmte_alsa_config,
-};
-
 static struct omap_board_config_kernel palmte_config[] __initdata = {
        { OMAP_TAG_USB,         &palmte_usb_config },
        { OMAP_TAG_MMC,         &palmte_mmc_config },
@@ -336,7 +328,6 @@ static struct spi_board_info palmte_spi_info[] __initdata = {
                .bus_num        = 2,    /* uWire (officially) */
                .chip_select    = 0,    /* As opposed to 3 */
                .irq            = OMAP_GPIO_IRQ(PALMTE_PINTDAV_GPIO),
-               .platform_data  = &palmte_tsc2102_config,
                .max_speed_hz   = 8000000,
        },
 };
@@ -354,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) */
@@ -379,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);