diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2016-01-06 18:58:56 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-01-06 19:06:47 -0500 |
commit | 4b1af853646ca893fa686701d1605998fffcc82c (patch) | |
tree | 7b84f9713ec84a39ec91ce61c0dfa003113edf13 /drivers/input | |
parent | dae928ec3c29e7e16723c9c4c1299e00f4e9e949 (diff) |
Input: ALPS - report v3 pinnacle trackstick device only if is present
This patch moves v3 pinnacle code for trackstick detection from
alps_hw_init_v3() to alps_set_protocol() so ALPS_DUALPOINT flag can be
cleared before registering trackstick input device in kernel.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/alps.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 1aa170987028..936f07a4e35f 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -2129,15 +2129,12 @@ error: | |||
2129 | 2129 | ||
2130 | static int alps_hw_init_v3(struct psmouse *psmouse) | 2130 | static int alps_hw_init_v3(struct psmouse *psmouse) |
2131 | { | 2131 | { |
2132 | struct alps_data *priv = psmouse->private; | ||
2132 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 2133 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
2133 | int reg_val; | 2134 | int reg_val; |
2134 | unsigned char param[4]; | 2135 | unsigned char param[4]; |
2135 | 2136 | ||
2136 | reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE); | 2137 | if ((priv->flags & ALPS_DUALPOINT) && |
2137 | if (reg_val == -EIO) | ||
2138 | goto error; | ||
2139 | |||
2140 | if (reg_val == 0 && | ||
2141 | alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO) | 2138 | alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO) |
2142 | goto error; | 2139 | goto error; |
2143 | 2140 | ||
@@ -2614,6 +2611,11 @@ static int alps_set_protocol(struct psmouse *psmouse, | |||
2614 | priv->decode_fields = alps_decode_pinnacle; | 2611 | priv->decode_fields = alps_decode_pinnacle; |
2615 | priv->nibble_commands = alps_v3_nibble_commands; | 2612 | priv->nibble_commands = alps_v3_nibble_commands; |
2616 | priv->addr_command = PSMOUSE_CMD_RESET_WRAP; | 2613 | priv->addr_command = PSMOUSE_CMD_RESET_WRAP; |
2614 | |||
2615 | if (alps_probe_trackstick_v3_v7(psmouse, | ||
2616 | ALPS_REG_BASE_PINNACLE) < 0) | ||
2617 | priv->flags &= ~ALPS_DUALPOINT; | ||
2618 | |||
2617 | break; | 2619 | break; |
2618 | 2620 | ||
2619 | case ALPS_PROTO_V3_RUSHMORE: | 2621 | case ALPS_PROTO_V3_RUSHMORE: |