1 #ifndef _LINUX_SPI_TSC2046_H
2 #define _LINUX_SPI_TSC2046_H
4 #include <linux/types.h>
5 #include <linux/timer.h>
7 struct tsc2046_platform_data {
11 u32 ts_max_pressure; /* Samples with bigger pressure value will
12 be ignored, since the corresponding X, Y
13 values are unreliable */
14 u32 ts_touch_pressure;/* Pressure limit until we report a
15 touch event. After that we switch
16 to ts_max_pressure. */
17 unsigned ts_ignore_last : 1;
24 struct spi_device *spi;
27 struct tsc2046_ts *ts;
30 /* The TSC2046 operates at a maximum speed of 2MHz */
31 #define TSC2046_HZ 2000000
33 #define TSC2046_DECL_MOD(module) \
34 extern int tsc2046_##module##_init(struct tsc2046 *tsc, \
35 struct tsc2046_platform_data *pdata); \
36 extern void tsc2046_##module##_exit(struct tsc2046 *tsc); \
37 extern int tsc2046_##module##_suspend(struct tsc2046 *tsc); \
38 extern void tsc2046_##module##_resume(struct tsc2046 *tsc);
40 #define TSC2046_DECL_EMPTY_MOD(module) \
41 static inline int tsc2046_##module##_init(struct tsc2046 *tsc, \
42 struct tsc2046_platform_data *pdata) \
46 static inline void tsc2046_##module##_exit(struct tsc2046 *tsc) {} \
47 static inline int tsc2046_##module##_suspend(struct tsc2046 *tsc) \
51 static inline void tsc2046_##module##_resume(struct tsc2046 *tsc) {}
53 #if defined(CONFIG_TOUCHSCREEN_TSC2046) || \
54 defined(CONFIG_TOUCHSCREEN_TSC2046_MODULE)
57 TSC2046_DECL_EMPTY_MOD(ts)