From 65db86ac07e2f7f91a552490c0be6a99aab8e4a8 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Wed, 4 Mar 2009 01:12:37 -0800 Subject: 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 Signed-off-by: Mark Brown Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wm97xx-core.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen/wm97xx-core.c') 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) 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; @@ -628,18 +630,21 @@ static int wm97xx_probe(struct device *dev) wm->input_dev->phys = "wm97xx"; 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(ABS_X, wm->input_dev->absbit); - set_bit(ABS_Y, wm->input_dev->absbit); - set_bit(ABS_PRESSURE, wm->input_dev->absbit); + + __set_bit(EV_ABS, wm->input_dev->evbit); + __set_bit(EV_KEY, wm->input_dev->evbit); + __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], abs_y[2], 0); input_set_abs_params(wm->input_dev, ABS_PRESSURE, abs_p[0], abs_p[1], abs_p[2], 0); + input_set_drvdata(wm->input_dev, wm); wm->input_dev->dev.parent = dev; + ret = input_register_device(wm->input_dev); if (ret < 0) goto dev_alloc_err; -- cgit v1.2.3-59-g8ed1b From 4f295232bef43adf648876a0cd950faa99daa5f1 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 11 Apr 2009 16:50:17 -0700 Subject: Input: wm97xx - don't specify IRQF_SAMPLE_RANDOM The input core will add entropy to the pool so this flag is not needed. Signed-off-by: Mark Brown Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wm97xx-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/input/touchscreen/wm97xx-core.c') diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index cec480bffe38..69af8385ab14 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -370,8 +370,7 @@ static int wm97xx_init_pen_irq(struct wm97xx *wm) * provided. */ BUG_ON(!wm->mach_ops->irq_enable); - if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, - IRQF_SHARED | IRQF_SAMPLE_RANDOM, + if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, IRQF_SHARED, "wm97xx-pen", wm)) { dev_err(wm->dev, "Failed to register pen down interrupt, polling"); -- cgit v1.2.3-59-g8ed1b