Skip to contentSkip to conversation

-V2 Add touch screen input driver for TPS6507x family of multi-function chips.

PATCH In review Todd Fischer 3 participants 7 messages Apr 5, 2010 – Apr 8, 2010

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover -V2 Add touch screen input driver for TPS6507x family of multi-function chips.

This is the second posting of the TPS6507x touch screen driver. I have incorporated Kevin Hilman's request to split the board specific changes into a separate patch.

The TPS6507x family of Texas Instruments power management ICs (pmic) are multi-function chips that include voltage regulation and touch screen controller capabilities. This patch adds a touch screen input driver for the TPS6507x pmic. There was an existing regulator driver. Before the touch screen driver can be added, a multi-function device (MFD) driver was needed and the regulator driver modified to use the MDF driver. Patches for these changes have been posted and reviewed. The TPS6507x touch screen driver applies cleanly to the MFD GIT repo after the above referenced patches are applied. If I should use a different approach, please let me know.

The TPS6507x pmic supports interrupting on touch detection. Unfortuntaly, the hardware used for driver development didn't have the interrupt signal properly connected. When TPS6507x pmic interrupt capable hardware is in hand, another patch will be posted adding interrupt support.

#1 lore raw

PATCH 1/2 Touch screen input driver for TPS6507x family of multi-function chips.

Add touch screen input driver for TPS6507x family of multi-function chips. Uses the TPS6507x MFD driver. No interrupt support due to testing limitations of current hardware.

---
 drivers/input/touchscreen/Kconfig       |   13 +
 drivers/input/touchscreen/Makefile      |    1 +
 drivers/input/touchscreen/tps6507x-ts.c |  400 +++++++++++++++++++++++++++++++
 drivers/mfd/tps6507x.c                  |    3 +
 include/linux/input/tps6507x-ts.h       |   24 ++
 include/linux/mfd/tps6507x.h            |    2 +
 6 files changed, 443 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/tps6507x-ts.c
 create mode 100644 include/linux/input/tps6507x-ts.h
drivers/input/touchscreen/Kconfig +13 -0
index 8a8fa4d..6166aa8 100644
@@ -594,4 +594,17 @@ config TOUCHSCREEN_PCAP
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called pcap_ts.
+
+config TOUCHSCREEN_TPS6507X
+	tristate "TPS6507x based touchscreens"
+	depends on I2C
+	help
+	  Say Y here if you have a TPS6507x based touchscreen
+	  controller.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called tps6507x_ts.
+
 endif
drivers/input/touchscreen/Makefile +1 -0
index 7fef7d5..cfa83d0 100644
@@ -46,3 +46,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL)	+= atmel-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)	+= mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)	+= zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)	+= w90p910_ts.o
+obj-$(CONFIG_TOUCHSCREEN_TPS6507X)	+= tps6507x-ts.o
drivers/input/touchscreen/tps6507x-ts.c new file +400 -0

400 lines not on this page · raw message

drivers/mfd/tps6507x.c +3 -0
index edda9ff..d05c52d 100644
@@ -25,6 +25,9 @@ static struct mfd_cell tps6507x_devs[] = {
 	{
 		.name = "tps6507x-pmic",
 	},
+	{
+		.name = "tps6507x-ts",
+	},
 };
 
 
include/linux/input/tps6507x-ts.h new file +24 -0
new file mode 100644
index 0000000..ab14403
@@ -0,0 +1,24 @@
+/* linux/i2c/tps6507x-ts.h
+ *
+ * Functions to access TPS65070 touch screen chip.
+ *
+ * Copyright (c) 2009 RidgeRun ([email protected])
+ *
+ *
+ *  For licencing details see kernel-base/COPYING
+ */
+
+#ifndef __LINUX_I2C_TPS6507X_TS_H
+#define __LINUX_I2C_TPS6507X_TS_H
+
+/* Board specific touch screen initial values */
+struct touchscreen_init_data {
+	int	poll_period;	/* ms */
+	int	vref;		/* non-zero to leave vref on */
+	__u16	min_pressure;	/* min reading to be treated as a touch */
+	__u16	vendor;
+	__u16	product;
+	__u16	version;
+};
+
+#endif /*  __LINUX_I2C_TPS6507X_TS_H */
include/linux/mfd/tps6507x.h +2 -0
index 9543cb7..c923e48 100644
@@ -142,6 +142,7 @@
 
 struct tps6507x_board {
 	struct regulator_init_data *tps6507x_pmic_init_data;
+	struct touchscreen_init_data *tps6507x_ts_init_data;
 };
 
 /**
@@ -162,6 +163,7 @@ struct tps6507x_dev {
 
 	/* Client devices */
 	struct tps6507x_pmic *pmic;
+	struct tps6507x_ts *ts;
 };
 
 #endif /*  __LINUX_MFD_TPS6507X_H */
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 2/2 TPS6507x touch screen driver board specific initialization values.

The touch screen controller in the TPS6507x chip needs values that are dependent on the characteristics of the touch screen hardware being used in the board design. In addition, the board provides version information that is exposed via the kernel input sub-system.

---
 arch/arm/mach-davinci/board-da850-evm.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +12 -0
index d059924..b3cbb32 100644
@@ -25,6 +25,8 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/regulator/machine.h>
+#include <linux/mfd/tps6507x.h>
+#include <linux/input/tps6507x-ts.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -534,8 +536,18 @@ struct regulator_init_data tps65070_regulator_data[] = {
 	},
 };
 
+static struct touchscreen_init_data tps6507x_touchscreen_data = {
+	.poll_period =  30,	/* ms between touch samples */
+	.min_pressure = 0x30,	/* minimum pressure to trigger touch */
+	.vref = 0,		/* turn off vref when not using A/D */
+	.vendor = 0,		/* /sys/class/input/input?/id/vendor */
+	.product = 65070,	/* /sys/class/input/input?/id/product */
+	.version = 0x100,	/* /sys/class/input/input?/id/version */
+};
+
 static struct tps6507x_board tps_board = {
 	.tps6507x_pmic_init_data = &tps65070_regulator_data[0],
+	.tps6507x_ts_init_data = &tps6507x_touchscreen_data,
 };
 
 static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
Signature · 1 line
1.6.0.4
#3 lore raw
In reply to Todd Fischer

Hi Todd, hi Kevin,

Quoted 16 lines · Todd Fischer

This is the second posting of the TPS6507x touch screen driver. I have incorporated Kevin Hilman's request to split the board specific changes into a separate patch.

The TPS6507x family of Texas Instruments power management ICs (pmic) are multi-function chips that include voltage regulation and touch screen controller capabilities. This patch adds a touch screen input driver for the TPS6507x pmic. There was an existing regulator driver. Before the touch screen driver can be added, a multi-function device (MFD) driver was needed and the regulator driver modified to use the MDF driver. Patches for these changes have been posted and reviewed. The TPS6507x touch screen driver applies cleanly to the MFD GIT repo after the above referenced patches are applied. If I should use a different approach, please let me know.

Quoted 5 lines

The TPS6507x pmic supports interrupting on touch detection. Unfortuntaly, the hardware used for driver development didn't have the interrupt signal properly connected. When TPS6507x pmic interrupt capable hardware is in hand, another patch will be posted adding interrupt support.

I've applied patch #1 of this patchset. Kevin, would you please take patch #2?

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#4 lore raw
Quoted 19 lines · Samuel Ortiz

Hi Todd, hi Kevin,

Quoted 16 lines · Todd Fischer

This is the second posting of the TPS6507x touch screen driver. I have incorporated Kevin Hilman's request to split the board specific changes into a separate patch.

The TPS6507x family of Texas Instruments power management ICs (pmic) are multi-function chips that include voltage regulation and touch screen controller capabilities. This patch adds a touch screen input driver for the TPS6507x pmic. There was an existing regulator driver. Before the touch screen driver can be added, a multi-function device (MFD) driver was needed and the regulator driver modified to use the MDF driver. Patches for these changes have been posted and reviewed. The TPS6507x touch screen driver applies cleanly to the MFD GIT repo after the above referenced patches are applied. If I should use a different approach, please let me know.

Quoted 7 lines
Quoted 5 lines

The TPS6507x pmic supports interrupting on touch detection. Unfortuntaly, the hardware used for driver development didn't have the interrupt signal properly connected. When TPS6507x pmic interrupt capable hardware is in hand, another patch will be posted adding interrupt support.

I've applied patch #1 of this patchset. Kevin, would you please take patch #2?

Thanks. Yes, patch #2 will be queued for linux-next and 2.6.35.

Kevin

#5 lore raw
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Samuel Ortiz

Hi Todd, hi Kevin,

Quoted 4 lines · Todd Fischer

This is the second posting of the TPS6507x touch screen driver. I have incorporated Kevin Hilman's request to split the board specific changes into a separate patch.

[...]

Quoted 4 lines
Quoted 2 lines

I've applied patch #1 of this patchset. Kevin, would you please take patch #2?

Thanks. Yes, patch #2 will be queued for linux-next and 2.6.35.

After trying to apply this, I ran into some snags

The other series '[PATCH 0/4]-V3 TPS6507x MFD driver' also had some board file changes mixed in that I did not catch, and patch #2 of this series depends on those.

So either we split those out and merge them via my tree, or you can just merge patch #2 of this series via your tree as well.

I'm OK with either option, but just merging patch #2 of this series via your tree seems like the least amount of hassle at this time.

If you merge via your tree, please add:

Kevin

#6 lore raw

Hi Kevin,

Quoted 25 lines · Kevin Hilman
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Samuel Ortiz

Hi Todd, hi Kevin,

Quoted 4 lines · Todd Fischer

This is the second posting of the TPS6507x touch screen driver. I have incorporated Kevin Hilman's request to split the board specific changes into a separate patch.

[...]

Quoted 4 lines
Quoted 2 lines

I've applied patch #1 of this patchset. Kevin, would you please take patch #2?

Thanks. Yes, patch #2 will be queued for linux-next and 2.6.35.

After trying to apply this, I ran into some snags

The other series '[PATCH 0/4]-V3 TPS6507x MFD driver' also had some board file changes mixed in that I did not catch, and patch #2 of this series depends on those.

Quoted 5 lines

So either we split those out and merge them via my tree, or you can just merge patch #2 of this series via your tree as well.

I'm OK with either option, but just merging patch #2 of this series via your tree seems like the least amount of hassle at this time.

Definitely. I'm taking this patch, thanks a lot.

Cheers,
Samuel.

Quoted 5 lines

If you merge via your tree, please add:

Kevin

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/