blob: 396d6b50a351730775c76c9c974dcb35cb630e6c [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
30
31struct ts_function_descriptor {
32 u8 query_base;
33 u8 command_base;
34 u8 control_base;
35 u8 data_base;
36 u8 int_source_count;
37 u8 id;
38};
39
40struct finger_data {
41 u8 finger_status_reg[3];
42 u8 finger_reg[MAX_NUM_OF_FINGERS][NUM_OF_EACH_FINGER_DATA_REG];
43};
44
45struct button_data {
46 u16 key_code;
47};
48
49struct cur_touch_data {
50 u8 device_status_reg; /* DEVICE_STATUS_REG */
51 u8 interrupt_status_reg;
52 u8 button_data_reg;
53 struct finger_data finger;
54 struct button_data button;
55};
56
57struct interrupt_bit_mask {
58 u8 flash;
59 u8 status;
60 u8 abs;
61 u8 button;
62};
63
64struct synaptics_ts_data {
65 u8 is_probed;
66 struct regulator *regulator_vdd;
67 struct regulator *regulator_vio;
68 struct i2c_client *client;
69 struct touch_platform_data *pdata;
70 struct ts_function_descriptor common_dsc;
71 struct ts_function_descriptor finger_dsc;
72 struct ts_function_descriptor button_dsc;
73 struct ts_function_descriptor flash_dsc;
74 struct cur_touch_data ts_data;
75 struct touch_fw_info *fw_info;
76 struct interrupt_bit_mask interrupt_mask;
77#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
78 struct ts_function_descriptor analog_dsc;
79#endif
80
81#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
82 u8 ic_panel_type;
83#endif
84};
85
86#if defined(CONFIG_TOUCH_REG_MAP_TM2000) || defined(CONFIG_TOUCH_REG_MAP_TM2372)
87enum {IC7020_GFF, IC7020_G2, IC3203_G2, IC7020_GFF_H_PTN, IC7020_G2_H_PTN};
88#endif
89
90/* extern function */
91extern int FirmwareUpgrade(struct synaptics_ts_data *ts, const char* fw_path);
92#endif