Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+30 -8
+1 -1
drivers/input/mouse/appletouch.c
··· 630 630 /* Just update the base values (i.e. touchpad in untouched state) */ 631 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 635 memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); 636 636 goto exit;
+28 -6
drivers/input/touchscreen/ad7879.c
··· 129 129 u16 cmd_crtl1; 130 130 u16 cmd_crtl2; 131 131 u16 cmd_crtl3; 132 + int x; 133 + int y; 134 + int Rt; 132 135 }; 133 136 134 137 static int ad7879_read(struct ad7879 *ts, u8 reg) ··· 178 175 Rt /= z1; 179 176 Rt = (Rt + 2047) >> 12; 180 177 181 - if (!timer_pending(&ts->timer)) 182 - input_report_key(input_dev, BTN_TOUCH, 1); 178 + /* 179 + * Sample found inconsistent, pressure is beyond 180 + * the maximum. Don't report it to user space. 181 + */ 182 + if (Rt > ts->pressure_max) 183 + return -EINVAL; 183 184 184 - input_report_abs(input_dev, ABS_X, x); 185 - input_report_abs(input_dev, ABS_Y, y); 186 - input_report_abs(input_dev, ABS_PRESSURE, Rt); 187 - input_sync(input_dev); 185 + /* 186 + * Note that we delay reporting events by one sample. 187 + * This is done to avoid reporting last sample of the 188 + * touch sequence, which may be incomplete if finger 189 + * leaves the surface before last reading is taken. 190 + */ 191 + if (timer_pending(&ts->timer)) { 192 + /* Touch continues */ 193 + input_report_key(input_dev, BTN_TOUCH, 1); 194 + input_report_abs(input_dev, ABS_X, ts->x); 195 + input_report_abs(input_dev, ABS_Y, ts->y); 196 + input_report_abs(input_dev, ABS_PRESSURE, ts->Rt); 197 + input_sync(input_dev); 198 + } 199 + 200 + ts->x = x; 201 + ts->y = y; 202 + ts->Rt = Rt; 203 + 188 204 return 0; 189 205 } 190 206
+1 -1
drivers/input/touchscreen/bu21013_ts.c
··· 514 514 err_cs_disable: 515 515 pdata->cs_dis(pdata->cs_pin); 516 516 err_free_mem: 517 - input_free_device(bu21013_data->in_dev); 517 + input_free_device(in_dev); 518 518 kfree(bu21013_data); 519 519 520 520 return error;