omap24xx spi + touchscreen
Subsystems (4)
PATCH 1/1 omap24xx spi + touchscreen
Tony,
Attached experimental patch for spi driver (driver?) and tsc2101 touchscreen support for 24xx.
Warning:
* No need to integrate this patch to git tree, it is just for experiments.
* Ported quickly to latest git tree, so no. of bugs are expected from the spi code.
* I had just tried to play with spi in latest git tree, before starting for david's spi framework.
Tested touchscreen with tslib utilities
* ts_calibrate - works (cross-hair cursor moves in just one click)
* ts_test - cursor lags behind the stylus position. Decreasing the conv. delay in tsc2101 might help.
- spi muxing is still not added to muxtable.
- spi code + ts modifications taken from 2.6.9 TI tree.
---Komal Shah
http://komalshah.blogspot.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
arch/arm/mach-omap2/mux.c +3 -0
@@ -61,6 +61,9 @@ MUX_CFG_24XX("R14_24XX_MCBSP2_FSX", 0x12 MUX_CFG_24XX("W15_24XX_MCBSP2_DR", 0x126, 1, 1, 0, 1)MUX_CFG_24XX ("V15_24XX_MCBSP2_DX" ,0x127 ,1 ,1 ,0 ,1 ) +/* TSC IRQ */ +MUX_CFG_24XX("P20_24XX_TSC_IRQ", 0x108, 0, 0, 0, 1) + };int __init omap2_mux_init (void )
drivers/input/touchscreen/Kconfig +1 -1
@@ -99,7 +99,7 @@ endif config TOUCHSCREEN_OMAP tristate "OMAP touchscreen input driver" depends on INPUT && INPUT_TOUCHSCREEN && ARCH_OMAP - select OMAP_TSC2101 +# select OMAP_TSC2101 help Say Y here if you have an OMAP based board with touchscreen attached to it, e.g. OMAP Innovator, OSK, H2 or H3
drivers/input/touchscreen/omap/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_TOUCHSCREEN_OMAP) += omapts objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_H2) += ts_hx.o objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_H3) += ts_hx.o +objs-$(CONFIG_ARCH_OMAP24XX)$(CONFIG_MACH_OMAP_H4) += ts_hx.o objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += ts_inn1510.o objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_OSK) += ts_osk.o
drivers/input/touchscreen/omap/omap_ts.c +22 -19
85 lines not on this page · raw message
drivers/input/touchscreen/omap/omap_ts.h +1 -1
@@ -42,7 +42,7 @@ struct ts_device { };struct omap_ts_t { -struct input_dev inputdevice; +struct input_dev *inputdevice;struct timer_list ts_timer;// Timer for triggering acquisitions int touched;int irq;
drivers/input/touchscreen/omap/ts_hx.c +6 -0
@@ -39,6 +39,7 @@#define H2_GPIO_NUM 4#define H3_GPIO_NUM 48 +#define H4_GPIO_NUM 93#define OMAP_TSC2101_XRES 500#define TOUCHSCREEN_DATA_REGISTERS_PAGE 0x0
@@ -88,6 +89,9 @@ static int __init hx_ts_probe(struct oma }else if (machine_is_omap_h3 ()) { gpio =H3_GPIO_NUM ;omap_cfg_reg (W19_1610_GPIO48 ); + }else if (machine_is_omap_h4 ()) { + gpio =H4_GPIO_NUM ; +omap_cfg_reg (P20_24XX_TSC_IRQ ); }else return -ENODEV ;
@@ -180,5 +184,7 @@ static void __exit hx_ts_remove(void)omap_free_gpio (H2_GPIO_NUM ); else if (machine_is_omap_h3()) omap_free_gpio(H3_GPIO_NUM); + else if (machine_is_omap_h4()) + omap_free_gpio(H4_GPIO_NUM); }#endif
drivers/ssi/Kconfig +7 -0
@@ -7,6 +7,13 @@ config OMAP_UWIRE Say Y here if you want support for the MicroWire interface on an OMAP processor. +config OMAP_SPI + depends on ARCH_OMAP2 + tristate "SPI support on OMAP" + ---help--- + Say Y here if you want support for the SPI + on an OMAP2 processor. + config OMAP_TSC2101 depends on ARCH_OMAP1 || ARCH_OMAP24XX tristate "TSC2101 codec support for Touchscreen and audio"
drivers/ssi/Makefile +1 -0
@@ -3,4 +3,5 @@ # obj-$(CONFIG_OMAP_UWIRE) += omap-uwire.o +obj-$(CONFIG_OMAP_SPI) += omap-spi.o h4-spi.o obj-$(CONFIG_OMAP_TSC2101) += omap-tsc2101.o
drivers/ssi/h4-spi.c new file +182 -0
182 lines not on this page · raw message
drivers/ssi/h4-spi.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef H4_SPI_H +#define H4_SPI_H + +extern int omap_tsc2101_enable (); +extern void omap_tsc2101_disable (); +extern u16 omap_tsc2101_read (int page,u8 address); +extern void omap_tsc2101_write (int page,u8 address,u16 data); +extern void omap_tsc2101_reads (int page,u8 add,u16 *data,int + nregs); + +#endif
drivers/ssi/omap-spi.c new file +503 -0
503 lines not on this page · raw message
drivers/ssi/omap-spi.h new file +274 -0
274 lines not on this page · raw message
include/asm-arm/arch-omap/mux.h +3 -0
@@ -418,6 +418,9 @@ enum omap24xx_index {V15_24XX_MCBSP2_DX ,R14_24XX_MCBSP2_FSX , +/* TSC IRQ*/ + P20_24XX_TSC_IRQ, + };#ifdef CONFIG_OMAP_MUX