diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-05-24 12:30:15 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-05-24 12:30:15 -0400 |
commit | 754451342fc5954061ede74b0a8485ec4a4c6eaa (patch) | |
tree | 82daccba5779de492631c42e47a614bd9d4cddd2 /drivers/input/mouse | |
parent | bf232e460a3530adf17da7d7f1332347b73a3d08 (diff) | |
parent | 771c577c23bac90597c685971d7297ea00f99d11 (diff) |
Merge tag 'v4.17-rc6' into next
Sync up with mainline to bring in Atmel controller changes for Caroline.
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/alps.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index adf7f05c643a..cb5579716dba 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -583,7 +583,7 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse) | |||
583 | 583 | ||
584 | x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f)); | 584 | x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f)); |
585 | y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f)); | 585 | y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f)); |
586 | z = packet[4] & 0x7c; | 586 | z = packet[4] & 0x7f; |
587 | 587 | ||
588 | /* | 588 | /* |
589 | * The x and y values tend to be quite large, and when used | 589 | * The x and y values tend to be quite large, and when used |
@@ -2548,13 +2548,31 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], | |||
2548 | } | 2548 | } |
2549 | 2549 | ||
2550 | static int alps_update_dual_info_ss4_v2(unsigned char otp[][4], | 2550 | static int alps_update_dual_info_ss4_v2(unsigned char otp[][4], |
2551 | struct alps_data *priv) | 2551 | struct alps_data *priv, |
2552 | struct psmouse *psmouse) | ||
2552 | { | 2553 | { |
2553 | bool is_dual = false; | 2554 | bool is_dual = false; |
2555 | int reg_val = 0; | ||
2556 | struct ps2dev *ps2dev = &psmouse->ps2dev; | ||
2554 | 2557 | ||
2555 | if (IS_SS4PLUS_DEV(priv->dev_id)) | 2558 | if (IS_SS4PLUS_DEV(priv->dev_id)) { |
2556 | is_dual = (otp[0][0] >> 4) & 0x01; | 2559 | is_dual = (otp[0][0] >> 4) & 0x01; |
2557 | 2560 | ||
2561 | if (!is_dual) { | ||
2562 | /* For support TrackStick of Thinkpad L/E series */ | ||
2563 | if (alps_exit_command_mode(psmouse) == 0 && | ||
2564 | alps_enter_command_mode(psmouse) == 0) { | ||
2565 | reg_val = alps_command_mode_read_reg(psmouse, | ||
2566 | 0xD7); | ||
2567 | } | ||
2568 | alps_exit_command_mode(psmouse); | ||
2569 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); | ||
2570 | |||
2571 | if (reg_val == 0x0C || reg_val == 0x1D) | ||
2572 | is_dual = true; | ||
2573 | } | ||
2574 | } | ||
2575 | |||
2558 | if (is_dual) | 2576 | if (is_dual) |
2559 | priv->flags |= ALPS_DUALPOINT | | 2577 | priv->flags |= ALPS_DUALPOINT | |
2560 | ALPS_DUALPOINT_WITH_PRESSURE; | 2578 | ALPS_DUALPOINT_WITH_PRESSURE; |
@@ -2577,7 +2595,7 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse, | |||
2577 | 2595 | ||
2578 | alps_update_btn_info_ss4_v2(otp, priv); | 2596 | alps_update_btn_info_ss4_v2(otp, priv); |
2579 | 2597 | ||
2580 | alps_update_dual_info_ss4_v2(otp, priv); | 2598 | alps_update_dual_info_ss4_v2(otp, priv, psmouse); |
2581 | 2599 | ||
2582 | return 0; | 2600 | return 0; |
2583 | } | 2601 | } |