aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2009-03-04 04:12:49 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-03-08 19:35:17 -0400
commitcd2d64b1a0a12283d63c9d853d5b1403d5cd6c9d (patch)
tree9f8f7cbe3834aeb428b93cf9c5c3fdc2f578b446 /drivers
parenta700e72dd009c79c62e78ebeefa27315db6e1e60 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/mainstone-wm97xx.c1
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
index 08d3dbd4ba29..dfa6a84ab50a 100644
--- a/drivers/input/touchscreen/mainstone-wm97xx.c
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -162,6 +162,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
162 input_report_abs(wm->input_dev, ABS_X, x & 0xfff); 162 input_report_abs(wm->input_dev, ABS_X, x & 0xfff);
163 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff); 163 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff);
164 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff); 164 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff);
165 input_report_key(wm->input_dev, BTN_TOUCH, (p != 0));
165 input_sync(wm->input_dev); 166 input_sync(wm->input_dev);
166 reads++; 167 reads++;
167 } while (reads < cinfo[sp_idx].reads); 168 } while (reads < cinfo[sp_idx].reads);
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 54986627def0..e868264fe799 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -151,12 +151,14 @@ static void ucb1400_ts_evt_add(struct input_dev *idev, u16 pressure, u16 x, u16
151 input_report_abs(idev, ABS_X, x); 151 input_report_abs(idev, ABS_X, x);
152 input_report_abs(idev, ABS_Y, y); 152 input_report_abs(idev, ABS_Y, y);
153 input_report_abs(idev, ABS_PRESSURE, pressure); 153 input_report_abs(idev, ABS_PRESSURE, pressure);
154 input_report_key(idev, BTN_TOUCH, 1);
154 input_sync(idev); 155 input_sync(idev);
155} 156}
156 157
157static void ucb1400_ts_event_release(struct input_dev *idev) 158static void ucb1400_ts_event_release(struct input_dev *idev)
158{ 159{
159 input_report_abs(idev, ABS_PRESSURE, 0); 160 input_report_abs(idev, ABS_PRESSURE, 0);
161 input_report_key(idev, BTN_TOUCH, 0);
160 input_sync(idev); 162 input_sync(idev);
161} 163}
162 164
@@ -377,7 +379,8 @@ static int ucb1400_ts_probe(struct platform_device *dev)
377 ucb->ts_idev->id.product = ucb->id; 379 ucb->ts_idev->id.product = ucb->id;
378 ucb->ts_idev->open = ucb1400_ts_open; 380 ucb->ts_idev->open = ucb1400_ts_open;
379 ucb->ts_idev->close = ucb1400_ts_close; 381 ucb->ts_idev->close = ucb1400_ts_close;
380 ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS); 382 ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
383 ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
381 384
382 ucb1400_adc_enable(ucb->ac97); 385 ucb1400_adc_enable(ucb->ac97);
383 x_res = ucb1400_ts_read_xres(ucb); 386 x_res = ucb1400_ts_read_xres(ucb);