diff options
author | Aaro Koskinen <aaro.koskinen@nokia.com> | 2011-12-13 13:48:53 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-12-13 13:48:53 -0500 |
commit | 3dad5356aa47097cf67027cf0a07298b4f5baef6 (patch) | |
tree | bc668786576a7ad5658be3312ee7d80ccac11dba /arch/arm/mach-omap2 | |
parent | b2404f4275badc719b8335420c97ae9380e01227 (diff) |
ARM: OMAP3: rx51: enable tsc2005 touchscreen
Enable TSC2005 touchscreen driver on the RX-51 board by providing the
needed platform data.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Reviewed-by: Sebastian Reichel <sre@debian.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index bd18d691c6ad..e9eff00cddd4 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/input/matrix_keypad.h> | 15 | #include <linux/input/matrix_keypad.h> |
16 | #include <linux/spi/spi.h> | 16 | #include <linux/spi/spi.h> |
17 | #include <linux/wl12xx.h> | 17 | #include <linux/wl12xx.h> |
18 | #include <linux/spi/tsc2005.h> | ||
18 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
19 | #include <linux/i2c/twl.h> | 20 | #include <linux/i2c/twl.h> |
20 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
@@ -58,6 +59,9 @@ | |||
58 | 59 | ||
59 | #define RX51_USB_TRANSCEIVER_RST_GPIO 67 | 60 | #define RX51_USB_TRANSCEIVER_RST_GPIO 67 |
60 | 61 | ||
62 | #define RX51_TSC2005_RESET_GPIO 104 | ||
63 | #define RX51_TSC2005_IRQ_GPIO 100 | ||
64 | |||
61 | /* list all spi devices here */ | 65 | /* list all spi devices here */ |
62 | enum { | 66 | enum { |
63 | RX51_SPI_WL1251, | 67 | RX51_SPI_WL1251, |
@@ -66,6 +70,7 @@ enum { | |||
66 | }; | 70 | }; |
67 | 71 | ||
68 | static struct wl12xx_platform_data wl1251_pdata; | 72 | static struct wl12xx_platform_data wl1251_pdata; |
73 | static struct tsc2005_platform_data tsc2005_pdata; | ||
69 | 74 | ||
70 | #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) | 75 | #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) |
71 | static struct tsl2563_platform_data rx51_tsl2563_platform_data = { | 76 | static struct tsl2563_platform_data rx51_tsl2563_platform_data = { |
@@ -167,10 +172,10 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = { | |||
167 | .modalias = "tsc2005", | 172 | .modalias = "tsc2005", |
168 | .bus_num = 1, | 173 | .bus_num = 1, |
169 | .chip_select = 0, | 174 | .chip_select = 0, |
170 | /* .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),*/ | 175 | .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO), |
171 | .max_speed_hz = 6000000, | 176 | .max_speed_hz = 6000000, |
172 | .controller_data = &tsc2005_mcspi_config, | 177 | .controller_data = &tsc2005_mcspi_config, |
173 | /* .platform_data = &tsc2005_config,*/ | 178 | .platform_data = &tsc2005_pdata, |
174 | }, | 179 | }, |
175 | }; | 180 | }; |
176 | 181 | ||
@@ -1086,6 +1091,42 @@ error: | |||
1086 | */ | 1091 | */ |
1087 | } | 1092 | } |
1088 | 1093 | ||
1094 | static struct tsc2005_platform_data tsc2005_pdata = { | ||
1095 | .ts_pressure_max = 2048, | ||
1096 | .ts_pressure_fudge = 2, | ||
1097 | .ts_x_max = 4096, | ||
1098 | .ts_x_fudge = 4, | ||
1099 | .ts_y_max = 4096, | ||
1100 | .ts_y_fudge = 7, | ||
1101 | .ts_x_plate_ohm = 280, | ||
1102 | .esd_timeout_ms = 8000, | ||
1103 | }; | ||
1104 | |||
1105 | static void rx51_tsc2005_set_reset(bool enable) | ||
1106 | { | ||
1107 | gpio_set_value(RX51_TSC2005_RESET_GPIO, enable); | ||
1108 | } | ||
1109 | |||
1110 | static void __init rx51_init_tsc2005(void) | ||
1111 | { | ||
1112 | int r; | ||
1113 | |||
1114 | r = gpio_request_one(RX51_TSC2005_IRQ_GPIO, GPIOF_IN, "tsc2005 IRQ"); | ||
1115 | if (r < 0) { | ||
1116 | printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 IRQ"); | ||
1117 | rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq = 0; | ||
1118 | } | ||
1119 | |||
1120 | r = gpio_request_one(RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH, | ||
1121 | "tsc2005 reset"); | ||
1122 | if (r >= 0) { | ||
1123 | tsc2005_pdata.set_reset = rx51_tsc2005_set_reset; | ||
1124 | } else { | ||
1125 | printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 reset"); | ||
1126 | tsc2005_pdata.esd_timeout_ms = 0; | ||
1127 | } | ||
1128 | } | ||
1129 | |||
1089 | void __init rx51_peripherals_init(void) | 1130 | void __init rx51_peripherals_init(void) |
1090 | { | 1131 | { |
1091 | rx51_i2c_init(); | 1132 | rx51_i2c_init(); |
@@ -1094,6 +1135,7 @@ void __init rx51_peripherals_init(void) | |||
1094 | board_smc91x_init(); | 1135 | board_smc91x_init(); |
1095 | rx51_add_gpio_keys(); | 1136 | rx51_add_gpio_keys(); |
1096 | rx51_init_wl1251(); | 1137 | rx51_init_wl1251(); |
1138 | rx51_init_tsc2005(); | ||
1097 | rx51_init_si4713(); | 1139 | rx51_init_si4713(); |
1098 | spi_register_board_info(rx51_peripherals_spi_board_info, | 1140 | spi_register_board_info(rx51_peripherals_spi_board_info, |
1099 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); | 1141 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); |