hgpk.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * OLPC HGPK (XO-1) touchpad PS/2 mouse driver
  3. */
  4. #ifndef _HGPK_H
  5. #define _HGPK_H
  6. enum hgpk_model_t {
  7. HGPK_MODEL_PREA = 0x0a, /* pre-B1s */
  8. HGPK_MODEL_A = 0x14, /* found on B1s, PT disabled in hardware */
  9. HGPK_MODEL_B = 0x28, /* B2s, has capacitance issues */
  10. HGPK_MODEL_C = 0x3c,
  11. HGPK_MODEL_D = 0x50, /* C1, mass production */
  12. };
  13. struct hgpk_data {
  14. struct psmouse *psmouse;
  15. int powered;
  16. int count, x_tally, y_tally; /* hardware workaround stuff */
  17. unsigned long recalib_window;
  18. struct delayed_work recalib_wq;
  19. };
  20. #define hgpk_dbg(psmouse, format, arg...) \
  21. dev_dbg(&(psmouse)->ps2dev.serio->dev, format, ## arg)
  22. #define hgpk_err(psmouse, format, arg...) \
  23. dev_err(&(psmouse)->ps2dev.serio->dev, format, ## arg)
  24. #define hgpk_info(psmouse, format, arg...) \
  25. dev_info(&(psmouse)->ps2dev.serio->dev, format, ## arg)
  26. #define hgpk_warn(psmouse, format, arg...) \
  27. dev_warn(&(psmouse)->ps2dev.serio->dev, format, ## arg)
  28. #define hgpk_notice(psmouse, format, arg...) \
  29. dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg)
  30. #ifdef CONFIG_MOUSE_PS2_OLPC
  31. int hgpk_detect(struct psmouse *psmouse, int set_properties);
  32. int hgpk_init(struct psmouse *psmouse);
  33. #else
  34. static inline int hgpk_detect(struct psmouse *psmouse, int set_properties)
  35. {
  36. return -ENODEV;
  37. }
  38. static inline int hgpk_init(struct psmouse *psmouse)
  39. {
  40. return -ENODEV;
  41. }
  42. #endif
  43. #endif