ads7846.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* linux/spi/ads7846.h */
  2. /* Touchscreen characteristics vary between boards and models. The
  3. * platform_data for the device's "struct device" holds this information.
  4. *
  5. * It's OK if the min/max values are zero.
  6. */
  7. enum ads7846_filter {
  8. ADS7846_FILTER_OK,
  9. ADS7846_FILTER_REPEAT,
  10. ADS7846_FILTER_IGNORE,
  11. };
  12. struct ads7846_platform_data {
  13. u16 model; /* 7843, 7845, 7846. */
  14. u16 vref_delay_usecs; /* 0 for external vref; etc */
  15. int keep_vref_on:1; /* set to keep vref on for differential
  16. * measurements as well */
  17. /* Settling time of the analog signals; a function of Vcc and the
  18. * capacitance on the X/Y drivers. If set to non-zero, two samples
  19. * are taken with settle_delay us apart, and the second one is used.
  20. * ~150 uSec with 0.01uF caps.
  21. */
  22. u16 settle_delay_usecs;
  23. /* If set to non-zero, after samples are taken this delay is applied
  24. * and penirq is rechecked, to help avoid false events. This value
  25. * is affected by the material used to build the touch layer.
  26. */
  27. u16 penirq_recheck_delay_usecs;
  28. u16 x_plate_ohms;
  29. u16 y_plate_ohms;
  30. u16 x_min, x_max;
  31. u16 y_min, y_max;
  32. u16 pressure_min, pressure_max;
  33. u16 debounce_max; /* max number of additional readings
  34. * per sample */
  35. u16 debounce_tol; /* tolerance used for filtering */
  36. u16 debounce_rep; /* additional consecutive good readings
  37. * required after the first two */
  38. int (*get_pendown_state)(void);
  39. int (*filter_init) (struct ads7846_platform_data *pdata,
  40. void **filter_data);
  41. int (*filter) (void *filter_data, int data_idx, int *val);
  42. void (*filter_cleanup)(void *filter_data);
  43. };