All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] Input: wm97xx: add BTN_TOUCH event to wm97xx to use it with Android
@ 2009-03-02 14:12 Mike Rapoport
  2009-03-02 14:28 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Rapoport @ 2009-03-02 14:12 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: LKML, Mark Brown, linux-input

Android expects BTN_TOUCH events when pen state changes. Add BTN_TOUCH
event reporting to allow use of wm97xx touchscreen controller with
Android devices.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

---
 drivers/input/touchscreen/wm97xx-core.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index d15aa11..4551f88 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)
 			wm->pen_is_down = 0;
 			dev_dbg(wm->dev, "pen up\n");
 			input_report_abs(wm->input_dev, ABS_PRESSURE, 0);
+			input_report_key(wm->input_dev, BTN_TOUCH, 0);
 			input_sync(wm->input_dev);
 		} else if (!(rc & RC_AGAIN)) {
 			/* We need high frequency updates only while
@@ -433,6 +434,7 @@ static int wm97xx_read_samples(struct wm97xx *wm)
 		input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff);
 		input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff);
 		input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff);
+		input_report_key(wm->input_dev, BTN_TOUCH, 1);
 		input_sync(wm->input_dev);
 		wm->pen_is_down = 1;
 		wm->ts_reader_interval = wm->ts_reader_min_interval;
@@ -629,9 +631,11 @@ static int wm97xx_probe(struct device *dev)
 	wm->input_dev->open = wm97xx_ts_input_open;
 	wm->input_dev->close = wm97xx_ts_input_close;
 	set_bit(EV_ABS, wm->input_dev->evbit);
+	set_bit(EV_KEY, wm->input_dev->evbit);
 	set_bit(ABS_X, wm->input_dev->absbit);
 	set_bit(ABS_Y, wm->input_dev->absbit);
 	set_bit(ABS_PRESSURE, wm->input_dev->absbit);
+	set_bit(BTN_TOUCH, wm->input_dev->keybit);
 	input_set_abs_params(wm->input_dev, ABS_X, abs_x[0], abs_x[1],
 			     abs_x[2], 0);
 	input_set_abs_params(wm->input_dev, ABS_Y, abs_y[0], abs_y[1],
-- 
1.5.6.4


-- 
Sincerely yours,
Mike.


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-03  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-02 14:12 [PATCH RESEND] Input: wm97xx: add BTN_TOUCH event to wm97xx to use it with Android Mike Rapoport
2009-03-02 14:28 ` Mark Brown
2009-03-02 16:16   ` Mike Rapoport
2009-03-02 16:21     ` Mark Brown
2009-03-03  8:27       ` [PATCH] Input: add BTN_TOUCH event (Was: [PATCH RESEND] Input: wm97xx: add BTN_TOUCH event to wm97xx) Mike Rapoport
2009-03-03  8:30       ` [PATCH RESEND] Input: wm97xx: add BTN_TOUCH event to wm97xx to use it with Android Mike Rapoport

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.