David Brownell | ffa458c | 2006-01-08 13:34:21 -0800 | [diff] [blame] | 1 | /* linux/spi/ads7846.h */ |
| 2 | |
| 3 | /* Touchscreen characteristics vary between boards and models. The |
David Brownell | 2e5a7bd | 2006-01-08 13:34:25 -0800 | [diff] [blame] | 4 | * platform_data for the device's "struct device" holds this information. |
David Brownell | ffa458c | 2006-01-08 13:34:21 -0800 | [diff] [blame] | 5 | * |
| 6 | * It's OK if the min/max values are zero. |
| 7 | */ |
Imre Deak | da970e6 | 2007-01-18 00:44:41 -0500 | [diff] [blame] | 8 | enum ads7846_filter { |
| 9 | ADS7846_FILTER_OK, |
| 10 | ADS7846_FILTER_REPEAT, |
| 11 | ADS7846_FILTER_IGNORE, |
| 12 | }; |
| 13 | |
David Brownell | ffa458c | 2006-01-08 13:34:21 -0800 | [diff] [blame] | 14 | struct ads7846_platform_data { |
| 15 | u16 model; /* 7843, 7845, 7846. */ |
| 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ |
Imre Deak | de2defd | 2007-01-18 00:45:21 -0500 | [diff] [blame] | 17 | int keep_vref_on:1; /* set to keep vref on for differential |
| 18 | * measurements as well */ |
David Brownell | ffa458c | 2006-01-08 13:34:21 -0800 | [diff] [blame] | 19 | u16 x_plate_ohms; |
| 20 | u16 y_plate_ohms; |
| 21 | |
| 22 | u16 x_min, x_max; |
| 23 | u16 y_min, y_max; |
| 24 | u16 pressure_min, pressure_max; |
Imre Deak | 0b7018a | 2006-04-11 23:42:03 -0400 | [diff] [blame] | 25 | |
Imre Deak | d5b415c | 2006-04-26 00:13:18 -0400 | [diff] [blame] | 26 | u16 debounce_max; /* max number of additional readings |
| 27 | * per sample */ |
Imre Deak | 0b7018a | 2006-04-11 23:42:03 -0400 | [diff] [blame] | 28 | u16 debounce_tol; /* tolerance used for filtering */ |
Imre Deak | d5b415c | 2006-04-26 00:13:18 -0400 | [diff] [blame] | 29 | u16 debounce_rep; /* additional consecutive good readings |
| 30 | * required after the first two */ |
Imre Deak | c9e617a | 2006-04-11 23:44:05 -0400 | [diff] [blame] | 31 | int (*get_pendown_state)(void); |
Imre Deak | da970e6 | 2007-01-18 00:44:41 -0500 | [diff] [blame] | 32 | int (*filter_init) (struct ads7846_platform_data *pdata, |
| 33 | void **filter_data); |
| 34 | int (*filter) (void *filter_data, int data_idx, int *val); |
| 35 | void (*filter_cleanup)(void *filter_data); |
David Brownell | ffa458c | 2006-01-08 13:34:21 -0800 | [diff] [blame] | 36 | }; |
| 37 | |