diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-24 03:06:26 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-24 03:06:26 -0400 |
commit | b73077eb03f510a84b102fb97640e595a958403c (patch) | |
tree | 8b639000418e2756bf6baece4e00e07d2534bccc /drivers/input/touchscreen | |
parent | 28350e330cfab46b60a1dbf763b678d859f9f3d9 (diff) | |
parent | 9d2e173644bb5c42ff1b280fbdda3f195a7cf1f7 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/Kconfig | 12 | ||||
-rw-r--r-- | drivers/input/touchscreen/Makefile | 1 | ||||
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 26 | ||||
-rw-r--r-- | drivers/input/touchscreen/atmel_mxt_ts.c | 92 | ||||
-rw-r--r-- | drivers/input/touchscreen/atmel_tsadcc.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/h3600_ts_input.c | 8 | ||||
-rw-r--r-- | drivers/input/touchscreen/intel-mid-touch.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/mainstone-wm97xx.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/max11801_ts.c | 272 | ||||
-rw-r--r-- | drivers/input/touchscreen/tps6507x-ts.c | 12 | ||||
-rw-r--r-- | drivers/input/touchscreen/tsc2007.c | 26 | ||||
-rw-r--r-- | drivers/input/touchscreen/ucb1400_ts.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm9705.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm9712.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm9713.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm97xx-core.c | 4 | ||||
-rw-r--r-- | drivers/input/touchscreen/zylonite-wm97xx.c | 2 |
17 files changed, 399 insertions, 70 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 434fd800cd24..cabd9e54863f 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -248,6 +248,18 @@ config TOUCHSCREEN_LPC32XX | |||
248 | To compile this driver as a module, choose M here: the | 248 | To compile this driver as a module, choose M here: the |
249 | module will be called lpc32xx_ts. | 249 | module will be called lpc32xx_ts. |
250 | 250 | ||
251 | config TOUCHSCREEN_MAX11801 | ||
252 | tristate "MAX11801 based touchscreens" | ||
253 | depends on I2C | ||
254 | help | ||
255 | Say Y here if you have a MAX11801 based touchscreen | ||
256 | controller. | ||
257 | |||
258 | If unsure, say N. | ||
259 | |||
260 | To compile this driver as a module, choose M here: the | ||
261 | module will be called max11801_ts. | ||
262 | |||
251 | config TOUCHSCREEN_MCS5000 | 263 | config TOUCHSCREEN_MCS5000 |
252 | tristate "MELFAS MCS-5000 touchscreen" | 264 | tristate "MELFAS MCS-5000 touchscreen" |
253 | depends on I2C | 265 | depends on I2C |
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index ca94098d4c92..282d6f76ae26 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile | |||
@@ -27,6 +27,7 @@ obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o | |||
27 | obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o | 27 | obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o |
28 | obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o | 28 | obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o |
29 | obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o | 29 | obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o |
30 | obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o | ||
30 | obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o | 31 | obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o |
31 | obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o | 32 | obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o |
32 | obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o | 33 | obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 1de1c19dad30..5196861b86ef 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -109,6 +109,7 @@ struct ads7846 { | |||
109 | u16 pressure_max; | 109 | u16 pressure_max; |
110 | 110 | ||
111 | bool swap_xy; | 111 | bool swap_xy; |
112 | bool use_internal; | ||
112 | 113 | ||
113 | struct ads7846_packet *packet; | 114 | struct ads7846_packet *packet; |
114 | 115 | ||
@@ -307,7 +308,6 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) | |||
307 | struct ads7846 *ts = dev_get_drvdata(dev); | 308 | struct ads7846 *ts = dev_get_drvdata(dev); |
308 | struct ser_req *req; | 309 | struct ser_req *req; |
309 | int status; | 310 | int status; |
310 | int use_internal; | ||
311 | 311 | ||
312 | req = kzalloc(sizeof *req, GFP_KERNEL); | 312 | req = kzalloc(sizeof *req, GFP_KERNEL); |
313 | if (!req) | 313 | if (!req) |
@@ -315,11 +315,8 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) | |||
315 | 315 | ||
316 | spi_message_init(&req->msg); | 316 | spi_message_init(&req->msg); |
317 | 317 | ||
318 | /* FIXME boards with ads7846 might use external vref instead ... */ | ||
319 | use_internal = (ts->model == 7846); | ||
320 | |||
321 | /* maybe turn on internal vREF, and let it settle */ | 318 | /* maybe turn on internal vREF, and let it settle */ |
322 | if (use_internal) { | 319 | if (ts->use_internal) { |
323 | req->ref_on = REF_ON; | 320 | req->ref_on = REF_ON; |
324 | req->xfer[0].tx_buf = &req->ref_on; | 321 | req->xfer[0].tx_buf = &req->ref_on; |
325 | req->xfer[0].len = 1; | 322 | req->xfer[0].len = 1; |
@@ -331,8 +328,14 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) | |||
331 | /* for 1uF, settle for 800 usec; no cap, 100 usec. */ | 328 | /* for 1uF, settle for 800 usec; no cap, 100 usec. */ |
332 | req->xfer[1].delay_usecs = ts->vref_delay_usecs; | 329 | req->xfer[1].delay_usecs = ts->vref_delay_usecs; |
333 | spi_message_add_tail(&req->xfer[1], &req->msg); | 330 | spi_message_add_tail(&req->xfer[1], &req->msg); |
331 | |||
332 | /* Enable reference voltage */ | ||
333 | command |= ADS_PD10_REF_ON; | ||
334 | } | 334 | } |
335 | 335 | ||
336 | /* Enable ADC in every case */ | ||
337 | command |= ADS_PD10_ADC_ON; | ||
338 | |||
336 | /* take sample */ | 339 | /* take sample */ |
337 | req->command = (u8) command; | 340 | req->command = (u8) command; |
338 | req->xfer[2].tx_buf = &req->command; | 341 | req->xfer[2].tx_buf = &req->command; |
@@ -416,7 +419,7 @@ name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \ | |||
416 | { \ | 419 | { \ |
417 | struct ads7846 *ts = dev_get_drvdata(dev); \ | 420 | struct ads7846 *ts = dev_get_drvdata(dev); \ |
418 | ssize_t v = ads7846_read12_ser(dev, \ | 421 | ssize_t v = ads7846_read12_ser(dev, \ |
419 | READ_12BIT_SER(var) | ADS_PD10_ALL_ON); \ | 422 | READ_12BIT_SER(var)); \ |
420 | if (v < 0) \ | 423 | if (v < 0) \ |
421 | return v; \ | 424 | return v; \ |
422 | return sprintf(buf, "%u\n", adjust(ts, v)); \ | 425 | return sprintf(buf, "%u\n", adjust(ts, v)); \ |
@@ -509,6 +512,7 @@ static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) | |||
509 | if (!ts->vref_mv) { | 512 | if (!ts->vref_mv) { |
510 | dev_dbg(&spi->dev, "assuming 2.5V internal vREF\n"); | 513 | dev_dbg(&spi->dev, "assuming 2.5V internal vREF\n"); |
511 | ts->vref_mv = 2500; | 514 | ts->vref_mv = 2500; |
515 | ts->use_internal = true; | ||
512 | } | 516 | } |
513 | break; | 517 | break; |
514 | case 7845: | 518 | case 7845: |
@@ -969,6 +973,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784 | |||
969 | pdata->gpio_pendown); | 973 | pdata->gpio_pendown); |
970 | return err; | 974 | return err; |
971 | } | 975 | } |
976 | err = gpio_direction_input(pdata->gpio_pendown); | ||
977 | if (err) { | ||
978 | dev_err(&spi->dev, "failed to setup pendown GPIO%d\n", | ||
979 | pdata->gpio_pendown); | ||
980 | gpio_free(pdata->gpio_pendown); | ||
981 | return err; | ||
982 | } | ||
972 | 983 | ||
973 | ts->gpio_pendown = pdata->gpio_pendown; | 984 | ts->gpio_pendown = pdata->gpio_pendown; |
974 | 985 | ||
@@ -1340,8 +1351,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
1340 | if (ts->model == 7845) | 1351 | if (ts->model == 7845) |
1341 | ads7845_read12_ser(&spi->dev, PWRDOWN); | 1352 | ads7845_read12_ser(&spi->dev, PWRDOWN); |
1342 | else | 1353 | else |
1343 | (void) ads7846_read12_ser(&spi->dev, | 1354 | (void) ads7846_read12_ser(&spi->dev, READ_12BIT_SER(vaux)); |
1344 | READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON); | ||
1345 | 1355 | ||
1346 | err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group); | 1356 | err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group); |
1347 | if (err) | 1357 | if (err) |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 4012436633b1..1e61387c73ca 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/firmware.h> | 17 | #include <linux/firmware.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/i2c/atmel_mxt_ts.h> | 19 | #include <linux/i2c/atmel_mxt_ts.h> |
20 | #include <linux/input.h> | 20 | #include <linux/input/mt.h> |
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | 23 | ||
@@ -196,9 +196,12 @@ | |||
196 | #define MXT_PRESS (1 << 6) | 196 | #define MXT_PRESS (1 << 6) |
197 | #define MXT_DETECT (1 << 7) | 197 | #define MXT_DETECT (1 << 7) |
198 | 198 | ||
199 | /* Touch orient bits */ | ||
200 | #define MXT_XY_SWITCH (1 << 0) | ||
201 | #define MXT_X_INVERT (1 << 1) | ||
202 | #define MXT_Y_INVERT (1 << 2) | ||
203 | |||
199 | /* Touchscreen absolute values */ | 204 | /* Touchscreen absolute values */ |
200 | #define MXT_MAX_XC 0x3ff | ||
201 | #define MXT_MAX_YC 0x3ff | ||
202 | #define MXT_MAX_AREA 0xff | 205 | #define MXT_MAX_AREA 0xff |
203 | 206 | ||
204 | #define MXT_MAX_FINGER 10 | 207 | #define MXT_MAX_FINGER 10 |
@@ -246,6 +249,8 @@ struct mxt_data { | |||
246 | struct mxt_info info; | 249 | struct mxt_info info; |
247 | struct mxt_finger finger[MXT_MAX_FINGER]; | 250 | struct mxt_finger finger[MXT_MAX_FINGER]; |
248 | unsigned int irq; | 251 | unsigned int irq; |
252 | unsigned int max_x; | ||
253 | unsigned int max_y; | ||
249 | }; | 254 | }; |
250 | 255 | ||
251 | static bool mxt_object_readable(unsigned int type) | 256 | static bool mxt_object_readable(unsigned int type) |
@@ -499,19 +504,21 @@ static void mxt_input_report(struct mxt_data *data, int single_id) | |||
499 | if (!finger[id].status) | 504 | if (!finger[id].status) |
500 | continue; | 505 | continue; |
501 | 506 | ||
502 | input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, | 507 | input_mt_slot(input_dev, id); |
503 | finger[id].status != MXT_RELEASE ? | 508 | input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, |
504 | finger[id].area : 0); | 509 | finger[id].status != MXT_RELEASE); |
505 | input_report_abs(input_dev, ABS_MT_POSITION_X, | ||
506 | finger[id].x); | ||
507 | input_report_abs(input_dev, ABS_MT_POSITION_Y, | ||
508 | finger[id].y); | ||
509 | input_mt_sync(input_dev); | ||
510 | 510 | ||
511 | if (finger[id].status == MXT_RELEASE) | 511 | if (finger[id].status != MXT_RELEASE) { |
512 | finger[id].status = 0; | ||
513 | else | ||
514 | finger_num++; | 512 | finger_num++; |
513 | input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, | ||
514 | finger[id].area); | ||
515 | input_report_abs(input_dev, ABS_MT_POSITION_X, | ||
516 | finger[id].x); | ||
517 | input_report_abs(input_dev, ABS_MT_POSITION_Y, | ||
518 | finger[id].y); | ||
519 | } else { | ||
520 | finger[id].status = 0; | ||
521 | } | ||
515 | } | 522 | } |
516 | 523 | ||
517 | input_report_key(input_dev, BTN_TOUCH, finger_num > 0); | 524 | input_report_key(input_dev, BTN_TOUCH, finger_num > 0); |
@@ -549,8 +556,13 @@ static void mxt_input_touchevent(struct mxt_data *data, | |||
549 | if (!(status & (MXT_PRESS | MXT_MOVE))) | 556 | if (!(status & (MXT_PRESS | MXT_MOVE))) |
550 | return; | 557 | return; |
551 | 558 | ||
552 | x = (message->message[1] << 2) | ((message->message[3] & ~0x3f) >> 6); | 559 | x = (message->message[1] << 4) | ((message->message[3] >> 4) & 0xf); |
553 | y = (message->message[2] << 2) | ((message->message[3] & ~0xf3) >> 2); | 560 | y = (message->message[2] << 4) | ((message->message[3] & 0xf)); |
561 | if (data->max_x < 1024) | ||
562 | x = x >> 2; | ||
563 | if (data->max_y < 1024) | ||
564 | y = y >> 2; | ||
565 | |||
554 | area = message->message[4]; | 566 | area = message->message[4]; |
555 | 567 | ||
556 | dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, | 568 | dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, |
@@ -804,10 +816,6 @@ static int mxt_initialize(struct mxt_data *data) | |||
804 | if (error) | 816 | if (error) |
805 | return error; | 817 | return error; |
806 | 818 | ||
807 | error = mxt_make_highchg(data); | ||
808 | if (error) | ||
809 | return error; | ||
810 | |||
811 | mxt_handle_pdata(data); | 819 | mxt_handle_pdata(data); |
812 | 820 | ||
813 | /* Backup to memory */ | 821 | /* Backup to memory */ |
@@ -845,6 +853,20 @@ static int mxt_initialize(struct mxt_data *data) | |||
845 | return 0; | 853 | return 0; |
846 | } | 854 | } |
847 | 855 | ||
856 | static void mxt_calc_resolution(struct mxt_data *data) | ||
857 | { | ||
858 | unsigned int max_x = data->pdata->x_size - 1; | ||
859 | unsigned int max_y = data->pdata->y_size - 1; | ||
860 | |||
861 | if (data->pdata->orient & MXT_XY_SWITCH) { | ||
862 | data->max_x = max_y; | ||
863 | data->max_y = max_x; | ||
864 | } else { | ||
865 | data->max_x = max_x; | ||
866 | data->max_y = max_y; | ||
867 | } | ||
868 | } | ||
869 | |||
848 | static ssize_t mxt_object_show(struct device *dev, | 870 | static ssize_t mxt_object_show(struct device *dev, |
849 | struct device_attribute *attr, char *buf) | 871 | struct device_attribute *attr, char *buf) |
850 | { | 872 | { |
@@ -981,6 +1003,10 @@ static ssize_t mxt_update_fw_store(struct device *dev, | |||
981 | 1003 | ||
982 | enable_irq(data->irq); | 1004 | enable_irq(data->irq); |
983 | 1005 | ||
1006 | error = mxt_make_highchg(data); | ||
1007 | if (error) | ||
1008 | return error; | ||
1009 | |||
984 | return count; | 1010 | return count; |
985 | } | 1011 | } |
986 | 1012 | ||
@@ -1052,31 +1078,33 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1052 | input_dev->open = mxt_input_open; | 1078 | input_dev->open = mxt_input_open; |
1053 | input_dev->close = mxt_input_close; | 1079 | input_dev->close = mxt_input_close; |
1054 | 1080 | ||
1081 | data->client = client; | ||
1082 | data->input_dev = input_dev; | ||
1083 | data->pdata = pdata; | ||
1084 | data->irq = client->irq; | ||
1085 | |||
1086 | mxt_calc_resolution(data); | ||
1087 | |||
1055 | __set_bit(EV_ABS, input_dev->evbit); | 1088 | __set_bit(EV_ABS, input_dev->evbit); |
1056 | __set_bit(EV_KEY, input_dev->evbit); | 1089 | __set_bit(EV_KEY, input_dev->evbit); |
1057 | __set_bit(BTN_TOUCH, input_dev->keybit); | 1090 | __set_bit(BTN_TOUCH, input_dev->keybit); |
1058 | 1091 | ||
1059 | /* For single touch */ | 1092 | /* For single touch */ |
1060 | input_set_abs_params(input_dev, ABS_X, | 1093 | input_set_abs_params(input_dev, ABS_X, |
1061 | 0, MXT_MAX_XC, 0, 0); | 1094 | 0, data->max_x, 0, 0); |
1062 | input_set_abs_params(input_dev, ABS_Y, | 1095 | input_set_abs_params(input_dev, ABS_Y, |
1063 | 0, MXT_MAX_YC, 0, 0); | 1096 | 0, data->max_y, 0, 0); |
1064 | 1097 | ||
1065 | /* For multi touch */ | 1098 | /* For multi touch */ |
1099 | input_mt_init_slots(input_dev, MXT_MAX_FINGER); | ||
1066 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, | 1100 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, |
1067 | 0, MXT_MAX_AREA, 0, 0); | 1101 | 0, MXT_MAX_AREA, 0, 0); |
1068 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, | 1102 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
1069 | 0, MXT_MAX_XC, 0, 0); | 1103 | 0, data->max_x, 0, 0); |
1070 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, | 1104 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
1071 | 0, MXT_MAX_YC, 0, 0); | 1105 | 0, data->max_y, 0, 0); |
1072 | 1106 | ||
1073 | input_set_drvdata(input_dev, data); | 1107 | input_set_drvdata(input_dev, data); |
1074 | |||
1075 | data->client = client; | ||
1076 | data->input_dev = input_dev; | ||
1077 | data->pdata = pdata; | ||
1078 | data->irq = client->irq; | ||
1079 | |||
1080 | i2c_set_clientdata(client, data); | 1108 | i2c_set_clientdata(client, data); |
1081 | 1109 | ||
1082 | error = mxt_initialize(data); | 1110 | error = mxt_initialize(data); |
@@ -1090,6 +1118,10 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1090 | goto err_free_object; | 1118 | goto err_free_object; |
1091 | } | 1119 | } |
1092 | 1120 | ||
1121 | error = mxt_make_highchg(data); | ||
1122 | if (error) | ||
1123 | goto err_free_irq; | ||
1124 | |||
1093 | error = input_register_device(input_dev); | 1125 | error = input_register_device(input_dev); |
1094 | if (error) | 1126 | if (error) |
1095 | goto err_free_irq; | 1127 | goto err_free_irq; |
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c index 3d9b5166ebe9..432c69be6ac6 100644 --- a/drivers/input/touchscreen/atmel_tsadcc.c +++ b/drivers/input/touchscreen/atmel_tsadcc.c | |||
@@ -317,7 +317,7 @@ err_unmap_regs: | |||
317 | err_release_mem: | 317 | err_release_mem: |
318 | release_mem_region(res->start, resource_size(res)); | 318 | release_mem_region(res->start, resource_size(res)); |
319 | err_free_dev: | 319 | err_free_dev: |
320 | input_free_device(ts_dev->input); | 320 | input_free_device(input_dev); |
321 | err_free_mem: | 321 | err_free_mem: |
322 | kfree(ts_dev); | 322 | kfree(ts_dev); |
323 | return err; | 323 | return err; |
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c index 45f93d0f5592..211811ae5525 100644 --- a/drivers/input/touchscreen/h3600_ts_input.c +++ b/drivers/input/touchscreen/h3600_ts_input.c | |||
@@ -396,14 +396,14 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv) | |||
396 | set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE); | 396 | set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE); |
397 | 397 | ||
398 | if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler, | 398 | if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler, |
399 | IRQF_SHARED | IRQF_DISABLED, "h3600_action", &ts->dev)) { | 399 | IRQF_SHARED | IRQF_DISABLED, "h3600_action", ts->dev)) { |
400 | printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n"); | 400 | printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n"); |
401 | err = -EBUSY; | 401 | err = -EBUSY; |
402 | goto fail1; | 402 | goto fail1; |
403 | } | 403 | } |
404 | 404 | ||
405 | if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler, | 405 | if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler, |
406 | IRQF_SHARED | IRQF_DISABLED, "h3600_suspend", &ts->dev)) { | 406 | IRQF_SHARED | IRQF_DISABLED, "h3600_suspend", ts->dev)) { |
407 | printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n"); | 407 | printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n"); |
408 | err = -EBUSY; | 408 | err = -EBUSY; |
409 | goto fail2; | 409 | goto fail2; |
@@ -439,8 +439,8 @@ static void h3600ts_disconnect(struct serio *serio) | |||
439 | { | 439 | { |
440 | struct h3600_dev *ts = serio_get_drvdata(serio); | 440 | struct h3600_dev *ts = serio_get_drvdata(serio); |
441 | 441 | ||
442 | free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev); | 442 | free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev); |
443 | free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, &ts->dev); | 443 | free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev); |
444 | input_get_device(ts->dev); | 444 | input_get_device(ts->dev); |
445 | input_unregister_device(ts->dev); | 445 | input_unregister_device(ts->dev); |
446 | serio_close(serio); | 446 | serio_close(serio); |
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c index c0307b22d86f..66c96bfc5522 100644 --- a/drivers/input/touchscreen/intel-mid-touch.c +++ b/drivers/input/touchscreen/intel-mid-touch.c | |||
@@ -542,7 +542,7 @@ static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev) | |||
542 | * ADC power on, start, enable PENDET and set loop delay | 542 | * ADC power on, start, enable PENDET and set loop delay |
543 | * ADC loop delay is set to 4.5 ms approximately | 543 | * ADC loop delay is set to 4.5 ms approximately |
544 | * Loop delay more than this results in jitter in adc readings | 544 | * Loop delay more than this results in jitter in adc readings |
545 | * Setting loop delay to 0 (continous loop) in MAXIM stops PENDET | 545 | * Setting loop delay to 0 (continuous loop) in MAXIM stops PENDET |
546 | * interrupt generation sometimes. | 546 | * interrupt generation sometimes. |
547 | */ | 547 | */ |
548 | 548 | ||
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c index b6b8b1c7ecea..3242e7076258 100644 --- a/drivers/input/touchscreen/mainstone-wm97xx.c +++ b/drivers/input/touchscreen/mainstone-wm97xx.c | |||
@@ -219,7 +219,7 @@ static int wm97xx_acc_startup(struct wm97xx *wm) | |||
219 | } | 219 | } |
220 | 220 | ||
221 | wm->pen_irq = gpio_to_irq(irq); | 221 | wm->pen_irq = gpio_to_irq(irq); |
222 | set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH); | 222 | irq_set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH); |
223 | } else /* pen irq not supported */ | 223 | } else /* pen irq not supported */ |
224 | pen_int = 0; | 224 | pen_int = 0; |
225 | 225 | ||
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c new file mode 100644 index 000000000000..4f2713d92791 --- /dev/null +++ b/drivers/input/touchscreen/max11801_ts.c | |||
@@ -0,0 +1,272 @@ | |||
1 | /* | ||
2 | * Driver for MAXI MAX11801 - A Resistive touch screen controller with | ||
3 | * i2c interface | ||
4 | * | ||
5 | * Copyright (C) 2011 Freescale Semiconductor, Inc. | ||
6 | * Author: Zhang Jiejing <jiejing.zhang@freescale.com> | ||
7 | * | ||
8 | * Based on mcs5000_ts.c | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License. | ||
13 | */ | ||
14 | |||
15 | /* | ||
16 | * This driver aims to support the series of MAXI touch chips max11801 | ||
17 | * through max11803. The main difference between these 4 chips can be | ||
18 | * found in the table below: | ||
19 | * ----------------------------------------------------- | ||
20 | * | CHIP | AUTO MODE SUPPORT(FIFO) | INTERFACE | | ||
21 | * |----------------------------------------------------| | ||
22 | * | max11800 | YES | SPI | | ||
23 | * | max11801 | YES | I2C | | ||
24 | * | max11802 | NO | SPI | | ||
25 | * | max11803 | NO | I2C | | ||
26 | * ------------------------------------------------------ | ||
27 | * | ||
28 | * Currently, this driver only supports max11801. | ||
29 | * | ||
30 | * Data Sheet: | ||
31 | * http://www.maxim-ic.com/datasheet/index.mvp/id/5943 | ||
32 | */ | ||
33 | |||
34 | #include <linux/module.h> | ||
35 | #include <linux/init.h> | ||
36 | #include <linux/i2c.h> | ||
37 | #include <linux/interrupt.h> | ||
38 | #include <linux/input.h> | ||
39 | #include <linux/slab.h> | ||
40 | #include <linux/bitops.h> | ||
41 | |||
42 | /* Register Address define */ | ||
43 | #define GENERNAL_STATUS_REG 0x00 | ||
44 | #define GENERNAL_CONF_REG 0x01 | ||
45 | #define MESURE_RES_CONF_REG 0x02 | ||
46 | #define MESURE_AVER_CONF_REG 0x03 | ||
47 | #define ADC_SAMPLE_TIME_CONF_REG 0x04 | ||
48 | #define PANEL_SETUPTIME_CONF_REG 0x05 | ||
49 | #define DELAY_CONVERSION_CONF_REG 0x06 | ||
50 | #define TOUCH_DETECT_PULLUP_CONF_REG 0x07 | ||
51 | #define AUTO_MODE_TIME_CONF_REG 0x08 /* only for max11800/max11801 */ | ||
52 | #define APERTURE_CONF_REG 0x09 /* only for max11800/max11801 */ | ||
53 | #define AUX_MESURE_CONF_REG 0x0a | ||
54 | #define OP_MODE_CONF_REG 0x0b | ||
55 | |||
56 | /* FIFO is found only in max11800 and max11801 */ | ||
57 | #define FIFO_RD_CMD (0x50 << 1) | ||
58 | #define MAX11801_FIFO_INT (1 << 2) | ||
59 | #define MAX11801_FIFO_OVERFLOW (1 << 3) | ||
60 | |||
61 | #define XY_BUFSIZE 4 | ||
62 | #define XY_BUF_OFFSET 4 | ||
63 | |||
64 | #define MAX11801_MAX_X 0xfff | ||
65 | #define MAX11801_MAX_Y 0xfff | ||
66 | |||
67 | #define MEASURE_TAG_OFFSET 2 | ||
68 | #define MEASURE_TAG_MASK (3 << MEASURE_TAG_OFFSET) | ||
69 | #define EVENT_TAG_OFFSET 0 | ||
70 | #define EVENT_TAG_MASK (3 << EVENT_TAG_OFFSET) | ||
71 | #define MEASURE_X_TAG (0 << MEASURE_TAG_OFFSET) | ||
72 | #define MEASURE_Y_TAG (1 << MEASURE_TAG_OFFSET) | ||
73 | |||
74 | /* These are the state of touch event state machine */ | ||
75 | enum { | ||
76 | EVENT_INIT, | ||
77 | EVENT_MIDDLE, | ||
78 | EVENT_RELEASE, | ||
79 | EVENT_FIFO_END | ||
80 | }; | ||
81 | |||
82 | struct max11801_data { | ||
83 | struct i2c_client *client; | ||
84 | struct input_dev *input_dev; | ||
85 | }; | ||
86 | |||
87 | static u8 read_register(struct i2c_client *client, int addr) | ||
88 | { | ||
89 | /* XXX: The chip ignores LSB of register address */ | ||
90 | return i2c_smbus_read_byte_data(client, addr << 1); | ||
91 | } | ||
92 | |||
93 | static int max11801_write_reg(struct i2c_client *client, int addr, int data) | ||
94 | { | ||
95 | /* XXX: The chip ignores LSB of register address */ | ||
96 | return i2c_smbus_write_byte_data(client, addr << 1, data); | ||
97 | } | ||
98 | |||
99 | static irqreturn_t max11801_ts_interrupt(int irq, void *dev_id) | ||
100 | { | ||
101 | struct max11801_data *data = dev_id; | ||
102 | struct i2c_client *client = data->client; | ||
103 | int status, i, ret; | ||
104 | u8 buf[XY_BUFSIZE]; | ||
105 | int x = -1; | ||
106 | int y = -1; | ||
107 | |||
108 | status = read_register(data->client, GENERNAL_STATUS_REG); | ||
109 | |||
110 | if (status & (MAX11801_FIFO_INT | MAX11801_FIFO_OVERFLOW)) { | ||
111 | status = read_register(data->client, GENERNAL_STATUS_REG); | ||
112 | |||
113 | ret = i2c_smbus_read_i2c_block_data(client, FIFO_RD_CMD, | ||
114 | XY_BUFSIZE, buf); | ||
115 | |||
116 | /* | ||
117 | * We should get 4 bytes buffer that contains X,Y | ||
118 | * and event tag | ||
119 | */ | ||
120 | if (ret < XY_BUFSIZE) | ||
121 | goto out; | ||
122 | |||
123 | for (i = 0; i < XY_BUFSIZE; i += XY_BUFSIZE / 2) { | ||
124 | if ((buf[i + 1] & MEASURE_TAG_MASK) == MEASURE_X_TAG) | ||
125 | x = (buf[i] << XY_BUF_OFFSET) + | ||
126 | (buf[i + 1] >> XY_BUF_OFFSET); | ||
127 | else if ((buf[i + 1] & MEASURE_TAG_MASK) == MEASURE_Y_TAG) | ||
128 | y = (buf[i] << XY_BUF_OFFSET) + | ||
129 | (buf[i + 1] >> XY_BUF_OFFSET); | ||
130 | } | ||
131 | |||
132 | if ((buf[1] & EVENT_TAG_MASK) != (buf[3] & EVENT_TAG_MASK)) | ||
133 | goto out; | ||
134 | |||
135 | switch (buf[1] & EVENT_TAG_MASK) { | ||
136 | case EVENT_INIT: | ||
137 | /* fall through */ | ||
138 | case EVENT_MIDDLE: | ||
139 | input_report_abs(data->input_dev, ABS_X, x); | ||
140 | input_report_abs(data->input_dev, ABS_Y, y); | ||
141 | input_event(data->input_dev, EV_KEY, BTN_TOUCH, 1); | ||
142 | input_sync(data->input_dev); | ||
143 | break; | ||
144 | |||
145 | case EVENT_RELEASE: | ||
146 | input_event(data->input_dev, EV_KEY, BTN_TOUCH, 0); | ||
147 | input_sync(data->input_dev); | ||
148 | break; | ||
149 | |||
150 | case EVENT_FIFO_END: | ||
151 | break; | ||
152 | } | ||
153 | } | ||
154 | out: | ||
155 | return IRQ_HANDLED; | ||
156 | } | ||
157 | |||
158 | static void __devinit max11801_ts_phy_init(struct max11801_data *data) | ||
159 | { | ||
160 | struct i2c_client *client = data->client; | ||
161 | |||
162 | /* Average X,Y, take 16 samples, average eight media sample */ | ||
163 | max11801_write_reg(client, MESURE_AVER_CONF_REG, 0xff); | ||
164 | /* X,Y panel setup time set to 20us */ | ||
165 | max11801_write_reg(client, PANEL_SETUPTIME_CONF_REG, 0x11); | ||
166 | /* Rough pullup time (2uS), Fine pullup time (10us) */ | ||
167 | max11801_write_reg(client, TOUCH_DETECT_PULLUP_CONF_REG, 0x10); | ||
168 | /* Auto mode init period = 5ms , scan period = 5ms*/ | ||
169 | max11801_write_reg(client, AUTO_MODE_TIME_CONF_REG, 0xaa); | ||
170 | /* Aperture X,Y set to +- 4LSB */ | ||
171 | max11801_write_reg(client, APERTURE_CONF_REG, 0x33); | ||
172 | /* Enable Power, enable Automode, enable Aperture, enable Average X,Y */ | ||
173 | max11801_write_reg(client, OP_MODE_CONF_REG, 0x36); | ||
174 | } | ||
175 | |||
176 | static int __devinit max11801_ts_probe(struct i2c_client *client, | ||
177 | const struct i2c_device_id *id) | ||
178 | { | ||
179 | struct max11801_data *data; | ||
180 | struct input_dev *input_dev; | ||
181 | int error; | ||
182 | |||
183 | data = kzalloc(sizeof(struct max11801_data), GFP_KERNEL); | ||
184 | input_dev = input_allocate_device(); | ||
185 | if (!data || !input_dev) { | ||
186 | dev_err(&client->dev, "Failed to allocate memory\n"); | ||
187 | error = -ENOMEM; | ||
188 | goto err_free_mem; | ||
189 | } | ||
190 | |||
191 | data->client = client; | ||
192 | data->input_dev = input_dev; | ||
193 | |||
194 | input_dev->name = "max11801_ts"; | ||
195 | input_dev->id.bustype = BUS_I2C; | ||
196 | input_dev->dev.parent = &client->dev; | ||
197 | |||
198 | __set_bit(EV_ABS, input_dev->evbit); | ||
199 | __set_bit(EV_KEY, input_dev->evbit); | ||
200 | __set_bit(BTN_TOUCH, input_dev->keybit); | ||
201 | input_set_abs_params(input_dev, ABS_X, 0, MAX11801_MAX_X, 0, 0); | ||
202 | input_set_abs_params(input_dev, ABS_Y, 0, MAX11801_MAX_Y, 0, 0); | ||
203 | input_set_drvdata(input_dev, data); | ||
204 | |||
205 | max11801_ts_phy_init(data); | ||
206 | |||
207 | error = request_threaded_irq(client->irq, NULL, max11801_ts_interrupt, | ||
208 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, | ||
209 | "max11801_ts", data); | ||
210 | if (error) { | ||
211 | dev_err(&client->dev, "Failed to register interrupt\n"); | ||
212 | goto err_free_mem; | ||
213 | } | ||
214 | |||
215 | error = input_register_device(data->input_dev); | ||
216 | if (error) | ||
217 | goto err_free_irq; | ||
218 | |||
219 | i2c_set_clientdata(client, data); | ||
220 | return 0; | ||
221 | |||
222 | err_free_irq: | ||
223 | free_irq(client->irq, data); | ||
224 | err_free_mem: | ||
225 | input_free_device(input_dev); | ||
226 | kfree(data); | ||
227 | return error; | ||
228 | } | ||
229 | |||
230 | static __devexit int max11801_ts_remove(struct i2c_client *client) | ||
231 | { | ||
232 | struct max11801_data *data = i2c_get_clientdata(client); | ||
233 | |||
234 | free_irq(client->irq, data); | ||
235 | input_unregister_device(data->input_dev); | ||
236 | kfree(data); | ||
237 | |||
238 | return 0; | ||
239 | } | ||
240 | |||
241 | static const struct i2c_device_id max11801_ts_id[] = { | ||
242 | {"max11801", 0}, | ||
243 | { } | ||
244 | }; | ||
245 | MODULE_DEVICE_TABLE(i2c, max11801_ts_id); | ||
246 | |||
247 | static struct i2c_driver max11801_ts_driver = { | ||
248 | .driver = { | ||
249 | .name = "max11801_ts", | ||
250 | .owner = THIS_MODULE, | ||
251 | }, | ||
252 | .id_table = max11801_ts_id, | ||
253 | .probe = max11801_ts_probe, | ||
254 | .remove = __devexit_p(max11801_ts_remove), | ||
255 | }; | ||
256 | |||
257 | static int __init max11801_ts_init(void) | ||
258 | { | ||
259 | return i2c_add_driver(&max11801_ts_driver); | ||
260 | } | ||
261 | |||
262 | static void __exit max11801_ts_exit(void) | ||
263 | { | ||
264 | i2c_del_driver(&max11801_ts_driver); | ||
265 | } | ||
266 | |||
267 | module_init(max11801_ts_init); | ||
268 | module_exit(max11801_ts_exit); | ||
269 | |||
270 | MODULE_AUTHOR("Zhang Jiejing <jiejing.zhang@freescale.com>"); | ||
271 | MODULE_DESCRIPTION("Touchscreen driver for MAXI MAX11801 controller"); | ||
272 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index c8c136cf7bbc..43031492d733 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c | |||
@@ -43,7 +43,6 @@ struct tps6507x_ts { | |||
43 | struct input_dev *input_dev; | 43 | struct input_dev *input_dev; |
44 | struct device *dev; | 44 | struct device *dev; |
45 | char phys[32]; | 45 | char phys[32]; |
46 | struct workqueue_struct *wq; | ||
47 | struct delayed_work work; | 46 | struct delayed_work work; |
48 | unsigned polling; /* polling is active */ | 47 | unsigned polling; /* polling is active */ |
49 | struct ts_event tc; | 48 | struct ts_event tc; |
@@ -220,8 +219,8 @@ done: | |||
220 | poll = 1; | 219 | poll = 1; |
221 | 220 | ||
222 | if (poll) { | 221 | if (poll) { |
223 | schd = queue_delayed_work(tsc->wq, &tsc->work, | 222 | schd = schedule_delayed_work(&tsc->work, |
224 | msecs_to_jiffies(tsc->poll_period)); | 223 | msecs_to_jiffies(tsc->poll_period)); |
225 | if (schd) | 224 | if (schd) |
226 | tsc->polling = 1; | 225 | tsc->polling = 1; |
227 | else { | 226 | else { |
@@ -303,7 +302,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev) | |||
303 | tsc->input_dev = input_dev; | 302 | tsc->input_dev = input_dev; |
304 | 303 | ||
305 | INIT_DELAYED_WORK(&tsc->work, tps6507x_ts_handler); | 304 | INIT_DELAYED_WORK(&tsc->work, tps6507x_ts_handler); |
306 | tsc->wq = create_workqueue("TPS6507x Touchscreen"); | ||
307 | 305 | ||
308 | if (init_data) { | 306 | if (init_data) { |
309 | tsc->poll_period = init_data->poll_period; | 307 | tsc->poll_period = init_data->poll_period; |
@@ -325,8 +323,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev) | |||
325 | if (error) | 323 | if (error) |
326 | goto err2; | 324 | goto err2; |
327 | 325 | ||
328 | schd = queue_delayed_work(tsc->wq, &tsc->work, | 326 | schd = schedule_delayed_work(&tsc->work, |
329 | msecs_to_jiffies(tsc->poll_period)); | 327 | msecs_to_jiffies(tsc->poll_period)); |
330 | 328 | ||
331 | if (schd) | 329 | if (schd) |
332 | tsc->polling = 1; | 330 | tsc->polling = 1; |
@@ -341,7 +339,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev) | |||
341 | 339 | ||
342 | err2: | 340 | err2: |
343 | cancel_delayed_work_sync(&tsc->work); | 341 | cancel_delayed_work_sync(&tsc->work); |
344 | destroy_workqueue(tsc->wq); | ||
345 | input_free_device(input_dev); | 342 | input_free_device(input_dev); |
346 | err1: | 343 | err1: |
347 | kfree(tsc); | 344 | kfree(tsc); |
@@ -357,7 +354,6 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev) | |||
357 | struct input_dev *input_dev = tsc->input_dev; | 354 | struct input_dev *input_dev = tsc->input_dev; |
358 | 355 | ||
359 | cancel_delayed_work_sync(&tsc->work); | 356 | cancel_delayed_work_sync(&tsc->work); |
360 | destroy_workqueue(tsc->wq); | ||
361 | 357 | ||
362 | input_unregister_device(input_dev); | 358 | input_unregister_device(input_dev); |
363 | 359 | ||
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 80467f262331..fadc11545b1e 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
@@ -27,9 +27,6 @@ | |||
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | #include <linux/i2c/tsc2007.h> | 28 | #include <linux/i2c/tsc2007.h> |
29 | 29 | ||
30 | #define TS_POLL_DELAY 1 /* ms delay between samples */ | ||
31 | #define TS_POLL_PERIOD 1 /* ms delay between samples */ | ||
32 | |||
33 | #define TSC2007_MEASURE_TEMP0 (0x0 << 4) | 30 | #define TSC2007_MEASURE_TEMP0 (0x0 << 4) |
34 | #define TSC2007_MEASURE_AUX (0x2 << 4) | 31 | #define TSC2007_MEASURE_AUX (0x2 << 4) |
35 | #define TSC2007_MEASURE_TEMP1 (0x4 << 4) | 32 | #define TSC2007_MEASURE_TEMP1 (0x4 << 4) |
@@ -75,6 +72,9 @@ struct tsc2007 { | |||
75 | 72 | ||
76 | u16 model; | 73 | u16 model; |
77 | u16 x_plate_ohms; | 74 | u16 x_plate_ohms; |
75 | u16 max_rt; | ||
76 | unsigned long poll_delay; | ||
77 | unsigned long poll_period; | ||
78 | 78 | ||
79 | bool pendown; | 79 | bool pendown; |
80 | int irq; | 80 | int irq; |
@@ -156,6 +156,7 @@ static void tsc2007_work(struct work_struct *work) | |||
156 | { | 156 | { |
157 | struct tsc2007 *ts = | 157 | struct tsc2007 *ts = |
158 | container_of(to_delayed_work(work), struct tsc2007, work); | 158 | container_of(to_delayed_work(work), struct tsc2007, work); |
159 | bool debounced = false; | ||
159 | struct ts_event tc; | 160 | struct ts_event tc; |
160 | u32 rt; | 161 | u32 rt; |
161 | 162 | ||
@@ -184,13 +185,14 @@ static void tsc2007_work(struct work_struct *work) | |||
184 | tsc2007_read_values(ts, &tc); | 185 | tsc2007_read_values(ts, &tc); |
185 | 186 | ||
186 | rt = tsc2007_calculate_pressure(ts, &tc); | 187 | rt = tsc2007_calculate_pressure(ts, &tc); |
187 | if (rt > MAX_12BIT) { | 188 | if (rt > ts->max_rt) { |
188 | /* | 189 | /* |
189 | * Sample found inconsistent by debouncing or pressure is | 190 | * Sample found inconsistent by debouncing or pressure is |
190 | * beyond the maximum. Don't report it to user space, | 191 | * beyond the maximum. Don't report it to user space, |
191 | * repeat at least once more the measurement. | 192 | * repeat at least once more the measurement. |
192 | */ | 193 | */ |
193 | dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); | 194 | dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); |
195 | debounced = true; | ||
194 | goto out; | 196 | goto out; |
195 | 197 | ||
196 | } | 198 | } |
@@ -225,9 +227,9 @@ static void tsc2007_work(struct work_struct *work) | |||
225 | } | 227 | } |
226 | 228 | ||
227 | out: | 229 | out: |
228 | if (ts->pendown) | 230 | if (ts->pendown || debounced) |
229 | schedule_delayed_work(&ts->work, | 231 | schedule_delayed_work(&ts->work, |
230 | msecs_to_jiffies(TS_POLL_PERIOD)); | 232 | msecs_to_jiffies(ts->poll_period)); |
231 | else | 233 | else |
232 | enable_irq(ts->irq); | 234 | enable_irq(ts->irq); |
233 | } | 235 | } |
@@ -239,7 +241,7 @@ static irqreturn_t tsc2007_irq(int irq, void *handle) | |||
239 | if (!ts->get_pendown_state || likely(ts->get_pendown_state())) { | 241 | if (!ts->get_pendown_state || likely(ts->get_pendown_state())) { |
240 | disable_irq_nosync(ts->irq); | 242 | disable_irq_nosync(ts->irq); |
241 | schedule_delayed_work(&ts->work, | 243 | schedule_delayed_work(&ts->work, |
242 | msecs_to_jiffies(TS_POLL_DELAY)); | 244 | msecs_to_jiffies(ts->poll_delay)); |
243 | } | 245 | } |
244 | 246 | ||
245 | if (ts->clear_penirq) | 247 | if (ts->clear_penirq) |
@@ -292,6 +294,9 @@ static int __devinit tsc2007_probe(struct i2c_client *client, | |||
292 | 294 | ||
293 | ts->model = pdata->model; | 295 | ts->model = pdata->model; |
294 | ts->x_plate_ohms = pdata->x_plate_ohms; | 296 | ts->x_plate_ohms = pdata->x_plate_ohms; |
297 | ts->max_rt = pdata->max_rt ? : MAX_12BIT; | ||
298 | ts->poll_delay = pdata->poll_delay ? : 1; | ||
299 | ts->poll_period = pdata->poll_period ? : 1; | ||
295 | ts->get_pendown_state = pdata->get_pendown_state; | 300 | ts->get_pendown_state = pdata->get_pendown_state; |
296 | ts->clear_penirq = pdata->clear_penirq; | 301 | ts->clear_penirq = pdata->clear_penirq; |
297 | 302 | ||
@@ -305,9 +310,10 @@ static int __devinit tsc2007_probe(struct i2c_client *client, | |||
305 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 310 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
306 | input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); | 311 | input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
307 | 312 | ||
308 | input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, 0, 0); | 313 | input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, pdata->fuzzx, 0); |
309 | input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, 0, 0); | 314 | input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, pdata->fuzzy, 0); |
310 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, 0, 0); | 315 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, |
316 | pdata->fuzzz, 0); | ||
311 | 317 | ||
312 | if (pdata->init_platform_hw) | 318 | if (pdata->init_platform_hw) |
313 | pdata->init_platform_hw(); | 319 | pdata->init_platform_hw(); |
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 028a5363eea1..3b5b5df04dd6 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright: MontaVista Software, Inc. | 6 | * Copyright: MontaVista Software, Inc. |
7 | * | 7 | * |
8 | * Spliting done by: Marek Vasut <marek.vasut@gmail.com> | 8 | * Spliting done by: Marek Vasut <marek.vasut@gmail.com> |
9 | * If something doesnt work and it worked before spliting, e-mail me, | 9 | * If something doesn't work and it worked before spliting, e-mail me, |
10 | * dont bother Nicolas please ;-) | 10 | * dont bother Nicolas please ;-) |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/input/touchscreen/wm9705.c b/drivers/input/touchscreen/wm9705.c index 6b5be742c27d..98e61175d3f5 100644 --- a/drivers/input/touchscreen/wm9705.c +++ b/drivers/input/touchscreen/wm9705.c | |||
@@ -306,7 +306,7 @@ static int wm9705_acc_enable(struct wm97xx *wm, int enable) | |||
306 | dig2 = wm->dig[2]; | 306 | dig2 = wm->dig[2]; |
307 | 307 | ||
308 | if (enable) { | 308 | if (enable) { |
309 | /* continous mode */ | 309 | /* continuous mode */ |
310 | if (wm->mach_ops->acc_startup && | 310 | if (wm->mach_ops->acc_startup && |
311 | (ret = wm->mach_ops->acc_startup(wm)) < 0) | 311 | (ret = wm->mach_ops->acc_startup(wm)) < 0) |
312 | return ret; | 312 | return ret; |
diff --git a/drivers/input/touchscreen/wm9712.c b/drivers/input/touchscreen/wm9712.c index 7490b05c3566..2bc2fb801009 100644 --- a/drivers/input/touchscreen/wm9712.c +++ b/drivers/input/touchscreen/wm9712.c | |||
@@ -419,7 +419,7 @@ static int wm9712_acc_enable(struct wm97xx *wm, int enable) | |||
419 | dig2 = wm->dig[2]; | 419 | dig2 = wm->dig[2]; |
420 | 420 | ||
421 | if (enable) { | 421 | if (enable) { |
422 | /* continous mode */ | 422 | /* continuous mode */ |
423 | if (wm->mach_ops->acc_startup) { | 423 | if (wm->mach_ops->acc_startup) { |
424 | ret = wm->mach_ops->acc_startup(wm); | 424 | ret = wm->mach_ops->acc_startup(wm); |
425 | if (ret < 0) | 425 | if (ret < 0) |
diff --git a/drivers/input/touchscreen/wm9713.c b/drivers/input/touchscreen/wm9713.c index 238b5132712e..73ec99568f12 100644 --- a/drivers/input/touchscreen/wm9713.c +++ b/drivers/input/touchscreen/wm9713.c | |||
@@ -431,7 +431,7 @@ static int wm9713_acc_enable(struct wm97xx *wm, int enable) | |||
431 | dig3 = wm->dig[2]; | 431 | dig3 = wm->dig[2]; |
432 | 432 | ||
433 | if (enable) { | 433 | if (enable) { |
434 | /* continous mode */ | 434 | /* continuous mode */ |
435 | if (wm->mach_ops->acc_startup && | 435 | if (wm->mach_ops->acc_startup && |
436 | (ret = wm->mach_ops->acc_startup(wm)) < 0) | 436 | (ret = wm->mach_ops->acc_startup(wm)) < 0) |
437 | return ret; | 437 | return ret; |
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 6b75c9f660ae..5dbe73af2f8f 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c | |||
@@ -335,7 +335,7 @@ static void wm97xx_pen_irq_worker(struct work_struct *work) | |||
335 | */ | 335 | */ |
336 | if (!wm->mach_ops->acc_enabled || wm->mach_ops->acc_pen_down) { | 336 | if (!wm->mach_ops->acc_enabled || wm->mach_ops->acc_pen_down) { |
337 | if (wm->pen_is_down && !pen_was_down) { | 337 | if (wm->pen_is_down && !pen_was_down) { |
338 | /* Data is not availiable immediately on pen down */ | 338 | /* Data is not available immediately on pen down */ |
339 | queue_delayed_work(wm->ts_workq, &wm->ts_reader, 1); | 339 | queue_delayed_work(wm->ts_workq, &wm->ts_reader, 1); |
340 | } | 340 | } |
341 | 341 | ||
@@ -354,7 +354,7 @@ static void wm97xx_pen_irq_worker(struct work_struct *work) | |||
354 | * Codec PENDOWN irq handler | 354 | * Codec PENDOWN irq handler |
355 | * | 355 | * |
356 | * We have to disable the codec interrupt in the handler because it | 356 | * We have to disable the codec interrupt in the handler because it |
357 | * can take upto 1ms to clear the interrupt source. We schedule a task | 357 | * can take up to 1ms to clear the interrupt source. We schedule a task |
358 | * in a work queue to do the actual interaction with the chip. The | 358 | * in a work queue to do the actual interaction with the chip. The |
359 | * interrupt is then enabled again in the slow handler when the source | 359 | * interrupt is then enabled again in the slow handler when the source |
360 | * has been cleared. | 360 | * has been cleared. |
diff --git a/drivers/input/touchscreen/zylonite-wm97xx.c b/drivers/input/touchscreen/zylonite-wm97xx.c index 048849867643..5b0f15ec874a 100644 --- a/drivers/input/touchscreen/zylonite-wm97xx.c +++ b/drivers/input/touchscreen/zylonite-wm97xx.c | |||
@@ -193,7 +193,7 @@ static int zylonite_wm97xx_probe(struct platform_device *pdev) | |||
193 | gpio_touch_irq = mfp_to_gpio(MFP_PIN_GPIO26); | 193 | gpio_touch_irq = mfp_to_gpio(MFP_PIN_GPIO26); |
194 | 194 | ||
195 | wm->pen_irq = IRQ_GPIO(gpio_touch_irq); | 195 | wm->pen_irq = IRQ_GPIO(gpio_touch_irq); |
196 | set_irq_type(IRQ_GPIO(gpio_touch_irq), IRQ_TYPE_EDGE_BOTH); | 196 | irq_set_irq_type(IRQ_GPIO(gpio_touch_irq), IRQ_TYPE_EDGE_BOTH); |
197 | 197 | ||
198 | wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN, | 198 | wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN, |
199 | WM97XX_GPIO_POL_HIGH, | 199 | WM97XX_GPIO_POL_HIGH, |