[PATCH 3/7] input: atmel_mxt_ts: check mxt224 family before writing touchscreen voltage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peter Meerwald <p.meerwald@xxxxxxxxxxxxxxxxxx>

only the mxt224 has a SPT_CTECONFIG_T28 object, the mxt224e doesn't

Signed-off-by: Peter Meerwald <p.meerwald@xxxxxxxxxxxxxxxxxx>
---
 drivers/input/touchscreen/atmel_mxt_ts.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 63a82bb..17cc15a 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -41,6 +41,10 @@
 #define MXT_OBJECT_NUM		0x06
 #define MXT_OBJECT_START	0x07
 
+/* Family IDs */
+#define MXT224_ID	0x80
+#define MXT224E_ID	0x81
+
 #define MXT_OBJECT_SIZE		6
 
 /* Object types */
@@ -687,7 +691,7 @@ static void mxt_handle_pdata(struct mxt_data *data)
 			MXT_TOUCH_YRANGE_MSB, (pdata->y_size - 1) >> 8);
 
 	/* Set touchscreen voltage */
-	if (pdata->voltage) {
+	if (pdata->voltage && data->info.family_id == MXT224_ID) {
 		if (pdata->voltage < MXT_VOLTAGE_DEFAULT) {
 			voltage = (MXT_VOLTAGE_DEFAULT - pdata->voltage) /
 				MXT_VOLTAGE_STEP;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux