]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/input/mouse/psmouse-base.c
Input: psmouse - add psmouse_matches_pnp_id helper function
[mirror_ubuntu-artful-kernel.git] / drivers / input / mouse / psmouse-base.c
index cff065f6261cf31a3188226f14fe28e9291f6770..bc1bc2653f15635bca18d10abb8412594eb492b8 100644 (file)
@@ -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.