linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Input: goodix: Add support for capacitive home button
@ 2017-06-20 16:08 Bastien Nocera
  2017-09-06  9:00 ` Bastien Nocera
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien Nocera @ 2017-06-20 16:08 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Sergei A. Trusov

From: "Sergei A. Trusov" <sergei.a.trusov@ya.ru>

On some x86 tablets with a Goodix touchscreen, the Windows logo on the
front is a capacitive home button. Touching this button results in a touch
with bit 4 of the first byte set, while only the lower 4 bits (0-3) are
used to indicate the number of touches.

Report a KEY_LEFTMETA press when this happens.

Note that the hardware might support more than one button, in which
case the "id" byte of coor_data would identify the button in question.
This is not implemented as we don't have access to hardware with
multiple buttons.

Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
Acked-by: Bastien Nocera <hadess@hadess.net>
---

Changes from v2:
 - commit message fixes
 - use BIT(4) instead of 0x10

 drivers/input/touchscreen/goodix.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 240b16f3ee97..903137d9cf7d 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -267,6 +267,12 @@ static void goodix_process_events(struct goodix_ts_data *ts)
 	if (touch_num < 0)
 		return;
 
+	/*
+	 * Bit 4 of the first byte reports the status of the capacitive
+	 * Windows/Home button.
+	 */
+	input_report_key(ts->input_dev, KEY_LEFTMETA, !!(point_data[0] & BIT(4)));
+
 	for (i = 0; i < touch_num; i++)
 		goodix_ts_report_touch(ts,
 				&point_data[1 + GOODIX_CONTACT_SIZE * i]);
@@ -612,6 +618,9 @@ static int goodix_request_input_dev(struct goodix_ts_data *ts)
 	ts->input_dev->id.product = ts->id;
 	ts->input_dev->id.version = ts->version;
 
+	/* Capacitive Windows/Home button on some devices */
+	input_set_capability(ts->input_dev, EV_KEY, KEY_LEFTMETA);
+
 	error = input_register_device(ts->input_dev);
 	if (error) {
 		dev_err(&ts->client->dev,
-- 
2.13.0


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

* Re: [PATCH v3] Input: goodix: Add support for capacitive home button
  2017-06-20 16:08 [PATCH v3] Input: goodix: Add support for capacitive home button Bastien Nocera
@ 2017-09-06  9:00 ` Bastien Nocera
  2017-09-06  9:03   ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien Nocera @ 2017-09-06  9:00 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Sergei A. Trusov

Hey,

On Tue, 2017-06-20 at 18:08 +0200, Bastien Nocera wrote:
> From: "Sergei A. Trusov" <sergei.a.trusov@ya.ru>
> 
> On some x86 tablets with a Goodix touchscreen, the Windows logo on
> the
> front is a capacitive home button. Touching this button results in a
> touch
> with bit 4 of the first byte set, while only the lower 4 bits (0-3)
> are
> used to indicate the number of touches.
> 
> Report a KEY_LEFTMETA press when this happens.
> 
> Note that the hardware might support more than one button, in which
> case the "id" byte of coor_data would identify the button in
> question.
> This is not implemented as we don't have access to hardware with
> multiple buttons.
> 
> Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
> Acked-by: Bastien Nocera <hadess@hadess.net>

Can we please get this merged? I didn't receive any reviews on it, and
it's been sitting there for 2 months...

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

* Re: [PATCH v3] Input: goodix: Add support for capacitive home button
  2017-09-06  9:00 ` Bastien Nocera
@ 2017-09-06  9:03   ` Jiri Kosina
  2017-09-07  0:30     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2017-09-06  9:03 UTC (permalink / raw)
  To: Bastien Nocera
  Cc: linux-input, linux-kernel, Sergei A. Trusov, Dmitry Torokhov

On Wed, 6 Sep 2017, Bastien Nocera wrote:

> Hey,
> 
> On Tue, 2017-06-20 at 18:08 +0200, Bastien Nocera wrote:
> > From: "Sergei A. Trusov" <sergei.a.trusov@ya.ru>
> > 
> > On some x86 tablets with a Goodix touchscreen, the Windows logo on
> > the
> > front is a capacitive home button. Touching this button results in a
> > touch
> > with bit 4 of the first byte set, while only the lower 4 bits (0-3)
> > are
> > used to indicate the number of touches.
> > 
> > Report a KEY_LEFTMETA press when this happens.
> > 
> > Note that the hardware might support more than one button, in which
> > case the "id" byte of coor_data would identify the button in
> > question.
> > This is not implemented as we don't have access to hardware with
> > multiple buttons.
> > 
> > Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
> > Acked-by: Bastien Nocera <hadess@hadess.net>
> 
> Can we please get this merged? I didn't receive any reviews on it, and
> it's been sitting there for 2 months...

Let's CC Dmitry.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH v3] Input: goodix: Add support for capacitive home button
  2017-09-06  9:03   ` Jiri Kosina
@ 2017-09-07  0:30     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2017-09-07  0:30 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Bastien Nocera, linux-input, linux-kernel, Sergei A. Trusov

On Wed, Sep 06, 2017 at 11:03:06AM +0200, Jiri Kosina wrote:
> On Wed, 6 Sep 2017, Bastien Nocera wrote:
> 
> > Hey,
> > 
> > On Tue, 2017-06-20 at 18:08 +0200, Bastien Nocera wrote:
> > > From: "Sergei A. Trusov" <sergei.a.trusov@ya.ru>
> > > 
> > > On some x86 tablets with a Goodix touchscreen, the Windows logo on
> > > the
> > > front is a capacitive home button. Touching this button results in a
> > > touch
> > > with bit 4 of the first byte set, while only the lower 4 bits (0-3)
> > > are
> > > used to indicate the number of touches.
> > > 
> > > Report a KEY_LEFTMETA press when this happens.
> > > 
> > > Note that the hardware might support more than one button, in which
> > > case the "id" byte of coor_data would identify the button in
> > > question.
> > > This is not implemented as we don't have access to hardware with
> > > multiple buttons.
> > > 
> > > Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
> > > Acked-by: Bastien Nocera <hadess@hadess.net>
> > 
> > Can we please get this merged? I didn't receive any reviews on it, and
> > it's been sitting there for 2 months...
> 
> Let's CC Dmitry.

Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2017-09-07  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-20 16:08 [PATCH v3] Input: goodix: Add support for capacitive home button Bastien Nocera
2017-09-06  9:00 ` Bastien Nocera
2017-09-06  9:03   ` Jiri Kosina
2017-09-07  0:30     ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).