@@ -24,6 +24,7 @@
#include "psmouse.h"
#include "alps.h"
+#include "trackpoint.h"
/*
* Definitions for ALPS version 3 and 4 command mode protocol
@@ -2864,6 +2865,23 @@ static const struct alps_protocol_info *alps_match_table(unsigned char *e7,
return NULL;
}
+static bool alps_is_cs19_trackpoint(struct psmouse *psmouse)
+{
+ u8 param[2] = { 0 };
+
+ if (ps2_command(&psmouse->ps2dev,
+ param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
+ return false;
+
+ if (param[0] == TP_VARIANT_ALPS) {
+ psmouse_warn(psmouse,
+ "It is an ALPS trackpoint-only device (CS19), make sure the MOUSE_PS2_TRACKPOINT is enabled to drive it\n");
+ return true;
+ }
+
+ return false;
+}
+
static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
{
const struct alps_protocol_info *protocol;
@@ -3164,6 +3182,17 @@ int alps_detect(struct psmouse *psmouse, bool set_properties)
if (error)
return error;
+ /*
+ * ALPS cs19 is a trackpoint-only device, it is completely independent
+ * of touchpad. So it is a different device from DualPoint ones, if it
+ * is identified as a cs19 trackpoint device, we return -EINVAL here and
+ * let trackpoint.c to drive this device.
+ * If ps2_command() fails here, we depend on the immediate followed
+ * psmouse_reset() to reset the device to normal state.
+ */
+ if (alps_is_cs19_trackpoint(psmouse))
+ return -EINVAL;
+
/*
* Reset the device to make sure it is fully operational:
* on some laptops, like certain Dell Latitudes, we may