Commit dae928ec authored by Pali Rohár's avatar Pali Rohár Committed by Dmitry Torokhov

Input: ALPS - detect trackstick presence for v7 protocol

This patch adds detection of trackstick for v7 protocol devices. Code in
this patch is used in official Dell touchpad linux drivers for Dell models:
Dell Latitude E5250/5250, E5450/5450, E5550/5550

Detection code and base reg for alps v3 rushmore and v7 devices is exacly
same.

Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported
that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without
trackstick and kernel reports to userspace also redundant trackstick
device.
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Tested-by: default avatarAlex Hung <alex.hung@canonical.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent fa68e277
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define ALPS_CMD_NIBBLE_10 0x01f2 #define ALPS_CMD_NIBBLE_10 0x01f2
#define ALPS_REG_BASE_RUSHMORE 0xc2c0 #define ALPS_REG_BASE_RUSHMORE 0xc2c0
#define ALPS_REG_BASE_V7 0xc2c0
#define ALPS_REG_BASE_PINNACLE 0x0000 #define ALPS_REG_BASE_PINNACLE 0x0000
static const struct alps_nibble_commands alps_v3_nibble_commands[] = { static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
...@@ -2047,7 +2048,7 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse) ...@@ -2047,7 +2048,7 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
return 0; return 0;
} }
static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base) static int alps_probe_trackstick_v3_v7(struct psmouse *psmouse, int reg_base)
{ {
int ret = -EIO, reg_val; int ret = -EIO, reg_val;
...@@ -2132,7 +2133,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse) ...@@ -2132,7 +2133,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
int reg_val; int reg_val;
unsigned char param[4]; unsigned char param[4];
reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE); reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE);
if (reg_val == -EIO) if (reg_val == -EIO)
goto error; goto error;
...@@ -2625,8 +2626,8 @@ static int alps_set_protocol(struct psmouse *psmouse, ...@@ -2625,8 +2626,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
priv->x_bits = 16; priv->x_bits = 16;
priv->y_bits = 12; priv->y_bits = 12;
if (alps_probe_trackstick_v3(psmouse, if (alps_probe_trackstick_v3_v7(psmouse,
ALPS_REG_BASE_RUSHMORE) < 0) ALPS_REG_BASE_RUSHMORE) < 0)
priv->flags &= ~ALPS_DUALPOINT; priv->flags &= ~ALPS_DUALPOINT;
break; break;
...@@ -2676,6 +2677,9 @@ static int alps_set_protocol(struct psmouse *psmouse, ...@@ -2676,6 +2677,9 @@ static int alps_set_protocol(struct psmouse *psmouse,
if (priv->fw_ver[1] != 0xba) if (priv->fw_ver[1] != 0xba)
priv->flags |= ALPS_BUTTONPAD; priv->flags |= ALPS_BUTTONPAD;
if (alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_V7) < 0)
priv->flags &= ~ALPS_DUALPOINT;
break; break;
case ALPS_PROTO_V8: case ALPS_PROTO_V8:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment