aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2009-03-04 04:12:37 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-03-08 19:35:02 -0400
commit65db86ac07e2f7f91a552490c0be6a99aab8e4a8 (patch)
treee0899a925119a7a603b9f81d01093076c2f18d5a /drivers
parentfa88661224946145819a904cef2ec7dd5c9c78bc (diff)
Input: wm97xx - add BTN_TOUCH event to wm97xx to use it with Android
Android expects BTN_TOUCH events when pen state changes. Add BTN_TOUCH event reporting to allow use of wm97xx touchscreen controller wiht Android devices. 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/wm97xx-core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index d15aa11d7056..cec480bffe38 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -409,6 +409,7 @@ static int wm97xx_read_samples(struct wm97xx *wm)
409 wm->pen_is_down = 0; 409 wm->pen_is_down = 0;
410 dev_dbg(wm->dev, "pen up\n"); 410 dev_dbg(wm->dev, "pen up\n");
411 input_report_abs(wm->input_dev, ABS_PRESSURE, 0); 411 input_report_abs(wm->input_dev, ABS_PRESSURE, 0);
412 input_report_key(wm->input_dev, BTN_TOUCH, 0);
412 input_sync(wm->input_dev); 413 input_sync(wm->input_dev);
413 } else if (!(rc & RC_AGAIN)) { 414 } else if (!(rc & RC_AGAIN)) {
414 /* We need high frequency updates only while 415 /* We need high frequency updates only while
@@ -433,6 +434,7 @@ static int wm97xx_read_samples(struct wm97xx *wm)
433 input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff); 434 input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff);
434 input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff); 435 input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff);
435 input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff); 436 input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff);
437 input_report_key(wm->input_dev, BTN_TOUCH, 1);
436 input_sync(wm->input_dev); 438 input_sync(wm->input_dev);
437 wm->pen_is_down = 1; 439 wm->pen_is_down = 1;
438 wm->ts_reader_interval = wm->ts_reader_min_interval; 440 wm->ts_reader_interval = wm->ts_reader_min_interval;
@@ -628,18 +630,21 @@ static int wm97xx_probe(struct device *dev)
628 wm->input_dev->phys = "wm97xx"; 630 wm->input_dev->phys = "wm97xx";
629 wm->input_dev->open = wm97xx_ts_input_open; 631 wm->input_dev->open = wm97xx_ts_input_open;
630 wm->input_dev->close = wm97xx_ts_input_close; 632 wm->input_dev->close = wm97xx_ts_input_close;
631 set_bit(EV_ABS, wm->input_dev->evbit); 633
632 set_bit(ABS_X, wm->input_dev->absbit); 634 __set_bit(EV_ABS, wm->input_dev->evbit);
633 set_bit(ABS_Y, wm->input_dev->absbit); 635 __set_bit(EV_KEY, wm->input_dev->evbit);
634 set_bit(ABS_PRESSURE, wm->input_dev->absbit); 636 __set_bit(BTN_TOUCH, wm->input_dev->keybit);
637
635 input_set_abs_params(wm->input_dev, ABS_X, abs_x[0], abs_x[1], 638 input_set_abs_params(wm->input_dev, ABS_X, abs_x[0], abs_x[1],
636 abs_x[2], 0); 639 abs_x[2], 0);
637 input_set_abs_params(wm->input_dev, ABS_Y, abs_y[0], abs_y[1], 640 input_set_abs_params(wm->input_dev, ABS_Y, abs_y[0], abs_y[1],
638 abs_y[2], 0); 641 abs_y[2], 0);
639 input_set_abs_params(wm->input_dev, ABS_PRESSURE, abs_p[0], abs_p[1], 642 input_set_abs_params(wm->input_dev, ABS_PRESSURE, abs_p[0], abs_p[1],
640 abs_p[2], 0); 643 abs_p[2], 0);
644
641 input_set_drvdata(wm->input_dev, wm); 645 input_set_drvdata(wm->input_dev, wm);
642 wm->input_dev->dev.parent = dev; 646 wm->input_dev->dev.parent = dev;
647
643 ret = input_register_device(wm->input_dev); 648 ret = input_register_device(wm->input_dev);
644 if (ret < 0) 649 if (ret < 0)
645 goto dev_alloc_err; 650 goto dev_alloc_err;