focaltech.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Focaltech TouchPad PS/2 mouse driver
  3. *
  4. * Copyright (c) 2014 Red Hat Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Red Hat authors:
  12. *
  13. * Hans de Goede <hdegoede@redhat.com>
  14. */
  15. /*
  16. * The Focaltech PS/2 touchpad protocol is unknown. This drivers deals with
  17. * detection only, to avoid further detection attempts confusing the touchpad
  18. * this way it at least works in PS/2 mouse compatibility mode.
  19. */
  20. #include <linux/device.h>
  21. #include <linux/libps2.h>
  22. #include "psmouse.h"
  23. static const char * const focaltech_pnp_ids[] = {
  24. "FLT0101",
  25. "FLT0102",
  26. "FLT0103",
  27. NULL
  28. };
  29. int focaltech_detect(struct psmouse *psmouse, bool set_properties)
  30. {
  31. if (!psmouse_matches_pnp_id(psmouse, focaltech_pnp_ids))
  32. return -ENODEV;
  33. if (set_properties) {
  34. psmouse->vendor = "FocalTech";
  35. psmouse->name = "FocalTech Touchpad in mouse emulation mode";
  36. }
  37. return 0;
  38. }
  39. int focaltech_init(struct psmouse *psmouse)
  40. {
  41. ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
  42. psmouse_reset(psmouse);
  43. return 0;
  44. }