Update from product codes
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / include / linux / i2c / ist30xxc.h
1 /*
2  *  Copyright (C) 2010, Imagis Technology Co. Ltd. All Rights Reserved.
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
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.
13  *
14  */
15
16 #ifndef __IST30XXC_H__
17 #define __IST30XXC_H__
18
19 #include <linux/input/tsp_ta_callback.h>
20 #ifdef CONFIG_INPUT_BOOSTER
21 #include <linux/input/input_booster.h>
22 #endif
23
24 /*
25  * Support F/W ver : IST30xxC v1.0.0.0
26  * Support IC : IST3026C, IST3032C
27  * Release : 2015.01.05 by Hoony
28  */
29
30 #define USE_TSP_TA_CALLBACKS
31
32 #define IMAGIS_DD_VERSION               ("2.0.0.0")
33
34 #define IMAGIS_IST3026C                 (1) /* 3026C */
35 #define IMAGIS_IST3032C                 (2) /* 3032C */
36 #define IMAGIS_IST3038C                 (3) /* 3038C */
37 #define IMAGIS_IST3044C                 (4) /* 3044C */
38 #define IMAGIS_IST3048C                 (5) /* 3048C */
39
40 #if defined(CONFIG_SEC_NOVEL_PROJECT)
41 #define IMAGIS_TSP_IC                   IMAGIS_IST3026C
42 #else
43 #define IMAGIS_TSP_IC                   IMAGIS_IST3038C
44 #endif
45
46 /* SEC defined [*/
47 #define FIRMWARE_PATH_LENGTH            64
48 #define FIRMWARE_PATH                   "tsp_imagis/"
49 /* SEC defined ] */
50
51 #define TSP_CHIP_VENDOR                 ("IMAGIS")
52
53 #define IMAGIS_PROTOCOL_A               (0xA)
54 #define IMAGIS_PROTOCOL_B               (0xB)
55 #define IMAGIS_PROTOCOL_TYPE            IMAGIS_PROTOCOL_B
56
57 #define IST30XXC_DEFAULT_CHIP_ID        (0x300C)
58 #define IST3048C_DEFAULT_CHIP_ID        (0x3048)
59 #if (IMAGIS_TSP_IC == IMAGIS_IST3026C)
60 #define TSP_CHIP_NAME                   ("IST3026C")
61 #define IST30XX_CHIP_ID                 (0x026C)
62 #define IST30XX_NODE_TOTAL_NUM          (16 * 16)
63 #elif (IMAGIS_TSP_IC == IMAGIS_IST3032C)
64 #define TSP_CHIP_NAME                   ("IST3032C")
65 #define IST30XX_CHIP_ID                 (0x032C)
66 #define IST30XX_NODE_TOTAL_NUM          (16 * 16)
67 #elif (IMAGIS_TSP_IC == IMAGIS_IST3038C)
68 #define TSP_CHIP_NAME                   ("IST3038C")
69 #define IST30XX_CHIP_ID                 (0x038C)
70 #define IST30XX_NODE_TOTAL_NUM          (24 * 24)
71 #elif (IMAGIS_TSP_IC == IMAGIS_IST3044C)
72 #define TSP_CHIP_NAME                   ("IST3044C")
73 #define IST30XX_CHIP_ID                 (0x044C)
74 #define IST30XX_NODE_TOTAL_NUM          (24 * 24)
75 #elif (IMAGIS_TSP_IC == IMAGIS_IST3048C)
76 #define TSP_CHIP_NAME                   ("IST3048C")
77 #define IST30XX_CHIP_ID                 (0x048C)
78 #define IST30XX_NODE_TOTAL_NUM          (24 * 24)
79 #else
80 #define TSP_CHIP_NAME                   ("IST30XXC")
81 #define IST30XX_CHIP_ID                 (0x300C)
82 #define IST30XX_NODE_TOTAL_NUM          (24 * 24)
83 #endif
84
85 /* IST30XX FUNCTION ENABLE & DISABLE */
86 #define IST30XX_INTERNAL_BIN            (1)
87 #define IST30XX_CHECK_CALIB             (0)
88 #if IST30XX_INTERNAL_BIN
89 #if (IMAGIS_TSP_IC < IMAGIS_IST3038C)
90 #if defined(CONFIG_SEC_NOVEL_PROJECT)
91 #define IST30XX_MULTIPLE_TSP            (1)
92 #else
93 #define IST30XX_MULTIPLE_TSP            (0)
94 #endif
95 #endif
96 #define IST30XX_UPDATE_BY_WORKQUEUE     (0)
97 #define IST30XX_UPDATE_DELAY            (3 * HZ)
98 #endif
99
100 #define IST30XX_EVENT_MODE              (1)
101 #if IST30XX_EVENT_MODE
102 #define IST30XX_TRACKING_MODE           (1)
103 #else
104 #define IST30XX_TRACKING_MODE           (0) /* fixed */
105 #endif
106
107 #define IST30XX_TA_RESET                (1)
108 #define IST30XX_USE_KEY                 (0)
109 #define IST30XX_DEBUG                   (1)
110 #define IST30XX_CMCS_TEST               (1)
111 #define IST30XX_CMCS_JIT_TEST           (1)
112 #define IST30XX_GESTURE                 (0)
113 #define IST30XX_SURFACE_TOUCH           (1)
114 #define IST30XX_BLADE_TOUCH             (1)
115 #define IST30XX_STATUS_DEBUG            (0)
116
117 #define SEC_FACTORY_MODE                (1)
118 /* IST30XX FUNCTION ENABLE & DISABLE */
119
120 #define IST30XX_ADDR_LEN                (4)
121 #define IST30XX_DATA_LEN                (4)
122
123 #define IST30XX_MAX_MT_FINGERS          (2)
124 #define IST30XX_MAX_KEYS                (5)
125
126 #if defined(CONFIG_SEC_NOVEL_PROJECT)
127 #define IST30XX_MAX_X                   (480) /* LCD Resolution */
128 #define IST30XX_MAX_Y                   (800) /* LCD Resolution */
129 #else
130 #define IST30XX_MAX_X                   (720) /* LCD Resolution */
131 #define IST30XX_MAX_Y                   (1280) /* LCD Resolution */
132 #endif
133 #define IST30XX_MAX_W                   (15)
134
135 #define IST30XX_EXCEPT_MASK             (0xFFFFFF00)
136 #define IST30XX_EXCEPT_VALUE            (0xE11CE900)
137 #define IST30XX_MAX_EXCEPT_SIZE         (2)
138
139 #define IST30XX_JIG_TOUCH               (0xC0)
140 #define IST30XX_ENABLE                  (1)
141 #define IST30XX_DISABLE                 (0)
142
143 /* retry count */
144 #define IST30XX_MAX_RETRY_CNT           (3)
145
146 /* Local */
147 #define TSP_LOCAL_EU                    (0)
148 #define TSP_LOCAL_EEU                   (1)
149 #define TSP_LOCAL_TD                    (11)
150 #define TSP_LOCAL_CMCC                  (12)
151 #define TSP_LOCAL_CU                    (13)
152 #define TSP_LOCAL_SPRD                  (14)
153 #define TSP_LOCAL_CTC                   (15)
154 #define TSP_LOCAL_INDIA                 (21)
155 #define TSP_LOCAL_SWASIA                (22)
156 #define TSP_LOCAL_NA                    (31)
157 #define TSP_LOCAL_LA                    (32)
158 #define TSP_LOCAL_CODE                  TSP_LOCAL_EU
159
160 /* Factory Test for Reliability Test Group */
161 enum ist30xx_reliability_commands {
162         TEST_RAW_ALL_DATA = 0,
163         TEST_CM_ALL_DATA,
164         TEST_CS_ALL_DATA,
165         TEST_SLOPE0_ALL_DATA,
166         TEST_SLOPE1_ALL_DATA,
167 };
168
169 /* Debug message */
170 #define DEV_ERR                         (1)
171 #define DEV_WARN                        (2)
172 #define DEV_INFO                        (3)
173 #define DEV_NOTI                        (4)
174 #define DEV_DEBUG                       (5)
175 #define DEV_VERB                        (6)
176
177 #define IST30XX_DEBUG_TAG               "[TSP]"
178 #define IST30XX_DEBUG_LEVEL             DEV_NOTI
179
180 #define tsp_err(fmt, ...)               tsp_printk(DEV_ERR, fmt, ## __VA_ARGS__)
181 #define tsp_warn(fmt, ...)              tsp_printk(DEV_WARN, fmt, ## __VA_ARGS__)
182 #define tsp_info(fmt, ...)              tsp_printk(DEV_DEBUG, fmt, ## __VA_ARGS__)
183 #define tsp_noti(fmt, ...)              tsp_printk(DEV_NOTI, fmt, ## __VA_ARGS__)
184 #define tsp_debug(fmt, ...)             tsp_printk(DEV_DEBUG, fmt, ## __VA_ARGS__)
185 #define tsp_verb(fmt, ...)              tsp_printk(DEV_VERB, fmt, ## __VA_ARGS__)
186
187 /* i2c setting */
188 /* I2C Device info */
189 #define IST30XX_DEV_NAME                "IST30XX"
190 #define IST30XX_DEV_ID                  (0xA0 >> 1)
191
192 /* I2C Mode */
193 #define I2C_BURST_MODE                  (1)
194 #define I2C_MONOPOLY_MODE               (0)
195
196 /* I2C transfer msg number */
197 #define WRITE_CMD_MSG_LEN               (1)
198 #define READ_CMD_MSG_LEN                (2)
199
200 /* I2C address/Data length */
201 #define IST30XX_ADDR_LEN                (4) /* bytes */
202 #define IST30XX_DATA_LEN                (4) /* bytes */
203
204 /* I2C transaction size */
205 #define I2C_MAX_WRITE_SIZE              (0x0100) /* bytes */
206 #define I2C_MAX_READ_SIZE               (0x0080) /* bytes */
207
208 /* I2C access mode */
209 #define IST30XX_DIRECT_ACCESS           (1 << 31)
210 #define IST30XX_BURST_ACCESS            (1 << 27)
211 #define IST30XX_HIB_ACCESS              (0x800B << 16)
212 #define IST30XX_DA_ADDR(n)              (n | IST30XX_DIRECT_ACCESS)
213 #define IST30XX_BA_ADDR(n)              (n | IST30XX_BURST_ACCESS)
214 #define IST30XX_HA_ADDR(n)              (n | IST30XX_HIB_ACCESS)
215
216 /* register */
217 /* Info register */
218 #define IST30XX_REG_CHIPID              IST30XX_DA_ADDR(0x40001000)
219 #define IST30XX_REG_TSPTYPE             IST30XX_DA_ADDR(0x40002010)
220 /* SEC defined [ */
221 #define IST30XX_REG_XY_RES              IST30XX_DA_ADDR(0x40)
222 #define IST30XX_REG_XY_SWAP             IST30XX_DA_ADDR(0x5C)
223 /* SEC defined ] */
224
225 /* HIB register */
226 #define IST30XX_HIB_BASE                (0x30000100)
227 #define IST30XX_HIB_TOUCH_STATUS        IST30XX_HA_ADDR(IST30XX_HIB_BASE | 0x00)
228 #define IST30XX_HIB_INTR_MSG            IST30XX_HA_ADDR(IST30XX_HIB_BASE | 0x04)
229 #define IST30XX_HIB_COORD               IST30XX_HA_ADDR(IST30XX_HIB_BASE | 0x08)
230 #define IST30XX_HIB_CMD                 IST30XX_HA_ADDR(IST30XX_HIB_BASE | 0x3C)
231 #define IST30XX_HIB_RW_STATUS           IST30XX_HA_ADDR(IST30XX_HIB_BASE | 0x40)
232
233 /* interrupt macro */
234 #define IST30XX_INTR_STATUS             (0x00000C00)
235 #define CHECK_INTR_STATUS(n)            (((n & IST30XX_INTR_STATUS) == IST30XX_INTR_STATUS) ? 1 : 0)
236 #define PARSE_FINGER_CNT(n)             ((n >> 12) & 0xF)
237 #define PARSE_KEY_CNT(n)                ((n >> 21) & 0x7)
238 /* Finger status: [9:0] */
239 #define PARSE_FINGER_STATUS(n)          (n & 0x3FF)
240 /* Key status: [20:16] */
241 #define PARSE_KEY_STATUS(n)             ((n >> 16) & 0x1F)
242 #define PRESSED_FINGER(s, id)           ((s & (1 << (id - 1))) ? true : false)
243 #define PRESSED_KEY(s, id)              ((s & (1 << (16 + id - 1))) ? true : false)
244
245 #define IST30XX_MAX_CMD_SIZE            (0x20)
246 #define IST30XX_CMD_ADDR(n)             (n * 4)
247 #define IST30XX_CMD_VALUE(n)            (n / 4)
248 enum ist30xx_read_commands {
249         eHCOM_GET_CHIP_ID               = IST30XX_CMD_ADDR(0x00),
250         eHCOM_GET_VER_MAIN              = IST30XX_CMD_ADDR(0x01),
251         eHCOM_GET_VER_FW                = IST30XX_CMD_ADDR(0x02),
252         eHCOM_GET_VER_CORE              = IST30XX_CMD_ADDR(0x03),
253         eHCOM_GET_VER_TEST              = IST30XX_CMD_ADDR(0x04),
254         eHCOM_GET_CRC32                 = IST30XX_CMD_ADDR(0x05),
255         eHCOM_GET_CRC32_ALL             = IST30XX_CMD_ADDR(0x06),
256         eHCOM_GET_CAL_RESULT            = IST30XX_CMD_ADDR(0x07),
257         eHCOM_GET_TSP_VENDOR            = IST30XX_CMD_ADDR(0x08),
258
259         eHCOM_GET_LCD_INFO              = IST30XX_CMD_ADDR(0x10),
260         eHCOM_GET_TSP_INFO              = IST30XX_CMD_ADDR(0x11),
261         eHCOM_GET_KEY_INFO_0            = IST30XX_CMD_ADDR(0x12),
262         eHCOM_GET_KEY_INFO_1            = IST30XX_CMD_ADDR(0x13),
263         eHCOM_GET_KEY_INFO_2            = IST30XX_CMD_ADDR(0x14),
264         eHCOM_GET_SCR_INFO              = IST30XX_CMD_ADDR(0x15),
265         eHCOM_GET_GTX_INFO              = IST30XX_CMD_ADDR(0x16),
266         eHCOM_GET_SWAP_INFO             = IST30XX_CMD_ADDR(0x17),
267         eHCOM_GET_FINGER_INFO           = IST30XX_CMD_ADDR(0x18),
268         eHCOM_GET_BASELINE              = IST30XX_CMD_ADDR(0x19),
269         eHCOM_GET_TOUCH_TH              = IST30XX_CMD_ADDR(0x1A),
270
271         eHCOM_GET_ZVALUE_BASE           = IST30XX_CMD_ADDR(0x1C),
272         eHCOM_GET_CDC_BASE              = IST30XX_CMD_ADDR(0x1D),
273         eHCOM_GET_ALGO_BASE             = IST30XX_CMD_ADDR(0x1E),
274         eHCOM_GET_COM_CHECKSUM          = IST30XX_CMD_ADDR(0x1F),
275 };
276
277 enum ist30xx_write_commands {
278         eHCOM_FW_START                  = 0x01,
279         eHCOM_FW_HOLD                   = 0x02,
280
281         eHCOM_CP_CORRECT_EN             = 0x10,
282         eHCOM_WDT_EN                    = 0x11,
283         eHCOM_GESTURE_EN                = 0x12,
284         eHCOM_SCALE_EN                  = 0x13,
285         eHCOM_NEW_POSITION_DIS          = 0x14,
286         eHCOM_SLEEP_MODE_EN             = 0x15,
287
288         eHCOM_SET_TIME_ACTIVE           = 0x20,
289         eHCOM_SET_TIME_IDLE             = 0x21,
290         eHCOM_SET_MODE_SPECIAL          = 0x22,
291         eHCOM_SET_LOCAL_MODEL           = 0x23,
292
293         eHCOM_RUN_RAMCODE               = 0x30,
294         eHCOM_RUN_CAL_AUTO              = 0x31,
295         eHCOM_RUN_CAL_PARAM             = 0x32,
296
297         eHCOM_SET_JIG_MODE              = 0x80,
298         eHCOM_SET_JIG_SENSITI           = 0x81,
299
300         eHCOM_DEFAULT                   = 0xFF,
301 };
302
303 typedef union {
304         struct {
305                 u32 y:12;
306                 u32 x:12;
307                 u32 area:4;
308                 u32 id:4;
309         } bit_field;
310         u32 full_field;
311 } finger_info;
312
313 struct ist30xx_status {
314         int power;
315         int update;
316         int update_result;
317         int calib;
318         int calib_msg;
319         int cmcs;
320         bool event_mode;
321         bool noise_mode;
322 };
323
324 struct ist30xx_version {
325         u32 main_ver;
326         u32 fw_ver;
327         u32 core_ver;
328         u32 test_ver;
329 };
330
331 struct ist30xx_fw {
332         struct ist30xx_version prev;
333         struct ist30xx_version cur;
334         struct ist30xx_version bin;
335         u32 index;
336         u32 size;
337         u32 chksum;
338         u32 buf_size;
339         u8 *buf;
340 };
341
342 #define IST30XX_TAG_MAGIC               "ISTV2TAG"
343 struct ist30xx_tags {
344         char magic1[8];
345         u32 rom_base;
346         u32 ram_base;
347         u32 reserved0;
348         u32 reserved1;
349
350         u32 fw_addr;
351         u32 fw_size;
352         u32 cfg_addr;
353         u32 cfg_size;
354         u32 sensor_addr;
355         u32 sensor_size;
356         u32 cp_addr;
357         u32 cp_size;
358         u32 flag_addr;
359         u32 flag_size;
360         u32 reserved2;
361         u32 reserved3;
362
363         u32 zvalue_base;
364         u32 algo_base;
365         u32 raw_base;
366         u32 filter_base;
367         u32 reserved4;
368         u32 reserved5;
369
370         u32 chksum;
371         u32 chksum_all;
372         u32 reserved6;
373         u32 reserved7;
374
375         u8 day;
376         u8 month;
377         u16 year;
378         u8 hour;
379         u8 min;
380         u8 sec;
381         u8 reserved8;
382         char magic2[8];
383 };
384
385 struct ist30xx_platform_data {
386         int max_x;
387         int max_y;
388         int max_w;
389         int irq_flag;
390         int avdd_volt;
391         struct regulator *avdd_regulator;
392 };
393
394 struct CH_NUM {
395         u8 tx;
396         u8 rx;
397 };
398
399 struct GTX_INFO {
400         u8 num;
401         u8 ch_num[4];
402 };
403
404 struct TSP_NODE_BUF {
405         u16 raw[IST30XX_NODE_TOTAL_NUM];
406         u16 base[IST30XX_NODE_TOTAL_NUM];
407         u16 filter[IST30XX_NODE_TOTAL_NUM];
408         u16 min_raw;
409         u16 max_raw;
410         u16 min_base;
411         u16 max_base;
412         u16 len;
413 };
414
415 struct TSP_DIRECTION {
416         bool swap_xy;
417         bool flip_x;
418         bool flip_y;
419 };
420
421 typedef struct _TSP_INFO {
422         struct CH_NUM ch_num;
423         struct CH_NUM screen;
424         struct GTX_INFO gtx;
425         struct TSP_DIRECTION dir;
426         struct TSP_NODE_BUF node;
427         int height;
428         int width;
429         int finger_num;
430         u16 baseline;
431 } TSP_INFO;
432
433 typedef struct _TKEY_INFO {
434         int key_num;
435         bool enable;
436         struct CH_NUM ch_num[IST30XX_MAX_KEYS];
437         u16 baseline;
438 } TKEY_INFO;
439
440 #if SEC_FACTORY_MODE
441 #include <linux/i2c/ist30xxc_sec.h>
442 #endif
443
444 #ifdef CONFIG_HAS_EARLYSUSPEND
445 #include <linux/earlysuspend.h>
446 #endif
447
448 #ifdef USE_TSP_TA_CALLBACKS
449 extern struct tsp_callbacks *ist30xxc_charger_callbacks;
450 struct tsp_callbacks {
451         void (*inform_charger)(struct tsp_callbacks *, int);
452 };
453 #endif
454
455 struct ist30xx_dt_data {
456         int irq_gpio;
457         int scl_gpio;
458         int sda_gpio;
459         int touch_en_gpio;
460         int keyled_en_gpio;
461         int bringup;
462         const char *tsp_vdd_name;
463         struct regulator *tsp_power;
464         int fw_bin;
465         int tkey;
466         int octa_hw;
467         int multiple_tsp;
468         const char *ic_version;
469         const char *project_name;
470         const char *extra_string;
471         char fw_path[FIRMWARE_PATH_LENGTH];
472         char cmcs_path[FIRMWARE_PATH_LENGTH];
473 };
474
475 struct ist30xx_data {
476         struct i2c_client *client;
477         struct input_dev *input_dev;
478         struct ist30xx_dt_data *dt_data;
479         struct ist30xx_platform_data *pdata;
480         TSP_INFO tsp_info;
481         TKEY_INFO tkey_info;
482 #ifdef CONFIG_HAS_EARLYSUSPEND
483         struct early_suspend early_suspend;
484 #endif
485         struct ist30xx_status status;
486         struct ist30xx_fw fw;
487         struct ist30xx_tags tags;
488         struct pinctrl *pinctrl;
489 #if SEC_FACTORY_MODE
490         struct sec_factory sec;
491 #endif
492         u32 chip_id;
493         u32 tsp_type;
494         u32 max_fingers;
495         u32 max_keys;
496         u32 t_status;
497         finger_info fingers[IST30XX_MAX_MT_FINGERS];
498         u32 lx[IST30XX_MAX_MT_FINGERS];
499         u32 ly[IST30XX_MAX_MT_FINGERS];
500         bool tsp_touched[IST30XX_MAX_MT_FINGERS];
501         u32 press_cnt[IST30XX_MAX_MT_FINGERS];
502         volatile bool irq_working;
503         u32 irq_enabled;
504         bool initialized;
505         u32 noise_mode;
506         u32 debug_mode;
507         u32 jig_mode;
508         u32 z_values[IST30XX_MAX_MT_FINGERS];
509         int report_rate;
510         int idle_rate;
511 #if IST30XX_GESTURE
512         bool suspend;
513         bool gesture;
514 #endif
515         int touch_pressed_num;
516 #ifdef CONFIG_INPUT_BOOSTER
517         struct input_booster *tsp_booster;
518 #endif
519         int scan_count;
520         int scan_retry;
521         int max_scan_retry;
522         int irq_err_cnt;
523         int max_irq_err_cnt;
524         /* SEC defined [*/
525         u16 max_x;
526         u16 max_y;
527         bool track_enable;
528         bool deep_sleep;
529         u16 press_finger_cnt;
530         /* SEC defined ]*/
531         struct delayed_work     work_reset_check;
532 #if IST30XX_INTERNAL_BIN
533 #if IST30XX_UPDATE_BY_WORKQUEUE
534         struct delayed_work     work_fw_update;
535 #endif
536 #endif
537         bool touch_stopped;
538 #ifdef USE_TSP_TA_CALLBACKS
539         struct tsp_callbacks    callbacks;
540 #endif
541 #ifdef CONFIG_SLEEP_MONITOR
542         u32 release_cnt;
543 #endif
544 };
545
546 extern struct mutex ist30xx_mutex;
547 extern int ist30xx_dbg_level;
548 extern unsigned int system_rev;
549
550 void tsp_printk(int level, const char *fmt, ...);
551 int ist30xx_intr_wait(struct ist30xx_data *data, long ms);
552
553 void ist30xx_enable_irq(struct ist30xx_data *data);
554 void ist30xx_disable_irq(struct ist30xx_data *data);
555 void ist30xx_set_ta_mode(bool charging);
556 void ist30xx_set_edge_mode(int mode);
557 void ist30xx_set_cover_mode(int mode);
558 void ist30xx_start(struct ist30xx_data *data);
559 int ist30xx_get_ver_info(struct ist30xx_data *data);
560
561 int ist30xx_read_reg(struct i2c_client *client, u32 reg, u32 *buf);
562 int ist30xx_read_cmd(struct ist30xx_data *data, u32 cmd, u32 *buf);
563 int ist30xx_write_cmd(struct i2c_client *client, u32 cmd, u32 val);
564 int ist30xx_read_buf(struct i2c_client *client, u32 cmd, u32 *buf, u16 len);
565 int ist30xx_write_buf(struct i2c_client *client, u32 cmd, u32 *buf, u16 len);
566 int ist30xx_burst_read(struct i2c_client *client, u32 addr,
567                 u32 *buf32, u16 len, bool bit_en);
568 int ist30xx_burst_write(struct i2c_client *client, u32 addr,
569                 u32 *buf32, u16 len);
570
571 int ist30xx_cmd_start_scan(struct ist30xx_data *data);
572 int ist30xx_cmd_calibrate(struct i2c_client *client);
573 int ist30xx_cmd_check_calib(struct i2c_client *client);
574 int ist30xx_cmd_update(struct i2c_client *client, int cmd);
575 int ist30xx_cmd_hold(struct ist30xx_data *data, int enable);
576
577 int ist30xx_power_on(struct ist30xx_data *data, bool download);
578 int ist30xx_power_off(struct ist30xx_data *data);
579 int ist30xx_reset(struct ist30xx_data *data, bool download);
580
581 int ist30xx_internal_suspend(struct ist30xx_data *data);
582 int ist30xx_internal_resume(struct ist30xx_data *data);
583
584 int ist30xx_init_system(struct ist30xx_data *data);
585
586 extern struct class *ist30xx_class;
587 #if SEC_FACTORY_MODE
588 extern struct class *sec_class;
589 extern int sec_touch_sysfs(struct ist30xx_data *data);
590 extern int sec_fac_cmd_init(struct ist30xx_data *data);
591 extern void sec_fac_cmd_remove(struct ist30xx_data *data);
592 extern void sec_touch_sysfs_remove(struct ist30xx_data *data);
593
594 #endif
595
596 #endif /* __IST30XXC_H__ */