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
19 #define IOMUX_NAME_SIZE 20
23 XPT2046_FILTER_REPEAT,
24 XPT2046_FILTER_IGNORE,
27 struct xpt2046_platform_data {
28 u16 model; /* 2046. */
29 bool keep_vref_on; /* set to keep vref on for differential
30 * measurements as well */
31 bool swap_xy; /* swap x and y axes */
33 /* If set to non-zero, after samples are taken this delay is applied
34 * and penirq is rechecked, to help avoid false events. This value
35 * is affected by the material used to build the touch layer.
37 u16 penirq_recheck_delay_usecs;
42 u16 debounce_max; /* max number of additional readings
44 u16 debounce_tol; /* tolerance used for filtering */
45 u16 debounce_rep; /* additional consecutive good readings
46 * required after the first two */
47 int gpio_pendown; /* the GPIO used to decide the pendown
48 * state if get_pendown_state == NULL
50 char pendown_iomux_name[IOMUX_NAME_SIZE];
51 int pendown_iomux_mode;
56 int touch_virtualkey_length;
57 int (*get_pendown_state)(void);
58 int (*filter_init) (struct xpt2046_platform_data *pdata,
60 int (*filter) (void *filter_data, int data_idx, int *val);
61 void (*filter_cleanup)(void *filter_data);
62 void (*wait_for_sync)(void);
63 int (* io_init)(void);
64 int (* io_deinit)(void);