1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 /* linux/spi/ads7846.h */ 1 /* linux/spi/ads7846.h */ 3 2 >> 3 /* Touchscreen characteristics vary between boards and models. The >> 4 * platform_data for the device's "struct device" holds this information. >> 5 * >> 6 * It's OK if the min/max values are zero. >> 7 */ >> 8 enum ads7846_filter { >> 9 ADS7846_FILTER_OK, >> 10 ADS7846_FILTER_REPEAT, >> 11 ADS7846_FILTER_IGNORE, >> 12 }; >> 13 4 struct ads7846_platform_data { 14 struct ads7846_platform_data { 5 u16 model; /* 784 15 u16 model; /* 7843, 7845, 7846, 7873. */ 6 u16 vref_delay_usecs; /* 0 f 16 u16 vref_delay_usecs; /* 0 for external vref; etc */ 7 u16 vref_mv; /* ext 17 u16 vref_mv; /* external vref value, milliVolts 8 * ads 18 * ads7846: if 0, use internal vref */ 9 bool keep_vref_on; /* set 19 bool keep_vref_on; /* set to keep vref on for differential 10 * mea 20 * measurements as well */ 11 bool swap_xy; /* swa 21 bool swap_xy; /* swap x and y axes */ 12 22 13 /* Settling time of the analog signals 23 /* Settling time of the analog signals; a function of Vcc and the 14 * capacitance on the X/Y drivers. If 24 * capacitance on the X/Y drivers. If set to non-zero, two samples 15 * are taken with settle_delay us apar 25 * are taken with settle_delay us apart, and the second one is used. 16 * ~150 uSec with 0.01uF caps. 26 * ~150 uSec with 0.01uF caps. 17 */ 27 */ 18 u16 settle_delay_usecs; 28 u16 settle_delay_usecs; 19 29 20 /* If set to non-zero, after samples a 30 /* If set to non-zero, after samples are taken this delay is applied 21 * and penirq is rechecked, to help av 31 * and penirq is rechecked, to help avoid false events. This value 22 * is affected by the material used to 32 * is affected by the material used to build the touch layer. 23 */ 33 */ 24 u16 penirq_recheck_delay_usecs; 34 u16 penirq_recheck_delay_usecs; 25 35 26 u16 x_plate_ohms; 36 u16 x_plate_ohms; 27 u16 y_plate_ohms; 37 u16 y_plate_ohms; 28 38 29 u16 x_min, x_max; 39 u16 x_min, x_max; 30 u16 y_min, y_max; 40 u16 y_min, y_max; 31 u16 pressure_min, pressure_max; 41 u16 pressure_min, pressure_max; 32 42 33 u16 debounce_max; /* max 43 u16 debounce_max; /* max number of additional readings 34 * per 44 * per sample */ 35 u16 debounce_tol; /* tol 45 u16 debounce_tol; /* tolerance used for filtering */ 36 u16 debounce_rep; /* add 46 u16 debounce_rep; /* additional consecutive good readings 37 * req 47 * required after the first two */ >> 48 int gpio_pendown; /* the GPIO used to decide the pendown >> 49 * state if get_pendown_state == NULL */ 38 int gpio_pendown_debounce; /* pla 50 int gpio_pendown_debounce; /* platform specific debounce time for 39 * the 51 * the gpio_pendown */ 40 int (*get_pendown_state)(void); 52 int (*get_pendown_state)(void); >> 53 int (*filter_init) (const struct ads7846_platform_data *pdata, >> 54 void **filter_data); >> 55 int (*filter) (void *filter_data, int data_idx, int *val); >> 56 void (*filter_cleanup)(void *filter_data); 41 void (*wait_for_sync)(void); 57 void (*wait_for_sync)(void); 42 bool wakeup; 58 bool wakeup; 43 unsigned long irq_flags; 59 unsigned long irq_flags; 44 }; 60 }; 45 61 46 62
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.