diff options
author | Sergei A. Trusov <sergei.a.trusov@ya.ru> | 2017-09-06 20:29:24 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-09-11 17:23:15 -0400 |
commit | 4a54feea1765a79ac8446bd6f5ce163fc94a8a95 (patch) | |
tree | aec1fa63ef7eef29d50236f5682233925b5bc331 | |
parent | 3e5b08518f6aefad31dca975634c3133457928ff (diff) |
Input: goodix - add support for capacitive home button
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>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/goodix.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 240b16f3ee97..32d2762448aa 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) | |||
267 | if (touch_num < 0) | 267 | if (touch_num < 0) |
268 | return; | 268 | return; |
269 | 269 | ||
270 | /* | ||
271 | * Bit 4 of the first byte reports the status of the capacitive | ||
272 | * Windows/Home button. | ||
273 | */ | ||
274 | input_report_key(ts->input_dev, KEY_LEFTMETA, point_data[0] & BIT(4)); | ||
275 | |||
270 | for (i = 0; i < touch_num; i++) | 276 | for (i = 0; i < touch_num; i++) |
271 | goodix_ts_report_touch(ts, | 277 | goodix_ts_report_touch(ts, |
272 | &point_data[1 + GOODIX_CONTACT_SIZE * i]); | 278 | &point_data[1 + GOODIX_CONTACT_SIZE * i]); |
@@ -612,6 +618,9 @@ static int goodix_request_input_dev(struct goodix_ts_data *ts) | |||
612 | ts->input_dev->id.product = ts->id; | 618 | ts->input_dev->id.product = ts->id; |
613 | ts->input_dev->id.version = ts->version; | 619 | ts->input_dev->id.version = ts->version; |
614 | 620 | ||
621 | /* Capacitive Windows/Home button on some devices */ | ||
622 | input_set_capability(ts->input_dev, EV_KEY, KEY_LEFTMETA); | ||
623 | |||
615 | error = input_register_device(ts->input_dev); | 624 | error = input_register_device(ts->input_dev); |
616 | if (error) { | 625 | if (error) { |
617 | dev_err(&ts->client->dev, | 626 | dev_err(&ts->client->dev, |