aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2006-06-26 19:16:09 -0400
committerTony Lindgren <tony@atomide.com>2006-06-26 19:16:09 -0400
commitc15e5d10b160ca0fe71f5865c771bf4ad0e7ed85 (patch)
tree5eca5f4cab3c63025656824e468f4ea0e06db854 /arch/arm
parent284185c73d3156f4438d5599ae69793b44d825ab (diff)
ARM: OMAP: Add bitbank SPI driver for Innovator 1510 touchscreen
Add bitbang SPI driver for Innovator 1510 touchscreen, using the new framework. Compile-tested only. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap1/board-innovator.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 43260aa20f86..4cbc62db5b5d 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -177,6 +177,10 @@ static struct platform_device innovator_kp_device = {
177 177
178#ifdef CONFIG_ARCH_OMAP15XX 178#ifdef CONFIG_ARCH_OMAP15XX
179 179
180#include <linux/spi/spi.h>
181#include <linux/spi/ads7846.h>
182
183
180/* Only FPGA needs to be mapped here. All others are done with ioremap */ 184/* Only FPGA needs to be mapped here. All others are done with ioremap */
181static struct map_desc innovator1510_io_desc[] __initdata = { 185static struct map_desc innovator1510_io_desc[] __initdata = {
182 { 186 {
@@ -212,14 +216,44 @@ static struct platform_device innovator1510_lcd_device = {
212 .id = -1, 216 .id = -1,
213}; 217};
214 218
219static struct platform_device innovator1510_spi_device = {
220 .name = "spi_inn1510",
221 .id = -1,
222};
223
215static struct platform_device *innovator1510_devices[] __initdata = { 224static struct platform_device *innovator1510_devices[] __initdata = {
216 &innovator_flash_device, 225 &innovator_flash_device,
217 &innovator1510_smc91x_device, 226 &innovator1510_smc91x_device,
218 &innovator_mcbsp1_device, 227 &innovator_mcbsp1_device,
219 &innovator_kp_device, 228 &innovator_kp_device,
220 &innovator1510_lcd_device, 229 &innovator1510_lcd_device,
230 &innovator1510_spi_device,
221}; 231};
222 232
233static int innovator_get_pendown_state(void)
234{
235 return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5));
236}
237
238static const struct ads7846_platform_data innovator1510_ts_info = {
239 .model = 7846,
240 .vref_delay_usecs = 100, /* internal, no capacitor */
241 .x_plate_ohms = 419,
242 .y_plate_ohms = 486,
243 .get_pendown_state = innovator_get_pendown_state,
244};
245
246static struct spi_board_info __initdata innovator1510_boardinfo[] = { {
247 /* FPGA (bus "10") CS0 has an ads7846e */
248 .modalias = "ads7846",
249 .platform_data = &innovator1510_ts_info,
250 .irq = OMAP1510_INT_FPGA_TS,
251 .max_speed_hz = 120000 /* max sample rate at 3V */
252 * 26 /* command + data + overhead */,
253 .bus_num = 10,
254 .chip_select = 0,
255} };
256
223#endif /* CONFIG_ARCH_OMAP15XX */ 257#endif /* CONFIG_ARCH_OMAP15XX */
224 258
225#ifdef CONFIG_ARCH_OMAP16XX 259#ifdef CONFIG_ARCH_OMAP16XX
@@ -350,6 +384,8 @@ static void __init innovator_init(void)
350#ifdef CONFIG_ARCH_OMAP15XX 384#ifdef CONFIG_ARCH_OMAP15XX
351 if (cpu_is_omap1510()) { 385 if (cpu_is_omap1510()) {
352 platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices)); 386 platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
387 spi_register_board_info(innovator1510_boardinfo,
388 ARRAY_SIZE(innovator1510_boardinfo));
353 } 389 }
354#endif 390#endif
355#ifdef CONFIG_ARCH_OMAP16XX 391#ifdef CONFIG_ARCH_OMAP16XX