ads7846.h 1006 B

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