pixcir_i2c_ts.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _PIXCIR_I2C_TS_H
  2. #define _PIXCIR_I2C_TS_H
  3. /*
  4. * Register map
  5. */
  6. #define PIXCIR_REG_POWER_MODE 51
  7. #define PIXCIR_REG_INT_MODE 52
  8. /*
  9. * Power modes:
  10. * active: max scan speed
  11. * idle: lower scan speed with automatic transition to active on touch
  12. * halt: datasheet says sleep but this is more like halt as the chip
  13. * clocks are cut and it can only be brought out of this mode
  14. * using the RESET pin.
  15. */
  16. enum pixcir_power_mode {
  17. PIXCIR_POWER_ACTIVE,
  18. PIXCIR_POWER_IDLE,
  19. PIXCIR_POWER_HALT,
  20. };
  21. #define PIXCIR_POWER_MODE_MASK 0x03
  22. #define PIXCIR_POWER_ALLOW_IDLE (1UL << 2)
  23. /*
  24. * Interrupt modes:
  25. * periodical: interrupt is asserted periodicaly
  26. * diff coordinates: interrupt is asserted when coordinates change
  27. * level on touch: interrupt level asserted during touch
  28. * pulse on touch: interrupt pulse asserted druing touch
  29. *
  30. */
  31. enum pixcir_int_mode {
  32. PIXCIR_INT_PERIODICAL,
  33. PIXCIR_INT_DIFF_COORD,
  34. PIXCIR_INT_LEVEL_TOUCH,
  35. PIXCIR_INT_PULSE_TOUCH,
  36. };
  37. #define PIXCIR_INT_MODE_MASK 0x03
  38. #define PIXCIR_INT_ENABLE (1UL << 3)
  39. #define PIXCIR_INT_POL_HIGH (1UL << 2)
  40. /**
  41. * struct pixcir_irc_chip_data - chip related data
  42. * @max_fingers: Max number of fingers reported simultaneously by h/w
  43. * @has_hw_ids: Hardware supports finger tracking IDs
  44. *
  45. */
  46. struct pixcir_i2c_chip_data {
  47. u8 max_fingers;
  48. bool has_hw_ids;
  49. };
  50. struct pixcir_ts_platform_data {
  51. int x_max;
  52. int y_max;
  53. struct pixcir_i2c_chip_data chip;
  54. };
  55. #endif