blob: 15fd281361e24bfce46c66a95385369f6f71f153 [file] [log] [blame]
Jongrak Kwonae680ab2012-06-15 22:06:54 -07001/* include/linux/lge_touch_core.h
2 *
3 * Copyright (C) 2011 LGE.
4 *
5 * Writer: yehan.ahn@lge.com, hyesung.shin@lge.com
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#ifndef LGE_TOUCH_SYNAPTICS_H
19#define LGE_TOUCH_SYNAPTICS_H
20
21#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
22//do nothing
23#else
24#define ARRAYED_TOUCH_FW_BIN
25#endif
26#define NUM_OF_EACH_FINGER_DATA_REG 5
27#define MAX_NUM_OF_FINGERS 10
28
29#define DESCRIPTION_TABLE_START 0xe9
Jongrak Kwon420825a2012-06-26 16:33:25 -070030#define ANALOG_TABLE_START 0xe9
31#define BUTTON_TABLE_START 0xe3
Jongrak Kwonae680ab2012-06-15 22:06:54 -070032
33struct ts_function_descriptor {
34 u8 query_base;
35 u8 command_base;
36 u8 control_base;
37 u8 data_base;
38 u8 int_source_count;
39 u8 id;
40};
41
42struct finger_data {
43 u8 finger_status_reg[3];
44 u8 finger_reg[MAX_NUM_OF_FINGERS][NUM_OF_EACH_FINGER_DATA_REG];
45};
46
47struct button_data {
48 u16 key_code;
49};
50
51struct cur_touch_data {
52 u8 device_status_reg; /* DEVICE_STATUS_REG */
53 u8 interrupt_status_reg;
54 u8 button_data_reg;
55 struct finger_data finger;
56 struct button_data button;
57};
58
59struct interrupt_bit_mask {
60 u8 flash;
61 u8 status;
62 u8 abs;
63 u8 button;
64};
65
66struct synaptics_ts_data {
67 u8 is_probed;
68 struct regulator *regulator_vdd;
69 struct regulator *regulator_vio;
70 struct i2c_client *client;
71 struct touch_platform_data *pdata;
72 struct ts_function_descriptor common_dsc;
73 struct ts_function_descriptor finger_dsc;
74 struct ts_function_descriptor button_dsc;
75 struct ts_function_descriptor flash_dsc;
76 struct cur_touch_data ts_data;
77 struct touch_fw_info *fw_info;
78 struct interrupt_bit_mask interrupt_mask;
79#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
80 struct ts_function_descriptor analog_dsc;
81#endif
82
83#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
84 u8 ic_panel_type;
85#endif
86};
87
88#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
89enum {IC7020_GFF, IC7020_G2, IC3203_G2, IC7020_GFF_H_PTN, IC7020_G2_H_PTN};
90#endif
91
92/* extern function */
93extern int FirmwareUpgrade(struct synaptics_ts_data *ts, const char* fw_path);
94#endif