]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Enable TSC2101 on apollon
authorKyungmin Park <kyungmin.park@samsung.com>
Fri, 17 Aug 2007 07:47:00 +0000 (16:47 +0900)
committerTony Lindgren <tony@atomide.com>
Wed, 22 Aug 2007 06:35:26 +0000 (23:35 -0700)
ARM: OMAP: Enable TSC2101 on Apollon

Now it enables the touchscreen.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/mux.c
include/asm-arm/arch-omap/mux.h

index 059ff93d54aace95d7e593a5b44d99e8be9208a1..ff8459c7c95058c5274b88929490759ca61e3492 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/leds.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/tsc210x.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -259,6 +261,24 @@ static void __init omap_apollon_init_irq(void)
        apollon_init_smc91x();
 }
 
+static struct tsc210x_config tsc_platform_data = {
+       .use_internal           = 1,
+       .monitor                = TSC_TEMP,
+       .mclk                   = "sys_clkout",
+};
+
+static struct spi_board_info apollon_spi_board_info[] = {
+       [0] = {
+               .modalias       = "tsc2101",
+               .irq            = OMAP_GPIO_IRQ(85),
+               .bus_num        = 1,
+               .chip_select    = 0,
+               .mode           = SPI_MODE_1,
+               .max_speed_hz   = 6000000,
+               .platform_data  = &tsc_platform_data,
+       },
+};
+
 static struct omap_uart_config apollon_uart_config __initdata = {
        .enabled_uarts = (1 << 0) | (0 << 1) | (0 << 2),
 };
@@ -335,11 +355,22 @@ static void __init apollon_usb_init(void)
        omap_set_gpio_dataout(12, 0);
 }
 
+static void __init apollon_tsc_init(void)
+{
+       /* TSC2101 */
+       omap_cfg_reg(N15_24XX_GPIO85);
+       omap_request_gpio(85);
+       omap_set_gpio_direction(85, 1);
+
+       omap_cfg_reg(W14_24XX_SYS_CLKOUT);      /* mclk */
+}
+
 static void __init omap_apollon_init(void)
 {
        apollon_led_init();
        apollon_flash_init();
        apollon_usb_init();
+       apollon_tsc_init();
 
        /*
         * Make sure the serial ports are muxed on at this point.
@@ -350,6 +381,9 @@ static void __init omap_apollon_init(void)
        omap_board_config = apollon_config;
        omap_board_config_size = ARRAY_SIZE(apollon_config);
        omap_serial_init();
+
+       spi_register_board_info(apollon_spi_board_info,
+                               ARRAY_SIZE(apollon_spi_board_info));
 }
 
 static void __init omap_apollon_map_io(void)
index 17ed177e05cfe5b2816bee99f65272f877ae3a09..cf4720f9aba5d777bf29e3cd1ebcaa692c35083d 100644 (file)
@@ -77,6 +77,7 @@ MUX_CFG_24XX("AA12_242X_GPIO17",      0x0e9,  3,      0,      0,      1)
 MUX_CFG_24XX("AA8_242X_GPIO58",                0x0ea,  3,      0,      0,      1)
 MUX_CFG_24XX("Y20_24XX_GPIO60",                0x12c,  3,      0,      0,      1)
 MUX_CFG_24XX("W4__24XX_GPIO74",                0x0f2,  3,      0,      0,      1)
+MUX_CFG_24XX("N15_24XX_GPIO85",                0x103,  3,      0,      0,      1)
 MUX_CFG_24XX("M15_24XX_GPIO92",                0x10a,  3,      0,      0,      1)
 MUX_CFG_24XX("P20_24XX_GPIO93",                0x10b,  3,      0,      0,      1)
 MUX_CFG_24XX("P18_24XX_GPIO95",                0x10d,  3,      0,      0,      1)
index 6e53212f4a2148bce1454c7486b8dc3e76a55b1e..317ea60fc8934a84223bcdf17a434b14d6b59eb6 100644 (file)
@@ -469,6 +469,7 @@ enum omap24xx_index {
        AA8_242X_GPIO58,
        Y20_24XX_GPIO60,
        W4__24XX_GPIO74,
+       N15_24XX_GPIO85,
        M15_24XX_GPIO92,
        P20_24XX_GPIO93,
        P18_24XX_GPIO95,