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

Input: ucb1400_ts, mainstone-wm97xx - add BTN_TOUCH events

Add BTN_TOUCH event reporting to ucb1400_ts and accelerated mainstone-wm97xx
touchscreen drivers. Together with previously posted similar patch for
wm97xx-core this will make all touchscreen drivers behave consistently wrt.
BTN_TOUCH.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Mike Rapoport and committed by
Dmitry Torokhov
cd2d64b1 a700e72d

+5 -1
+1
drivers/input/touchscreen/mainstone-wm97xx.c
··· 162 162 input_report_abs(wm->input_dev, ABS_X, x & 0xfff); 163 163 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff); 164 164 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff); 165 + input_report_key(wm->input_dev, BTN_TOUCH, (p != 0)); 165 166 input_sync(wm->input_dev); 166 167 reads++; 167 168 } while (reads < cinfo[sp_idx].reads);
+4 -1
drivers/input/touchscreen/ucb1400_ts.c
··· 151 151 input_report_abs(idev, ABS_X, x); 152 152 input_report_abs(idev, ABS_Y, y); 153 153 input_report_abs(idev, ABS_PRESSURE, pressure); 154 + input_report_key(idev, BTN_TOUCH, 1); 154 155 input_sync(idev); 155 156 } 156 157 157 158 static void ucb1400_ts_event_release(struct input_dev *idev) 158 159 { 159 160 input_report_abs(idev, ABS_PRESSURE, 0); 161 + input_report_key(idev, BTN_TOUCH, 0); 160 162 input_sync(idev); 161 163 } 162 164 ··· 379 377 ucb->ts_idev->id.product = ucb->id; 380 378 ucb->ts_idev->open = ucb1400_ts_open; 381 379 ucb->ts_idev->close = ucb1400_ts_close; 382 - ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS); 380 + ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); 381 + ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 383 382 384 383 ucb1400_adc_enable(ucb->ac97); 385 384 x_res = ucb1400_ts_read_xres(ucb);