Skip to content

Commit 1155961

Browse files
tengkt06dtor
authored andcommitted
Input: elantech - correct x, y value range for v2 hardware
x, y values are actually 12-bit long. Also update protocol document to reflect the change. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent b6b1e92 commit 1155961

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎Documentation/input/elantech.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,14 @@ byte 0:
389389
byte 1:
390390

391391
bit 7 6 5 4 3 2 1 0
392-
p7 p6 p5 p4 . x10 x9 x8
392+
p7 p6 p5 p4 x11 x10 x9 x8
393393

394394
byte 2:
395395

396396
bit 7 6 5 4 3 2 1 0
397397
x7 x6 x5 x4 x3 x2 x1 x0
398398

399-
x10..x0 = absolute x value (horizontal)
399+
x11..x0 = absolute x value (horizontal)
400400

401401
byte 3:
402402

@@ -420,7 +420,7 @@ byte 3:
420420
byte 4:
421421

422422
bit 7 6 5 4 3 2 1 0
423-
p3 p1 p2 p0 . . y9 y8
423+
p3 p1 p2 p0 y11 y10 y9 y8
424424

425425
p7..p0 = pressure (not EF113)
426426

@@ -429,7 +429,7 @@ byte 5:
429429
bit 7 6 5 4 3 2 1 0
430430
y7 y6 y5 y4 y3 y2 y1 y0
431431

432-
y9..y0 = absolute y value (vertical)
432+
y11..y0 = absolute y value (vertical)
433433

434434

435435
4.2.2 Two finger touch

‎drivers/input/mouse/elantech.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,15 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
290290
/* pass through... */
291291
case 1:
292292
/*
293-
* byte 1: . . . . . x10 x9 x8
293+
* byte 1: . . . . x11 x10 x9 x8
294294
* byte 2: x7 x6 x5 x4 x4 x2 x1 x0
295295
*/
296-
x1 = ((packet[1] & 0x07) << 8) | packet[2];
296+
x1 = ((packet[1] & 0x0f) << 8) | packet[2];
297297
/*
298-
* byte 4: . . . . . . y9 y8
298+
* byte 4: . . . . y11 y10 y9 y8
299299
* byte 5: y7 y6 y5 y4 y3 y2 y1 y0
300300
*/
301-
y1 = ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]);
301+
y1 = ETP_YMAX_V2 - (((packet[4] & 0x0f) << 8) | packet[5]);
302302

303303
input_report_abs(dev, ABS_X, x1);
304304
input_report_abs(dev, ABS_Y, y1);

0 commit comments

Comments
 (0)