hgpk.h 1.7 KB

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