From a96fae45423959c2d6e05b19e00eaf015d2e6bf7 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Fri, 4 May 2007 16:34:17 -0700 Subject: [PATCH] ARM: OMAP: TSC2046 touchscreen support for 2430 This is a rework of the tsc2046 driver from TI's tree, based on the tsc2301 driver and using the new SPI framework. Signed-off-by: Kevin Hilman Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-2430sdp.c | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 3e308840744..5ee970bec39 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -33,6 +35,7 @@ #include #include #include +#include #include "prcm-regs.h" #include @@ -40,6 +43,9 @@ #define SDP2430_FLASH_CS 0 #define SDP2430_SMC91X_CS 5 +/* TSC2046 (touchscreen) */ +#define TS_GPIO 24 + static struct mtd_partition sdp2430_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ { @@ -119,6 +125,29 @@ static struct platform_device *sdp2430_devices[] __initdata = { &sdp2430_flash_device, }; +static struct tsc2046_platform_data tsc2046_config = { + .dav_gpio = TS_GPIO, + .gpio_debounce = 0xa, +}; + +static struct omap2_mcspi_device_config tsc2046_mcspi_config = { + .turbo_mode = 0, + .single_channel = 0, /* 0: slave, 1: master */ +}; + +static struct spi_board_info sdp2430_spi_board_info[] __initdata = { + [0] = { + /* TSC2046 operates at a max freqency of 2MHz, so + * operate slightly below at 1.5MHz */ + .modalias = "tsc2046", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 1500000, + .controller_data= &tsc2046_mcspi_config, + .platform_data = &tsc2046_config, + }, +}; + static inline void __init sdp2430_init_smc91x(void) { int eth_cs; @@ -274,6 +303,9 @@ static void __init omap_2430sdp_init(void) omap_serial_init(); sdp2430_flash_init(); + + spi_register_board_info(sdp2430_spi_board_info, + ARRAY_SIZE(sdp2430_spi_board_info)); } static void __init omap_2430sdp_map_io(void) -- 2.41.0