diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-31 21:02:39 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-31 21:02:39 -0400 |
| commit | 09d692e6ff50e455f936e7e114e11f6ec5e0ea33 (patch) | |
| tree | f6693dac827dd2afced8285e59bce73d7e04c636 | |
| parent | ce9d8d9f7214c7b74a5dd7be8221545269a31155 (diff) | |
| parent | d745b5326dd1960bf1d9ce2cb8408561a81a7271 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: appletouch - remove extra KERN_DEBUG use from dprintk
Input: bu21013_ts - fix null dereference in error handling
Input: ad7879 - prevent invalid finger data reports
| -rw-r--r-- | drivers/input/mouse/appletouch.c | 2 | ||||
| -rw-r--r-- | drivers/input/touchscreen/ad7879.c | 32 | ||||
| -rw-r--r-- | drivers/input/touchscreen/bu21013_ts.c | 2 |
3 files changed, 29 insertions, 7 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index a9cf76831634..b77f9991278e 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c | |||
| @@ -630,7 +630,7 @@ static void atp_complete_geyser_3_4(struct urb *urb) | |||
| 630 | /* Just update the base values (i.e. touchpad in untouched state) */ | 630 | /* Just update the base values (i.e. touchpad in untouched state) */ |
| 631 | if (dev->data[dev->info->datalen - 1] & ATP_STATUS_BASE_UPDATE) { | 631 | if (dev->data[dev->info->datalen - 1] & ATP_STATUS_BASE_UPDATE) { |
| 632 | 632 | ||
| 633 | dprintk(KERN_DEBUG "appletouch: updated base values\n"); | 633 | dprintk("appletouch: updated base values\n"); |
| 634 | 634 | ||
| 635 | memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); | 635 | memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); |
| 636 | goto exit; | 636 | goto exit; |
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index ba6f0bd1e762..bc3b5187f3a3 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
| @@ -129,6 +129,9 @@ struct ad7879 { | |||
| 129 | u16 cmd_crtl1; | 129 | u16 cmd_crtl1; |
| 130 | u16 cmd_crtl2; | 130 | u16 cmd_crtl2; |
| 131 | u16 cmd_crtl3; | 131 | u16 cmd_crtl3; |
| 132 | int x; | ||
| 133 | int y; | ||
| 134 | int Rt; | ||
| 132 | }; | 135 | }; |
| 133 | 136 | ||
| 134 | static int ad7879_read(struct ad7879 *ts, u8 reg) | 137 | static int ad7879_read(struct ad7879 *ts, u8 reg) |
| @@ -175,13 +178,32 @@ static int ad7879_report(struct ad7879 *ts) | |||
| 175 | Rt /= z1; | 178 | Rt /= z1; |
| 176 | Rt = (Rt + 2047) >> 12; | 179 | Rt = (Rt + 2047) >> 12; |
| 177 | 180 | ||
| 178 | if (!timer_pending(&ts->timer)) | 181 | /* |
| 182 | * Sample found inconsistent, pressure is beyond | ||
| 183 | * the maximum. Don't report it to user space. | ||
| 184 | */ | ||
| 185 | if (Rt > ts->pressure_max) | ||
| 186 | return -EINVAL; | ||
| 187 | |||
| 188 | /* | ||
| 189 | * Note that we delay reporting events by one sample. | ||
| 190 | * This is done to avoid reporting last sample of the | ||
| 191 | * touch sequence, which may be incomplete if finger | ||
| 192 | * leaves the surface before last reading is taken. | ||
| 193 | */ | ||
| 194 | if (timer_pending(&ts->timer)) { | ||
| 195 | /* Touch continues */ | ||
| 179 | input_report_key(input_dev, BTN_TOUCH, 1); | 196 | input_report_key(input_dev, BTN_TOUCH, 1); |
| 197 | input_report_abs(input_dev, ABS_X, ts->x); | ||
| 198 | input_report_abs(input_dev, ABS_Y, ts->y); | ||
| 199 | input_report_abs(input_dev, ABS_PRESSURE, ts->Rt); | ||
| 200 | input_sync(input_dev); | ||
| 201 | } | ||
| 202 | |||
| 203 | ts->x = x; | ||
| 204 | ts->y = y; | ||
| 205 | ts->Rt = Rt; | ||
| 180 | 206 | ||
| 181 | input_report_abs(input_dev, ABS_X, x); | ||
| 182 | input_report_abs(input_dev, ABS_Y, y); | ||
| 183 | input_report_abs(input_dev, ABS_PRESSURE, Rt); | ||
| 184 | input_sync(input_dev); | ||
| 185 | return 0; | 207 | return 0; |
| 186 | } | 208 | } |
| 187 | 209 | ||
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index ccde58602563..2ca9e5d66460 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c | |||
| @@ -514,7 +514,7 @@ err_free_irq: | |||
| 514 | err_cs_disable: | 514 | err_cs_disable: |
| 515 | pdata->cs_dis(pdata->cs_pin); | 515 | pdata->cs_dis(pdata->cs_pin); |
| 516 | err_free_mem: | 516 | err_free_mem: |
| 517 | input_free_device(bu21013_data->in_dev); | 517 | input_free_device(in_dev); |
| 518 | kfree(bu21013_data); | 518 | kfree(bu21013_data); |
| 519 | 519 | ||
| 520 | return error; | 520 | return error; |
