RE: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support
-Original Message- From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com] Sent: Tuesday, January 12, 2010 2:07 PM To: Hiremath, Vaibhav Cc: linux-in...@vger.kernel.org; linux-omap@vger.kernel.org Subject: Re: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support On Mon, Jan 11, 2010 at 11:54:05AM +0530, Hiremath, Vaibhav wrote: -Original Message- From: Hiremath, Vaibhav Sent: Thursday, November 19, 2009 8:17 PM To: linux-in...@vger.kernel.org Cc: linux-omap@vger.kernel.org; Hiremath, Vaibhav Subject: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support From: Vaibhav Hiremath hvaib...@ti.com Signed-off-by: Vaibhav Hiremath hvaib...@ti.com --- drivers/input/touchscreen/Kconfig | 11 + drivers/input/touchscreen/Makefile |1 + drivers/input/touchscreen/tsc2004.c | 525 +++ include/linux/i2c/tsc2004.h | 17 ++ 4 files changed, 554 insertions(+), 0 deletions(-) create mode 100644 drivers/input/touchscreen/tsc2004.c create mode 100644 include/linux/i2c/tsc2004.h [Hiremath, Vaibhav] Dmitry, Any update on this? This driver support is important for AM3517EVM, can we merge this patch? Hi Hiremath, I looked over the 2 drivers again and I still think that they are too much alike to warrant splitting them into 2. The only thing that you need is provide tsc2004-specific variant of tsc2007_read_values and add tsc2007-specific variant of tsc2004_prepare_for_reading. Once the drivers start really diverging we may revisit this issue. [Hiremath, Vaibhav] Hi Dmitry, Sorry for delayed response, as usual was busy with some other priority issues. Let it be... As I mentioned before, looking towards the functionality differences I decided to implement/have separate driver for TSC2004. But I think you are right, since as of now software is not leveraging all the features we can use existing TSC2007 driver. Whenever we diverge we can slit them. Just wanted to share/conform some thoughts on the implementation point of view, - Probably change the driver from tsc2007 to tsc200x - introduce initialization sequence as an array and pass it to the i2c_device_id table. - Driver will have to only use this array sequence, that's all. I will try to change the driver accordingly and submit it again and also update/inform you if I came across any issues (while doing this, which is unlikely). Thanks, Vaibhav Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support
On Mon, Jan 11, 2010 at 11:54:05AM +0530, Hiremath, Vaibhav wrote: -Original Message- From: Hiremath, Vaibhav Sent: Thursday, November 19, 2009 8:17 PM To: linux-in...@vger.kernel.org Cc: linux-omap@vger.kernel.org; Hiremath, Vaibhav Subject: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support From: Vaibhav Hiremath hvaib...@ti.com Signed-off-by: Vaibhav Hiremath hvaib...@ti.com --- drivers/input/touchscreen/Kconfig | 11 + drivers/input/touchscreen/Makefile |1 + drivers/input/touchscreen/tsc2004.c | 525 +++ include/linux/i2c/tsc2004.h | 17 ++ 4 files changed, 554 insertions(+), 0 deletions(-) create mode 100644 drivers/input/touchscreen/tsc2004.c create mode 100644 include/linux/i2c/tsc2004.h [Hiremath, Vaibhav] Dmitry, Any update on this? This driver support is important for AM3517EVM, can we merge this patch? Hi Hiremath, I looked over the 2 drivers again and I still think that they are too much alike to warrant splitting them into 2. The only thing that you need is provide tsc2004-specific variant of tsc2007_read_values and add tsc2007-specific variant of tsc2004_prepare_for_reading. Once the drivers start really diverging we may revisit this issue. Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support
-Original Message- From: Hiremath, Vaibhav Sent: Thursday, November 19, 2009 8:17 PM To: linux-in...@vger.kernel.org Cc: linux-omap@vger.kernel.org; Hiremath, Vaibhav Subject: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support From: Vaibhav Hiremath hvaib...@ti.com Signed-off-by: Vaibhav Hiremath hvaib...@ti.com --- drivers/input/touchscreen/Kconfig | 11 + drivers/input/touchscreen/Makefile |1 + drivers/input/touchscreen/tsc2004.c | 525 +++ include/linux/i2c/tsc2004.h | 17 ++ 4 files changed, 554 insertions(+), 0 deletions(-) create mode 100644 drivers/input/touchscreen/tsc2004.c create mode 100644 include/linux/i2c/tsc2004.h [Hiremath, Vaibhav] Dmitry, Any update on this? This driver support is important for AM3517EVM, can we merge this patch? Thanks, Vaibhav diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 8cc453c..08aba0b 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -512,6 +512,17 @@ config TOUCHSCREEN_TSC2007 To compile this driver as a module, choose M here: the module will be called tsc2007. +config TOUCHSCREEN_TSC2004 + tristate TSC2004 based touchscreens + depends on I2C + help + Say Y here if you have a TSC2004 based touchscreen. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called tsc2004. + config TOUCHSCREEN_W90X900 tristate W90P910 touchscreen driver depends on HAVE_CLK diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 15fa62c..4ac5b81 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213)+= touchit213.o obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o obj-$(CONFIG_TOUCHSCREEN_TSC2007)+= tsc2007.o +obj-$(CONFIG_TOUCHSCREEN_TSC2004)+= tsc2004.o obj-$(CONFIG_TOUCHSCREEN_UCB1400)+= ucb1400_ts.o obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001)+= wacom_w8001.o obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c new file mode 100644 index 000..0bba2e6 --- /dev/null +++ b/drivers/input/touchscreen/tsc2004.c @@ -0,0 +1,525 @@ +/* + * drivers/input/touchscreen/tsc2004.c + * + * Copyright (C) 2009 Texas Instruments Inc + * Author: Vaibhav Hiremath hvaib...@ti.com + * + * Using code from: + * - tsc2007.c + * + * This package is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include linux/module.h +#include linux/slab.h +#include linux/input.h +#include linux/interrupt.h +#include linux/i2c.h +#include linux/i2c/tsc2004.h + + +#define TS_POLL_DELAY1 /* ms delay between samples */ +#define TS_POLL_PERIOD 1 /* ms delay between samples */ + +/* Control byte 0 */ +#define TSC2004_CMD0(addr, pnd, rw) ((addr3)|(pnd1)|rw) +/* Control byte 1 */ +#define TSC2004_CMD1(cmd, mode, rst) ((17)|(cmd4)|(mode2)|(rst1)) + +/* Command Bits */ +#define READ_REG 1 +#define WRITE_REG0 +#define SWRST_TRUE 1 +#define SWRST_FALSE 0 +#define PND0_TRUE1 +#define PND0_FALSE 0 + +/* Converter function mapping */ +enum convertor_function { + MEAS_X_Y_Z1_Z2, /* Measure X,Y,z1 and Z2: 0x0 */ + MEAS_X_Y, /* Measure X and Y only:0x1 */ + MEAS_X, /* Measure X only: 0x2 */ + MEAS_Y, /* Measure Y only: 0x3 */ + MEAS_Z1_Z2, /* Measure Z1 and Z2 only: 0x4 */ + MEAS_AUX, /* Measure Auxillary input: 0x5 */ + MEAS_TEMP1, /* Measure Temparature1:0x6 */ + MEAS_TEMP2, /* Measure Temparature2:0x7 */ + MEAS_AUX_CONT, /* Continuously measure Auxillary input: 0x8 */ + X_DRV_TEST, /* X-Axis drivers tested0x9 */ + Y_DRV_TEST, /* Y-Axis drivers tested0xA */ + /*Command Reserved*/ + SHORT_CKT_TST = 0xC,/* Short circuit test: 0xC */ + XP_XN_DRV_STAT, /* X+,Y- drivers status:0xD */ + YP_YN_DRV_STAT, /* X+,Y-
RE: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support
-Original Message- From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com] Sent: Friday, November 20, 2009 10:32 PM To: Hiremath, Vaibhav Cc: linux-in...@vger.kernel.org; linux-omap@vger.kernel.org Subject: Re: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support Hi Vaibhav, On Thu, Nov 19, 2009 at 08:16:40PM +0530, hvaib...@ti.com wrote: From: Vaibhav Hiremath hvaib...@ti.com Signed-off-by: Vaibhav Hiremath hvaib...@ti.com If I do: sed 's/2004/2007/g' drivers/input/touchscreen/tsc2004.c | diff -u drivers/input/touchscreen/tsc2007.c - the diff is miniscule so why can't TSC2004 support be simply added to TSC2007 driver? [Hiremath, Vaibhav] The driver which I submitted is the basic version, there is lot which required to be added here for complete support of TSC2004 features. I tried to summarize it (in short) here - - TSC2004 supports register based control, whereas TSC2007 is command based control. - TSC2004 supports 2 different modes of operation, whereas there is nothing like this in TSc2007 - There are lots of configuration options TSC2004 provides. Again there are differences like command/address formats TSC2004 - -- BIT NAMEDESCRIPTION D7 Control Byte ID 1 D6-D3 C3-C0 Converter function select D2 M 1: 12 Bit 0: 10 bit D1 SWRSTSoftware Reset. D0 STS Stop bit for all converter functions. TSC2007 - - BIT NAMEDESCRIPTION D7-D4 C3-C0 All Converter Function Select bits D3-D2 PD1-PD0 Power down bit control D1 M 1: 8-bit 0: 12 bit D0 X Don't care. So in my opinion we must not try to merge drivers for these two devices. I hope this information clears all the confusion. Thanks, Vaibhav Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support
Hi Vaibhav, On Thu, Nov 19, 2009 at 08:16:40PM +0530, hvaib...@ti.com wrote: From: Vaibhav Hiremath hvaib...@ti.com Signed-off-by: Vaibhav Hiremath hvaib...@ti.com If I do: sed 's/2004/2007/g' drivers/input/touchscreen/tsc2004.c | diff -u drivers/input/touchscreen/tsc2007.c - the diff is miniscule so why can't TSC2004 support be simply added to TSC2007 driver? Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html