summaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-11 19:14:09 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-09-13 02:30:44 +0200
commit2c75ada6250990ea859b0b5498cb0b7c2823a9d7 (patch)
treee39a322d8400c85fbebfb658955a240aff4a4049 /drivers/input/mouse/psmouse-base.c
parentInput: joystick - use ktime for measuring timing (diff)
downloadlinux-2c75ada6250990ea859b0b5498cb0b7c2823a9d7.tar.xz
linux-2c75ada6250990ea859b0b5498cb0b7c2823a9d7.zip
Input: psmouse - add psmouse_matches_pnp_id helper function
The matches_pnp_id function from the synaptics driver is useful for other drivers too. Make it a generic psmouse helper function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r--drivers/input/mouse/psmouse-base.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index cff065f6261c..bc1bc2653f15 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -462,6 +462,20 @@ static int psmouse_poll(struct psmouse *psmouse)
PSMOUSE_CMD_POLL | (psmouse->pktsize << 8));
}
+/*
+ * psmouse_matches_pnp_id - check if psmouse matches one of the passed in ids.
+ */
+bool psmouse_matches_pnp_id(struct psmouse *psmouse, const char * const ids[])
+{
+ int i;
+
+ if (!strncmp(psmouse->ps2dev.serio->firmware_id, "PNP:", 4))
+ for (i = 0; ids[i]; i++)
+ if (strstr(psmouse->ps2dev.serio->firmware_id, ids[i]))
+ return true;
+
+ return false;
+}
/*
* Genius NetMouse magic init.