2 * drivers/input/touchscreen/xpt2046_ts.h
4 * Copyright (C) 2010 ROCKCHIP, Inc.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef __DRIVERS_TOUCHSCREEN_XPT2046_TS_H
17 #define __DRIVERS_TOUCHSCREEN_XPT2046_TS_H
20 XPT2046_FILTER_REPEAT,
21 XPT2046_FILTER_IGNORE,
24 struct xpt2046_platform_data {
25 u16 model; /* 2046. */
26 bool keep_vref_on; /* set to keep vref on for differential
27 * measurements as well */
28 bool swap_xy; /* swap x and y axes */
30 /* If set to non-zero, after samples are taken this delay is applied
31 * and penirq is rechecked, to help avoid false events. This value
32 * is affected by the material used to build the touch layer.
34 u16 penirq_recheck_delay_usecs;
39 u16 debounce_max; /* max number of additional readings
41 u16 debounce_tol; /* tolerance used for filtering */
42 u16 debounce_rep; /* additional consecutive good readings
43 * required after the first two */
44 int gpio_pendown; /* the GPIO used to decide the pendown
45 * state if get_pendown_state == NULL
47 int (*get_pendown_state)(void);
48 int (*filter_init) (struct xpt2046_platform_data *pdata,
50 int (*filter) (void *filter_data, int data_idx, int *val);
51 void (*filter_cleanup)(void *filter_data);
52 void (*wait_for_sync)(void);