ads7846.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. u16 x_plate_ohms;
  18. u16 y_plate_ohms;
  19. u16 x_min, x_max;
  20. u16 y_min, y_max;
  21. u16 pressure_min, pressure_max;
  22. u16 debounce_max; /* max number of additional readings
  23. * per sample */
  24. u16 debounce_tol; /* tolerance used for filtering */
  25. u16 debounce_rep; /* additional consecutive good readings
  26. * required after the first two */
  27. int (*get_pendown_state)(void);
  28. int (*filter_init) (struct ads7846_platform_data *pdata,
  29. void **filter_data);
  30. int (*filter) (void *filter_data, int data_idx, int *val);
  31. void (*filter_cleanup)(void *filter_data);
  32. };