1 /* drivers/input/touchscreen/gt818_ts.h
3 * Copyright (C) 2011 Rockcip, Inc.
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * Author: hhb@rock-chips.com
18 #ifndef _LINUX_GOODIX_TOUCH_H
19 #define _LINUX_GOODIX_TOUCH_H
21 #include <linux/earlysuspend.h>
22 #include <linux/hrtimer.h>
23 #include <linux/i2c.h>
24 #include <linux/input.h>
27 //*************************TouchScreen Work Part*****************************
28 #define GOODIX_I2C_NAME "gt818_ts"
31 #define GUITAR_UPDATE_STATE 0x02
32 #define GT818_I2C_SCL 400*1000
34 //define resolution of the touchscreen
35 #define TOUCH_MAX_HEIGHT 7168
36 #define TOUCH_MAX_WIDTH 5120
38 //define resolution of the LCD
39 #define SCREEN_MAX_HEIGHT 800
40 #define SCREEN_MAX_WIDTH 480
44 #define SHUTDOWN_PORT pdata->gpio_reset //SHUTDOWN�ܽź�
45 #define INT_PORT pdata->gpio_pendown
48 #define TS_INT gpio_to_irq(INT_PORT) //Interrupt Number
53 #define HAVE_TOUCH_KEY
58 //set GT801 PLUS trigger mode,ֻ������0��1
60 #define POLL_TIME 10 //actual query spacing interval:POLL_TIME+6
62 #define GOODIX_MULTI_TOUCH
63 #ifdef GOODIX_MULTI_TOUCH
64 #define MAX_FINGER_NUM 2
66 #define MAX_FINGER_NUM 1
69 #define READ_TOUCH_ADDR_H 0x07
70 #define READ_TOUCH_ADDR_L 0x12
71 #define READ_KEY_ADDR_H 0x07
72 #define READ_KEY_ADDR_L 0x21
73 #define READ_COOR_ADDR_H 0x07
74 #define READ_COOR_ADDR_L 0x22
75 #define READ_ID_ADDR_H 0x00
76 #define READ_ID_ADDR_L 0xff
79 #define IOMUX_NAME_SIZE 48
80 struct gt818_platform_data {
83 bool swap_xy; /* swap x and y axes */
87 int gpio_reset_active_low;
88 int gpio_pendown; /* the GPIO used to decide the pendown */
90 char pendown_iomux_name[IOMUX_NAME_SIZE];
91 char resetpin_iomux_name[IOMUX_NAME_SIZE];
92 int pendown_iomux_mode;
93 int resetpin_iomux_mode;
95 int (*get_pendown_state)(void);
99 struct gt818_ts_data {
104 struct i2c_client *client;
105 struct input_dev *input_dev;
106 int use_reset; //use RESET flag
107 int use_irq; //use EINT flag
108 int read_mode; //read moudle mode,20110221 by andrew
109 struct hrtimer timer;
110 struct work_struct work;
114 struct early_suspend early_suspend;
115 int (*power)(struct gt818_ts_data * ts, int on);
120 #endif /* _LINUX_GOODIX_TOUCH_H */