input: AD7879 Touchscreen driver
Subsystems (5)
PATCH 3/19 input: AD7879 Touchscreen driver
From: Michael Hennerich <[email protected]>
[[email protected]: touchscreen/ad787x: don't use bus_id]
Signed-off-by Michael Hennerich <[email protected]>
Signed-off-by Bryan Wu <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Michael Hennerich <[email protected]>
Signed-off-by Randy Dunlap <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/input/touchscreen/Kconfig | 32 + drivers/input/touchscreen/Makefile | 1 drivers/input/touchscreen/ad7877.c | 6 drivers/input/touchscreen/ad7879.c | 797 +++++++++++++++++++++++++++ include/linux/spi/ad7879.h | 35 + 5 files changed, 868 insertions(+), 3 deletions(-)
drivers/input/touchscreen/Kconfig renamed from drivers/input/touchscreen/Kconfig~input-ad7879-touchscreen-driver +32 -0
@@ -42,6 +42,38 @@ config TOUCHSCREEN_AD7877 To compile this driver as a module, choose M here: the module will be called ad7877. +config TOUCHSCREEN_AD7879_I2C + tristate "AD7879 based touchscreens: AD7879-1 I2C Interface" + depends on I2C + select TOUCHSCREEN_AD7879 + help + Say Y here if you have a touchscreen interface using the + AD7879-1 controller, and your board-specific initialization + code includes that in its table of I2C devices. + + If unsure, say N (but it's safe to say "Y"). + + To compile this driver as a module, choose M here: the + module will be called ad7879. + +config TOUCHSCREEN_AD7879_SPI + tristate "AD7879 based touchscreens: AD7879 SPI Interface" + depends on SPI_MASTER && TOUCHSCREEN_AD7879_I2C = n + select TOUCHSCREEN_AD7879 + help + Say Y here if you have a touchscreen interface using the + AD7879 controller, and your board-specific initialization + code includes that in its table of SPI devices. + + If unsure, say N (but it's safe to say "Y"). + + To compile this driver as a module, choose M here: the + module will be called ad7879. + +config TOUCHSCREEN_AD7879 + tristate + default n + config TOUCHSCREEN_BITSY tristate "Compaq iPAQ H3600 (Bitsy) touchscreen" depends on SA1100_BITSY
drivers/input/touchscreen/Makefile renamed from drivers/input/touchscreen/Makefile~input-ad7879-touchscreen-driver +1 -0
@@ -7,6 +7,7 @@ wm97xx-ts-y := wm97xx-core.o obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o +obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
drivers/input/touchscreen/ad7879.c new file +797 -0
797 lines not on this page · raw message
include/linux/spi/ad7879.h new file +35 -0
@@ -0,0 +1,35 @@ +/* linux/spi/ad7879.h */ + +/* Touchscreen characteristics vary between boards and models. The +* platform_data for the device's "struct device" holds this information. +* +* It's OK if the min/max values are zero. +*/ +struct ad7879_platform_data { +u16 model;/* 7879 */ +u16 x_plate_ohms; +u16 x_min, x_max; +u16 y_min, y_max; +u16 pressure_min, pressure_max; + +/* [0..255] 0=OFF Starts at 1=550us and goes +* all the way to 9.440ms in steps of 35us. +*/ +u8 pen_down_acc_interval; +/* [0..15] Starts at 0=128us and goes all the +* way to 4.096ms in steps of 128us. +*/ +u8 first_conversion_delay; +/* [0..3] 0 = 2us, 1 = 4us, 2 = 8us, 3 = 16us */ +u8 acquisition_time; +/* [0..3] Average X middle samples 0 = 2, 1 = 4, 2 = 8, 3 = 16 */ +u8 averaging; +/* [0..3] Perform X measurements 0 = OFF, +* 1 = 4, 2 = 8, 3 = 16 (median > averaging) +*/ +u8 median; +/* 1 = AUX/VBAT/GPIO set to GPIO Output */ +u8 gpio_output; +/* Initial GPIO pin state (valid if gpio_output = 1) */ +u8 gpio_default; +};
drivers/input/touchscreen/ad7877.c renamed from drivers/input/touchscreen/ad7877.c~input-ad7879-touchscreen-driver +3 -3
@@ -713,7 +713,7 @@ static int __devinit ad7877_probe(struct ts->averaging = pdata->averaging; ts->pen_down_acc_interval = pdata->pen_down_acc_interval; -snprintf (ts->phys,sizeof (ts->phys),"%s/inputX" , spi->dev.bus_id); +snprintf (ts->phys,sizeof (ts->phys),"%s/inputX" ,dev_name (&spi->dev)); input_dev->name ="AD7877 Touchscreen" ; input_dev->phys = ts->phys;
@@ -740,8 +740,8 @@ static int __devinit ad7877_probe(struct verify =ad7877_read (spi,AD7877_REG_SEQ1 );if (verify !=AD7877_MM_SEQUENCE ){ -dev_err (&spi->dev,"%s: Failed to probe %s\n" , spi->dev.bus_id, - input_dev->name); +dev_err (&spi->dev,"%s: Failed to probe %s\n" , +dev_name (&spi->dev), input_dev->name); err = -ENODEV ; goto err_free_mem; }
_