2 * drivers/input/touchscreen/sitronix_i2c_touch.c
4 * Touchscreen driver for Sitronix (I2C bus)
6 * Copyright (C) 2011 Sitronix Technology Co., Ltd.
7 * Rudy Huang <rudy_huang@sitronix.com.tw>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
16 #include <linux/module.h>
17 #include <linux/delay.h>
18 #ifdef CONFIG_HAS_EARLYSUSPEND
19 #include <linux/earlysuspend.h>
20 #endif // CONFIG_HAS_EARLYSUSPEND
21 #include "sitronix_ts_a720.h"
22 #ifdef SITRONIX_FW_UPGRADE_FEATURE
23 #include <linux/cdev.h>
24 #include <asm/uaccess.h>
25 #endif // SITRONIX_FW_UPGRADE_FEATURE
26 #include <linux/i2c.h>
27 #include <linux/input.h>
28 #include <linux/interrupt.h>
29 #include <linux/slab.h> // to be compatible with linux kernel 3.2.15
30 #include <linux/gpio.h>
31 #include <mach/board.h>
32 #ifdef CONFIG_RK_CONFIG
33 #include <mach/config.h>
35 #include <linux/input/mt.h>
37 #ifdef SITRONIX_MONITOR_THREAD
38 #include <linux/kthread.h>
39 //#include <mach/gpio.h>
40 #endif // SITRONIX_MONITOR_THREAD
42 #define TP_MODULE_NAME SITRONIX_I2C_TOUCH_DRV_NAME
43 #ifdef CONFIG_RK_CONFIG
46 #if defined(RK2926_SDK_DEFAULT_CONFIG)
58 static int en = DEF_EN;
59 module_param(en, int, 0644);
61 static int irq = DEF_IRQ;
62 module_param(irq, int, 0644);
63 static int rst =DEF_RST;
64 module_param(rst, int, 0644);
66 static int i2c = DEF_I2C; // i2c channel
67 module_param(i2c, int, 0644);
68 static int addr = DEF_ADDR; // i2c addr
69 module_param(addr, int, 0644);
70 static int x_max = DEF_X_MAX;
71 module_param(x_max, int, 0644);
72 static int y_max = DEF_Y_MAX;
73 module_param(y_max, int, 0644);
75 static int tp_hw_init(void)
79 ret = gpio_request(get_port_config(irq).gpio, "tp_irq");
81 printk("%s: gpio_request(irq gpio) failed\n", __func__);
85 ret = port_output_init(rst, 1, "tp_rst");
87 printk("%s: port(rst) output init faild\n", __func__);
102 #define DRIVER_AUTHOR "Sitronix, Inc."
103 #define DRIVER_NAME "sitronix"
104 #define DRIVER_DESC "Sitronix I2C touch"
105 #define DRIVER_DATE "20120507"
106 #define DRIVER_MAJOR 2
107 #define DRIVER_MINOR 9
108 #define DRIVER_PATCHLEVEL 1
110 MODULE_AUTHOR("Rudy Huang <rudy_huang@sitronix.com.tw>");
111 MODULE_DESCRIPTION("Sitronix I2C multitouch panels");
112 MODULE_LICENSE("GPL");
114 #ifdef SITRONIX_SENSOR_KEY
115 #define SITRONIX_NUMBER_SENSOR_KEY 3
116 int sitronix_sensor_key[SITRONIX_NUMBER_SENSOR_KEY] = {
118 KEY_HOMEPAGE,//KEY_HOME, // bit 1
121 #endif // SITRONIX_SENSOR_KEY
123 #ifdef SITRONIX_TOUCH_KEY
124 #define SITRONIX_NUMBER_TOUCH_KEY 4
126 #ifdef SITRONIX_KEY_BOUNDARY_MANUAL_SPECIFY
127 #define SITRONIX_TOUCH_RESOLUTION_X 480 /* max of X value in display area */
128 #define SITRONIX_TOUCH_RESOLUTION_Y 854 /* max of Y value in display area */
129 #define SITRONIX_TOUCH_GAP_Y 10 /* Gap between bottom of display and top of touch key */
130 #define SITRONIX_TOUCH_MAX_Y 915 /* resolution of y axis of touch ic */
131 struct sitronix_AA_key sitronix_key_array[SITRONIX_NUMBER_TOUCH_KEY] = {
132 {15, 105, SITRONIX_TOUCH_RESOLUTION_Y + SITRONIX_TOUCH_GAP_Y, SITRONIX_TOUCH_MAX_Y, KEY_MENU}, /* MENU */
133 {135, 225, SITRONIX_TOUCH_RESOLUTION_Y + SITRONIX_TOUCH_GAP_Y, SITRONIX_TOUCH_MAX_Y, KEY_HOME},
134 {255, 345, SITRONIX_TOUCH_RESOLUTION_Y + SITRONIX_TOUCH_GAP_Y, SITRONIX_TOUCH_MAX_Y, KEY_BACK}, /* KEY_EXIT */
135 {375, 465, SITRONIX_TOUCH_RESOLUTION_Y + SITRONIX_TOUCH_GAP_Y, SITRONIX_TOUCH_MAX_Y, KEY_SEARCH},
138 #define SCALE_KEY_HIGH_Y 15
139 struct sitronix_AA_key sitronix_key_array[SITRONIX_NUMBER_TOUCH_KEY] = {
140 {0, 0, 0, 0, KEY_MENU}, /* MENU */
141 {0, 0, 0, 0, KEY_HOME},
142 {0, 0, 0, 0, KEY_BACK}, /* KEY_EXIT */
143 {0, 0, 0, 0, KEY_SEARCH},
146 #endif // SITRONIX_KEY_BOUNDARY_MANUAL_SPECIFY
147 #endif // SITRONIX_TOUCH_KEY
148 struct sitronix_ts_data {
150 struct i2c_client *client;
151 struct input_dev *input_dev;
152 #if defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
153 struct input_dev *keyevent_input;
154 #endif // defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
156 struct hrtimer timer;
157 #ifndef SITRONIX_INT_POLLING_MODE
158 struct work_struct work;
160 struct delayed_work work;
161 #endif // SITRONIX_INT_POLLING_MODE
162 void (*reset_ic)(void);
163 #ifdef CONFIG_HAS_EARLYSUSPEND
164 struct early_suspend early_suspend;
165 #endif // CONFIG_HAS_EARLYSUSPEND
166 uint8_t fw_revision[4];
170 uint8_t touch_protocol_type;
171 uint8_t pixel_length;
176 static unsigned char initkey_code[] =
178 KEY_BACK, KEY_HOMEPAGE, KEY_MENU
181 static int i2cErrorCount = 0;
183 #ifdef SITRONIX_MONITOR_THREAD
184 static struct task_struct * SitronixMonitorThread = NULL;
185 static int gMonitorThreadSleepInterval = 300; // 0.3 sec
186 static atomic_t iMonitorThreadPostpone = ATOMIC_INIT(0);
188 static uint8_t PreCheckData[4] ;
189 static int StatusCheckCount = 0;
190 static int sitronix_ts_monitor_thread(void *data);
191 static int sitronix_ts_delay_monitor_thread_start = DELAY_MONITOR_THREAD_START_PROBE;
192 #endif // SITRONIX_MONITOR_THREAD
194 #ifdef CONFIG_HAS_EARLYSUSPEND
195 static void sitronix_ts_early_suspend(struct early_suspend *h);
196 static void sitronix_ts_late_resume(struct early_suspend *h);
197 #endif // CONFIG_HAS_EARLYSUSPEND
199 static MTD_STRUCTURE sitronix_ts_gMTDPreStructure[SITRONIX_MAX_SUPPORTED_POINT]={{0}};
201 static struct sitronix_ts_data *sitronix_ts_gpts = NULL;
202 static int sitronix_ts_irq_on = 0;
204 #ifdef SITRONIX_FW_UPGRADE_FEATURE
205 int sitronix_release(struct inode *, struct file *);
206 int sitronix_open(struct inode *, struct file *);
207 ssize_t sitronix_write(struct file *file, const char *buf, size_t count, loff_t *ppos);
208 ssize_t sitronix_read(struct file *file, char *buf, size_t count, loff_t *ppos);
209 long sitronix_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
210 static struct cdev sitronix_cdev;
211 static struct class *sitronix_class;
212 static int sitronix_major = 0;
214 int sitronix_open(struct inode *inode, struct file *filp)
218 EXPORT_SYMBOL(sitronix_open);
220 int sitronix_release(struct inode *inode, struct file *filp)
224 EXPORT_SYMBOL(sitronix_release);
226 ssize_t sitronix_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
234 tmp = (char *)kmalloc(count,GFP_KERNEL);
237 if (copy_from_user(tmp,buf,count)) {
241 UpgradeMsg("writing %zu bytes.\n", count);
243 ret = i2c_master_send(sitronix_ts_gpts->client, tmp, count);
247 EXPORT_SYMBOL(sitronix_write);
249 ssize_t sitronix_read(struct file *file, char *buf, size_t count, loff_t *ppos)
257 tmp = (char *)kmalloc(count,GFP_KERNEL);
261 UpgradeMsg("reading %zu bytes.\n", count);
263 ret = i2c_master_recv(sitronix_ts_gpts->client, tmp, count);
265 ret = copy_to_user(buf,tmp,count)?-EFAULT:ret;
269 EXPORT_SYMBOL(sitronix_read);
271 static int sitronix_ts_resume(struct i2c_client *client);
272 static int sitronix_ts_suspend(struct i2c_client *client, pm_message_t mesg);
273 long sitronix_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
279 if (_IOC_TYPE(cmd) != SMT_IOC_MAGIC) return -ENOTTY;
280 if (_IOC_NR(cmd) > SMT_IOC_MAXNR) return -ENOTTY;
281 if (_IOC_DIR(cmd) & _IOC_READ)
282 err = !access_ok(VERIFY_WRITE,(void __user *)arg,\
284 else if (_IOC_DIR(cmd) & _IOC_WRITE)
285 err = !access_ok(VERIFY_READ,(void __user *)arg,\
287 if (err) return -EFAULT;
290 case IOCTL_SMT_GET_DRIVER_REVISION:
291 UpgradeMsg("IOCTL_SMT_GET_DRIVER_REVISION\n");
292 temp[0] = SITRONIX_TOUCH_DRIVER_VERSION;
293 if(copy_to_user((uint8_t __user *)arg, &temp[0], 1)){
294 UpgradeMsg("fail to get driver version\n");
298 case IOCTL_SMT_GET_FW_REVISION:
299 UpgradeMsg("IOCTL_SMT_GET_FW_REVISION\n");
300 if(copy_to_user((uint8_t __user *)arg, &sitronix_ts_gpts->fw_revision[0], 4))
303 case IOCTL_SMT_ENABLE_IRQ:
304 UpgradeMsg("IOCTL_SMT_ENABLE_IRQ\n");
305 if(!sitronix_ts_irq_on){
306 sitronix_ts_irq_on = 1;
307 enable_irq(sitronix_ts_gpts->irq);
308 #ifdef SITRONIX_MONITOR_THREAD
309 atomic_set(&iMonitorThreadPostpone,1);
310 SitronixMonitorThread = kthread_run(sitronix_ts_monitor_thread,"Sitronix","Monitorthread");
311 if(IS_ERR(SitronixMonitorThread))
312 SitronixMonitorThread = NULL;
313 #endif // SITRONIX_MONITOR_THREAD
316 case IOCTL_SMT_DISABLE_IRQ:
317 UpgradeMsg("IOCTL_SMT_DISABLE_IRQ\n");
318 if(sitronix_ts_irq_on){
319 sitronix_ts_irq_on = 0;
320 disable_irq_nosync(sitronix_ts_gpts->irq);
321 #ifdef SITRONIX_MONITOR_THREAD
322 if(SitronixMonitorThread){
323 kthread_stop(SitronixMonitorThread);
324 SitronixMonitorThread = NULL;
326 #endif // SITRONIX_MONITOR_THREAD
329 case IOCTL_SMT_RESUME:
330 UpgradeMsg("IOCTL_SMT_RESUME\n");
331 sitronix_ts_resume(sitronix_ts_gpts->client);
333 case IOCTL_SMT_SUSPEND:
334 UpgradeMsg("IOCTL_SMT_SUSPEND\n");
335 sitronix_ts_suspend(sitronix_ts_gpts->client, PMSG_SUSPEND);
337 case IOCTL_SMT_HW_RESET:
338 UpgradeMsg("IOCTL_SMT_HW_RESET\n");
339 if(sitronix_ts_gpts->reset_ic)
340 sitronix_ts_gpts->reset_ic();
348 EXPORT_SYMBOL(sitronix_ioctl);
349 #endif // SITRONIX_FW_UPGRADE_FEATURE
351 static int sitronix_get_fw_revision(struct sitronix_ts_data *ts)
356 buffer[0] = FIRMWARE_REVISION_3;
357 ret = i2c_master_send(ts->client, buffer, 1);
359 printk("send fw revision command error (%d)\n", ret);
362 ret = i2c_master_recv(ts->client, buffer, 4);
364 printk("read fw revision error (%d)\n", ret);
367 memcpy(ts->fw_revision, buffer, 4);
368 printk("fw revision (hex) = %x %x %x %x\n", buffer[0], buffer[1], buffer[2], buffer[3]);
373 static int sitronix_get_max_touches(struct sitronix_ts_data *ts)
378 buffer[0] = MAX_NUM_TOUCHES;
379 ret = i2c_master_send(ts->client, buffer, 1);
381 printk("send max touches command error (%d)\n", ret);
384 ret = i2c_master_recv(ts->client, buffer, 1);
386 printk("read max touches error (%d)\n", ret);
389 ts->max_touches = buffer[0];
390 printk("max touches = %d \n",ts->max_touches);
395 static int sitronix_get_protocol_type(struct sitronix_ts_data *ts)
400 buffer[0] = I2C_PROTOCOL;
401 ret = i2c_master_send(ts->client, buffer, 1);
403 printk("send i2c protocol command error (%d)\n", ret);
406 ret = i2c_master_recv(ts->client, buffer, 1);
408 printk("read i2c protocol error (%d)\n", ret);
411 ts->touch_protocol_type = buffer[0] & I2C_PROTOCOL_BMSK;
412 if(ts->touch_protocol_type == SITRONIX_A_TYPE)
413 ts->pixel_length = PIXEL_DATA_LENGTH_A;
414 else if(ts->touch_protocol_type == SITRONIX_B_TYPE)
415 ts->pixel_length = PIXEL_DATA_LENGTH_B;
417 ts->pixel_length = PIXEL_DATA_LENGTH_A;
418 printk("i2c protocol = %d \n", ts->touch_protocol_type);
423 static int sitronix_get_resolution(struct sitronix_ts_data *ts)
428 buffer[0] = XY_RESOLUTION_HIGH;
429 ret = i2c_master_send(ts->client, buffer, 1);
431 printk("send resolution command error (%d)\n", ret);
434 ret = i2c_master_recv(ts->client, buffer, 3);
436 printk("read resolution error (%d)\n", ret);
439 ts->resolution_x = ((buffer[0] & (X_RES_H_BMSK << X_RES_H_SHFT)) << 4) | buffer[1];
440 ts->resolution_y = ((buffer[0] & Y_RES_H_BMSK) << 8) | buffer[2];
441 printk("resolution = %d x %d\n", ts->resolution_x, ts->resolution_y);
446 static int sitronix_ts_set_powerdown_bit(struct sitronix_ts_data *ts, int value)
451 DbgMsg("%s, value = %d\n", __FUNCTION__, value);
452 buffer[0] = DEVICE_CONTROL_REG;
453 ret = i2c_master_send(ts->client, buffer, 1);
455 printk("send device control command error (%d)\n", ret);
459 ret = i2c_master_recv(ts->client, buffer, 1);
461 printk("read device control status error (%d)\n", ret);
464 DbgMsg("dev status = %d \n", buffer[0]);
468 buffer[1] = buffer[0] & 0xfd;
470 buffer[1] = buffer[0] | 0x2;
472 buffer[0] = DEVICE_CONTROL_REG;
473 ret = i2c_master_send(ts->client, buffer, 2);
475 printk("write power down error (%d)\n", ret);
482 static int sitronix_ts_get_touch_info(struct sitronix_ts_data *ts)
485 ret = sitronix_get_resolution(ts);
488 ret = sitronix_get_fw_revision(ts);
491 if((ts->fw_revision[0] == 0) && (ts->fw_revision[1] == 0)){
492 ts->touch_protocol_type = SITRONIX_B_TYPE;
493 ts->pixel_length = PIXEL_DATA_LENGTH_B;
495 printk("i2c protocol = %d \n", ts->touch_protocol_type);
496 printk("max touches = %d \n",ts->max_touches);
498 ret = sitronix_get_protocol_type(ts);
501 if(ts->touch_protocol_type == SITRONIX_B_TYPE){
503 printk("max touches = %d \n",ts->max_touches);
505 ret = sitronix_get_max_touches(ts);
513 static int sitronix_ts_get_device_status(struct sitronix_ts_data *ts, uint8_t *dev_status)
518 DbgMsg("%s\n", __FUNCTION__);
519 buffer[0] = STATUS_REG;
520 ret = i2c_master_send(ts->client, buffer, 1);
522 printk("send status reg command error (%d)\n", ret);
526 ret = i2c_master_recv(ts->client, buffer, 8);
528 printk("read status reg error (%d)\n", ret);
531 DbgMsg("status reg = %d \n", buffer[0]);
534 *dev_status = buffer[0] & 0xf;
539 static int sitronix_ts_Enhance_Function_control(struct sitronix_ts_data *ts, uint8_t *value)
544 DbgMsg("%s\n", __FUNCTION__);
546 ret = i2c_master_send(ts->client, buffer, 1);
548 printk("send Enhance Function command error (%d)\n", ret);
552 ret = i2c_master_recv(ts->client, buffer, 1);
554 printk("read Enhance Functions status error (%d)\n", ret);
557 DbgMsg("Enhance Functions status = %d \n", buffer[0]);
560 *value = buffer[0] & 0x4;
565 static int sitronix_ts_FW_Bank_Select(struct sitronix_ts_data *ts, uint8_t value)
570 DbgMsg("%s\n", __FUNCTION__);
572 ret = i2c_master_send(ts->client, buffer, 1);
574 printk("send FW Bank Select command error (%d)\n", ret);
578 ret = i2c_master_recv(ts->client, buffer, 1);
580 printk("read FW Bank Select status error (%d)\n", ret);
583 DbgMsg("FW Bank Select status = %d \n", buffer[0]);
586 buffer[1] = ((buffer[0] & 0xfc) | value);
588 ret = i2c_master_send(ts->client, buffer, 2);
590 printk("send FW Bank Select command error (%d)\n", ret);
597 static int sitronix_get_id_info(struct sitronix_ts_data *ts, uint8_t *id_info)
603 ret = i2c_master_send(ts->client, buffer, 1);
605 printk("send id info command error (%d)\n", ret);
608 ret = i2c_master_recv(ts->client, buffer, 4);
610 printk("read id info error (%d)\n", ret);
613 memcpy(id_info, buffer, 4);
618 static int sitronix_ts_identify(struct sitronix_ts_data *ts)
622 uint8_t Enhance_Function = 0;
624 ret = sitronix_ts_FW_Bank_Select(ts, 1);
627 ret = sitronix_ts_Enhance_Function_control(ts, &Enhance_Function);
630 if(Enhance_Function == 0x4){
631 ret = sitronix_get_id_info(ts, &id[0]);
634 printk("id (hex) = %x %x %x %x\n", id[0], id[1], id[2], id[3]);
635 if((id[0] == 1)&&(id[1] == 2)&&(id[2] == 0xb)&&(id[3] == 1)){
638 printk("Error: It is not Sitronix IC\n");
642 printk("Error: Can not get ID of Sitronix IC\n");
647 #ifdef SITRONIX_MONITOR_THREAD
648 static int sitronix_ts_monitor_thread(void *data)
654 DbgMsg("%s:\n", __FUNCTION__);
656 printk("delay %d ms\n", sitronix_ts_delay_monitor_thread_start);
657 msleep(sitronix_ts_delay_monitor_thread_start);
658 while(!kthread_should_stop()){
659 DbgMsg("%s:\n", "Sitronix_ts_monitoring");
660 if(atomic_read(&iMonitorThreadPostpone)){
661 atomic_set(&iMonitorThreadPostpone,0);
664 buffer[0] = DEVICE_CONTROL_REG;
665 ret = i2c_master_send(sitronix_ts_gpts->client, buffer, 1);
667 DbgMsg("send device control command error (%d)\n", ret);
668 goto exit_i2c_invalid;
670 ret = i2c_master_recv(sitronix_ts_gpts->client, buffer, 1);
672 DbgMsg("read device control status error (%d)\n", ret);
673 goto exit_i2c_invalid;
675 DbgMsg("read DEVICE_CONTROL_REG status = %d \n", buffer[0]);
678 ret = i2c_master_send(sitronix_ts_gpts->client, buffer, 1);
680 DbgMsg("write power down error (%d)\n", ret);
681 goto exit_i2c_invalid;
686 ret = i2c_master_send(sitronix_ts_gpts->client, buffer, 1);
688 DbgMsg("send device control command error (%d)\n", ret);
689 goto exit_i2c_invalid;
691 ret = i2c_master_recv(sitronix_ts_gpts->client, buffer, 4);
693 DbgMsg("read device 1D data error (%d)\n", ret);
694 goto exit_i2c_invalid;
696 DbgMsg("1D data h40-43 = %d, %d, %d, %d \n", buffer[0], buffer[1], buffer[2], buffer[3]);
698 if ((PreCheckData[0] == buffer[0]) && (PreCheckData[1] == buffer[1]) &&
699 (PreCheckData[2] == buffer[2]) && (PreCheckData[3] == buffer[3]))
703 PreCheckData[0] = buffer[0];
704 PreCheckData[1] = buffer[1];
705 PreCheckData[2] = buffer[2];
706 PreCheckData[3] = buffer[3];
707 if (3 <= StatusCheckCount){
708 DbgMsg("IC Status doesn't update! \n");
710 StatusCheckCount = 0;
714 printk("Chip abnormal, reset it!\n");
715 if(sitronix_ts_gpts->reset_ic)
716 sitronix_ts_gpts->reset_ic();
718 StatusCheckCount = 0;
723 if ((2 <= i2cErrorCount)){
724 printk("I2C abnormal, reset it!\n");
725 if(sitronix_ts_gpts->reset_ic)
726 sitronix_ts_gpts->reset_ic();
728 StatusCheckCount = 0;
733 msleep(gMonitorThreadSleepInterval);
735 DbgMsg("%s exit\n", __FUNCTION__);
738 #endif // SITRONIX_MONITOR_THREAD
740 static void sitronix_ts_work_func(struct work_struct *work)
743 #ifdef SITRONIX_TOUCH_KEY
745 #endif // SITRONIX_TOUCH_KEY
747 #ifndef SITRONIX_INT_POLLING_MODE
748 struct sitronix_ts_data *ts = container_of(work, struct sitronix_ts_data, work);
750 struct sitronix_ts_data *ts = container_of(to_delayed_work(work), struct sitronix_ts_data, work);
751 #endif // SITRONIX_INT_POLLING_MODE
752 uint8_t buffer[2+ SITRONIX_MAX_SUPPORTED_POINT * PIXEL_DATA_LENGTH_A];
753 static MTD_STRUCTURE MTDStructure[SITRONIX_MAX_SUPPORTED_POINT]={{0}};
754 uint8_t PixelCount = 0;
755 static uint8_t all_clear = 1;
757 struct ft5x0x_platform_data *pdata=ts->client->dev.platform_data;
759 DbgMsg("%s\n", __FUNCTION__);
760 if(ts->suspend_state){
761 goto exit_invalid_data;
766 ret = i2c_master_send(ts->client, buffer, 1);
768 printk("send finger command error (%d)\n", ret);
769 ret = i2c_master_recv(ts->client, buffer, 2 + ts->max_touches * ts->pixel_length);
771 printk("read finger error (%d)\n", ret);
773 goto exit_invalid_data;
776 #ifdef SITRONIX_FINGER_COUNT_REG_ENABLE
777 PixelCount = buffer[0] & FINGERS_BMSK ;
779 for(i = 0; i < ts->max_touches; i++){
780 if(buffer[2 + i * ts->pixel_length] >= 0x80)
783 #endif // SITRONIX_FINGER_COUNT_REG_ENABLE
784 DbgMsg("fingers = %d\n", PixelCount);
786 DbgMsg("key buffer[1] = %d\n", buffer[1]);
787 #ifdef SITRONIX_SENSOR_KEY
790 for(i = 0; i < SITRONIX_NUMBER_SENSOR_KEY; i++){
791 if(buffer[1] & (1 << i)){
792 DbgMsg("key[%d] down\n", i);
793 input_event(ts->input_dev, EV_KEY, sitronix_sensor_key[i], 1);
795 DbgMsg("key[%d] up\n", i);
796 input_event(ts->input_dev, EV_KEY, sitronix_sensor_key[i], 0);
800 #endif // SITRONIX_SENSOR_KEY
802 for(i = 0; i < ts->max_touches; i++){
803 #ifndef SITRONIX_TOUCH_KEY
804 if((buffer[2 + ts->pixel_length * i] >> X_COORD_VALID_SHFT) == 1){
805 MTDStructure[i].Pixel_X = ((buffer[2 + ts->pixel_length * i] & (X_COORD_H_BMSK << X_COORD_H_SHFT)) << 4) | (buffer[2 + ts->pixel_length * i + X_COORD_L]);
806 MTDStructure[i].Pixel_Y = ((buffer[2 + ts->pixel_length * i] & Y_COORD_H_BMSK) << 8) | (buffer[2 + ts->pixel_length * i + Y_COORD_L]);
807 MTDStructure[i].Current_Pressed_area = AREA_DISPLAY;
809 MTDStructure[i].Current_Pressed_area = AREA_NONE;
810 #endif // SITRONIX_TOUCH_KEY
815 for(i = 0; i < ts->max_touches; i++)
817 #ifndef SITRONIX_TOUCH_KEY
818 if(MTDStructure[i].Current_Pressed_area == AREA_DISPLAY)
820 tmp = MTDStructure[i].Pixel_X;
821 MTDStructure[i].Pixel_X = MTDStructure[i].Pixel_Y;
822 MTDStructure[i].Pixel_Y = tmp;
824 MTDStructure[i].Pixel_X = MTDStructure[i].Pixel_X < 50 ? 3 + MTDStructure[i].Pixel_X : MTDStructure[i].Pixel_X*97/100;
825 MTDStructure[i].Pixel_Y = MTDStructure[i].Pixel_Y < 50 ? 3 + MTDStructure[i].Pixel_Y : MTDStructure[i].Pixel_Y*98/100;
826 input_mt_slot(ts->input_dev, i);
827 input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, i);
828 input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 200);
830 #ifdef CONFIG_RK_CONFIG
831 input_report_abs(ts->input_dev, ABS_MT_POSITION_X, MTDStructure[i].Pixel_X);
832 input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, MTDStructure[i].Pixel_Y);
834 if( pdata && (pdata->direction_otation) )
836 int temp_x , temp_y ;
837 temp_x = MTDStructure[i].Pixel_X ;
838 temp_y = MTDStructure[i].Pixel_Y ;
839 pdata->direction_otation(&temp_x,&temp_y);
840 input_report_abs(ts->input_dev, ABS_MT_POSITION_X, temp_x);
841 input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, temp_y);
843 input_report_abs(ts->input_dev, ABS_MT_POSITION_X, MTDStructure[i].Pixel_X);
844 input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, MTDStructure[i].Pixel_Y);
847 input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 100);
848 DbgMsg("lr[%d](%d, %d)+\n", i, MTDStructure[i].Pixel_X, MTDStructure[i].Pixel_Y);
849 }else if(MTDStructure[i].Current_Pressed_area == AREA_NONE){
850 DbgMsg("lr[%d](%d, %d)-\n", i, MTDStructure[i].Pixel_X, MTDStructure[i].Pixel_Y);
851 input_mt_slot(ts->input_dev, i);
852 input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, -1);
854 memcpy(&sitronix_ts_gMTDPreStructure[i], &MTDStructure[i], sizeof(MTD_STRUCTURE));
855 #endif // SITRONIX_TOUCH_KEY
858 #ifdef SITRONIX_INT_POLLING_MODE
859 #ifdef SITRONIX_MONITOR_THREAD
860 atomic_set(&iMonitorThreadPostpone,1);
861 #endif // SITRONIX_MONITOR_THREAD
862 schedule_delayed_work(&ts->work, msecs_to_jiffies(INT_POLLING_MODE_INTERVAL));
863 #endif // SITRONIX_INT_POLLING_MODE
869 DbgMsg("lr: all_clear\n");
870 for(i = 0; i < ts->max_touches; i++)
872 input_mt_slot(ts->input_dev, i);
873 input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, -1);
879 DbgMsg("ignore dummy finger leave\n");
881 #ifdef SITRONIX_INT_POLLING_MODE
883 sitronix_ts_irq_on = 1;
886 #endif // SITRONIX_INT_POLLING_MODE
888 input_sync(ts->input_dev);
891 #if defined(SITRONIX_LEVEL_TRIGGERED)
893 sitronix_ts_irq_on = 1;
896 #endif // defined(SITRONIX_LEVEL_TRIGGERED)
897 if ((2 <= i2cErrorCount)){
898 printk("I2C abnormal in work_func(), reset it!\n");
899 if(sitronix_ts_gpts->reset_ic)
900 sitronix_ts_gpts->reset_ic();
902 #ifdef SITRONIX_MONITOR_THREAD
903 StatusCheckCount = 0;
904 #endif // SITRONIX_MONITOR_THREAD
909 static irqreturn_t sitronix_ts_irq_handler(int irq, void *dev_id)
911 struct sitronix_ts_data *ts = dev_id;
913 // DbgMsg("%s\n", __FUNCTION__);
914 // printk("lr:%s\n", __FUNCTION__);
915 #if defined(SITRONIX_LEVEL_TRIGGERED) || defined(SITRONIX_INT_POLLING_MODE)
916 sitronix_ts_irq_on = 0;
917 disable_irq_nosync(ts->irq);
918 #endif // defined(SITRONIX_LEVEL_TRIGGERED) || defined(SITRONIX_INT_POLLING_MODE)
919 #ifdef SITRONIX_MONITOR_THREAD
920 atomic_set(&iMonitorThreadPostpone,1);
921 #endif // SITRONIX_MONITOR_THREAD
922 #ifndef SITRONIX_INT_POLLING_MODE
923 schedule_work(&ts->work);
925 schedule_delayed_work(&ts->work, msecs_to_jiffies(0));
926 #endif // SITRONIX_INT_POLLING_MODE
930 static int sitronix_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
932 #if defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
934 #endif // defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
935 struct sitronix_ts_data *ts;
937 uint16_t max_x = 0, max_y = 0;
938 struct ft5x0x_platform_data *pdata;
939 uint8_t dev_status = 0;
941 #ifdef CONFIG_RK_CONFIG
942 struct port_config irq_cfg = get_port_config(irq);
944 client->irq = irq_cfg.gpio;
947 pdata = client->dev.platform_data;
948 if(pdata->init_platform_hw)
949 pdata->init_platform_hw();
951 printk("lr------> %s start ------\n", __FUNCTION__);
952 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
954 goto err_check_functionality_failed;
957 ts = kzalloc(sizeof(*ts), GFP_KERNEL);
960 goto err_alloc_data_failed;
962 #ifndef SITRONIX_INT_POLLING_MODE
963 INIT_WORK(&ts->work, sitronix_ts_work_func);
965 INIT_DELAYED_WORK(&ts->work, sitronix_ts_work_func);
966 #endif // SITRONIX_INT_POLLING_MODE
968 if(client->irq != INVALID_GPIO)
969 ts->irq = gpio_to_irq(client->irq);
970 i2c_set_clientdata(client, ts);
973 ts->reset_ic = pdata->reset_ic;
975 mdelay(SITRONIX_TS_CHANGE_MODE_DELAY);
979 sitronix_ts_gpts = ts;
981 ret = sitronix_ts_get_device_status(ts, &dev_status);
982 if((ret < 0) || (dev_status == 0x6))
983 goto err_device_info_error;
985 ret = sitronix_ts_get_touch_info(ts);
987 goto err_device_info_error;
989 //ret = sitronix_ts_identify(ts);
991 // goto err_device_info_error;
993 #ifdef SITRONIX_MONITOR_THREAD
994 //== Add thread to monitor chip
995 atomic_set(&iMonitorThreadPostpone,1);
996 SitronixMonitorThread = kthread_run(sitronix_ts_monitor_thread,"Sitronix","Monitorthread");
997 if(IS_ERR(SitronixMonitorThread))
998 SitronixMonitorThread = NULL;
999 #endif // SITRONIX_MONITOR_THREAD
1001 ts->input_dev = input_allocate_device();
1002 if (ts->input_dev == NULL){
1003 printk("Can not allocate memory for input device.");
1005 goto err_input_dev_alloc_failed;
1008 ts->input_dev->name = "sitronix-i2c-touch-mt";
1009 //set_bit(EV_KEY, ts->input_dev->evbit);
1010 //set_bit(BTN_TOUCH, ts->input_dev->keybit);
1011 //set_bit(EV_ABS, ts->input_dev->evbit);
1013 #if defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1014 ts->keyevent_input = input_allocate_device();
1015 if (ts->keyevent_input == NULL){
1016 printk("Can not allocate memory for key input device.");
1018 goto err_input_dev_alloc_failed;
1020 ts->keyevent_input->name = "sitronix-i2c-touch-key";
1021 //set_bit(EV_KEY, ts->keyevent_input->evbit);
1022 #endif // defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1023 #if defined(SITRONIX_SENSOR_KEY)
1024 for(i = 0; i < SITRONIX_NUMBER_SENSOR_KEY; i++){
1025 //set_bit(sitronix_sensor_key[i], ts->keyevent_input->keybit);
1027 #endif // defined(SITRONIX_SENSOR_KEY)
1029 #ifndef SITRONIX_TOUCH_KEY
1030 max_x = ts->resolution_x;
1031 max_y = ts->resolution_y;
1033 #ifdef SITRONIX_KEY_BOUNDARY_MANUAL_SPECIFY
1034 for(i = 0; i < SITRONIX_NUMBER_TOUCH_KEY; i++){
1035 //set_bit(sitronix_key_array[i].code, ts->keyevent_input->keybit);
1037 max_x = SITRONIX_TOUCH_RESOLUTION_X;
1038 max_y = SITRONIX_TOUCH_RESOLUTION_Y;
1040 for(i = 0; i < SITRONIX_NUMBER_TOUCH_KEY; i++){
1041 sitronix_key_array[i].x_low = ((ts->resolution_x / SITRONIX_NUMBER_TOUCH_KEY ) * i ) + 15;
1042 sitronix_key_array[i].x_high = ((ts->resolution_x / SITRONIX_NUMBER_TOUCH_KEY ) * (i + 1)) - 15;
1043 sitronix_key_array[i].y_low = ts->resolution_y - ts->resolution_y / SCALE_KEY_HIGH_Y;
1044 sitronix_key_array[i].y_high = ts->resolution_y;
1045 DbgMsg("key[%d] %d, %d, %d, %d\n", i, sitronix_key_array[i].x_low, sitronix_key_array[i].x_high, sitronix_key_array[i].y_low, sitronix_key_array[i].y_high);
1046 //set_bit(sitronix_key_array[i].code, ts->keyevent_input->keybit);
1049 max_x = ts->resolution_x;
1050 max_y = ts->resolution_y - ts->resolution_y / SCALE_KEY_HIGH_Y;
1051 #endif // SITRONIX_KEY_BOUNDARY_MANUAL_SPECIFY
1052 #endif // SITRONIX_TOUCH_KEY
1053 #if defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1054 ret = input_register_device(ts->keyevent_input);
1056 printk("Can not register key input device.");
1057 goto err_input_register_device_failed;
1059 #endif // defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1061 __set_bit(EV_ABS, ts->input_dev->evbit);
1062 __set_bit(INPUT_PROP_DIRECT, ts->input_dev->propbit);
1063 set_bit(ABS_MT_POSITION_X, ts->input_dev->absbit);
1064 set_bit(ABS_MT_POSITION_Y, ts->input_dev->absbit);
1065 set_bit(ABS_MT_TOUCH_MAJOR, ts->input_dev->absbit);
1066 set_bit(ABS_MT_WIDTH_MAJOR, ts->input_dev->absbit);
1067 ts->max_touches = 5;
1069 input_mt_init_slots(ts->input_dev, ts->max_touches);
1070 #ifdef CONFIG_RK_CONFIG
1071 input_set_abs_params(ts->input_dev,ABS_MT_POSITION_X, 0, x_max, 0, 0);
1072 input_set_abs_params(ts->input_dev,ABS_MT_POSITION_Y, 0, y_max, 0, 0);
1074 input_set_abs_params(ts->input_dev,ABS_MT_POSITION_X, 0, 800, 0, 0);
1075 input_set_abs_params(ts->input_dev,ABS_MT_POSITION_Y, 0, 480, 0, 0);
1077 input_set_abs_params(ts->input_dev,ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
1079 for (i = 0; i < ARRAY_SIZE(initkey_code); i++) {
1080 input_set_capability(ts->input_dev, EV_KEY, initkey_code[i]);
1083 ret = input_register_device(ts->input_dev);
1085 printk("Can not register input device.");
1086 goto err_input_register_device_failed;
1089 ts->suspend_state = 0;
1091 #ifdef CONFIG_RK_CONFIG
1092 ret = request_irq(ts->irq, sitronix_ts_irq_handler, irq_cfg.irq.irq_flags | IRQF_DISABLED, client->name, ts);
1094 #ifdef SITRONIX_LEVEL_TRIGGERED
1095 ret = request_irq(ts->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_LOW | IRQF_DISABLED, client->name, ts);
1097 ret = request_irq(ts->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_FALLING | IRQF_DISABLED, client->name, ts);
1098 #endif // SITRONIX_LEVEL_TRIGGERED
1099 #endif // CONFIG_RK_CONFIG
1101 sitronix_ts_irq_on = 1;
1104 dev_err(&client->dev, "request_irq failed\n");
1106 #ifdef CONFIG_HAS_EARLYSUSPEND
1107 ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
1108 ts->early_suspend.suspend = sitronix_ts_early_suspend;
1109 ts->early_suspend.resume = sitronix_ts_late_resume;
1110 register_early_suspend(&ts->early_suspend);
1111 #endif // CONFIG_HAS_EARLYSUSPEND
1113 printk("lr------> %s end ------\n", __FUNCTION__);
1117 err_input_register_device_failed:
1118 input_free_device(ts->input_dev);
1119 #if defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1120 input_free_device(ts->keyevent_input);
1121 #endif // defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1122 err_input_dev_alloc_failed:
1124 err_alloc_data_failed:
1125 err_check_functionality_failed:
1126 #ifdef SITRONIX_MONITOR_THREAD
1127 if(SitronixMonitorThread){
1128 kthread_stop(SitronixMonitorThread);
1129 SitronixMonitorThread = NULL;
1131 #endif // SITRONIX_MONITOR_THREAD
1132 err_device_info_error:
1133 gpio_free(RK2928_PIN1_PA3);
1134 gpio_free(RK2928_PIN1_PB3);
1139 static int sitronix_ts_remove(struct i2c_client *client)
1141 struct sitronix_ts_data *ts = i2c_get_clientdata(client);
1142 #ifdef CONFIG_HAS_EARLYSUSPEND
1143 unregister_early_suspend(&ts->early_suspend);
1144 #endif // CONFIG_HAS_EARLYSUSPEND
1145 #ifdef SITRONIX_MONITOR_THREAD
1146 if(SitronixMonitorThread){
1147 kthread_stop(SitronixMonitorThread);
1148 SitronixMonitorThread = NULL;
1150 #endif // SITRONIX_MONITOR_THREAD
1152 free_irq(ts->irq, ts);
1154 hrtimer_cancel(&ts->timer);
1155 input_unregister_device(ts->input_dev);
1156 #if defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1157 input_unregister_device(ts->keyevent_input);
1158 #endif // defined(SITRONIX_SENSOR_KEY) || defined (SITRONIX_TOUCH_KEY)
1163 static int sitronix_ts_suspend(struct i2c_client *client, pm_message_t mesg)
1166 struct sitronix_ts_data *ts = i2c_get_clientdata(client);
1168 DbgMsg("%s\n", __FUNCTION__);
1169 #ifdef SITRONIX_MONITOR_THREAD
1170 if(SitronixMonitorThread){
1171 kthread_stop(SitronixMonitorThread);
1172 SitronixMonitorThread = NULL;
1174 sitronix_ts_delay_monitor_thread_start = DELAY_MONITOR_THREAD_START_RESUME;
1175 #endif // SITRONIX_MONITOR_THREAD
1177 sitronix_ts_irq_on = 0;
1178 disable_irq_nosync(ts->irq);
1180 ts->suspend_state = 1;
1182 ret = sitronix_ts_set_powerdown_bit(ts, 1);
1183 #ifdef SITRONIX_WAKE_UP_TOUCH_BY_INT
1184 gpio_direction_output(client->irq, 1);
1185 #endif // SITRONIX_WAKE_UP_TOUCH_BY_INT
1186 DbgMsg("%s return\n", __FUNCTION__);
1188 for(i = 0; i < ts->max_touches; i++)
1190 input_mt_slot(ts->input_dev, i);
1191 input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, -1);
1193 input_sync(ts->input_dev);
1198 static int sitronix_ts_resume(struct i2c_client *client)
1200 #ifdef SITRONIX_WAKE_UP_TOUCH_BY_INT
1204 #endif // SITRONIX_WAKE_UP_TOUCH_BY_INT
1205 struct sitronix_ts_data *ts = i2c_get_clientdata(client);
1207 DbgMsg("%s\n", __FUNCTION__);
1209 #ifdef SITRONIX_WAKE_UP_TOUCH_BY_INT
1211 gpio_set_value(gpio, 0);
1212 gpio_direction_input(gpio);
1214 ret = sitronix_ts_set_powerdown_bit(ts, 0);
1215 #endif // SITRONIX_WAKE_UP_TOUCH_BY_INT
1217 ts->suspend_state = 0;
1219 sitronix_ts_irq_on = 1;
1220 enable_irq(ts->irq);
1222 #ifdef SITRONIX_MONITOR_THREAD
1223 atomic_set(&iMonitorThreadPostpone,1);
1224 SitronixMonitorThread = kthread_run(sitronix_ts_monitor_thread,"Sitronix","Monitorthread");
1225 if(IS_ERR(SitronixMonitorThread))
1226 SitronixMonitorThread = NULL;
1227 #endif // SITRONIX_MONITOR_THREAD
1228 DbgMsg("%s return\n", __FUNCTION__);
1233 #ifdef CONFIG_HAS_EARLYSUSPEND
1234 static void sitronix_ts_early_suspend(struct early_suspend *h)
1236 struct sitronix_ts_data *ts;
1237 DbgMsg("%s\n", __FUNCTION__);
1238 ts = container_of(h, struct sitronix_ts_data, early_suspend);
1239 sitronix_ts_suspend(ts->client, PMSG_SUSPEND);
1242 static void sitronix_ts_late_resume(struct early_suspend *h)
1244 struct sitronix_ts_data *ts;
1245 DbgMsg("%s\n", __FUNCTION__);
1246 ts = container_of(h, struct sitronix_ts_data, early_suspend);
1247 sitronix_ts_resume(ts->client);
1249 #endif // CONFIG_HAS_EARLYSUSPEND
1251 static const struct i2c_device_id sitronix_ts_id[] = {
1252 { SITRONIX_I2C_TOUCH_DRV_NAME, 0 },
1256 static struct i2c_driver sitronix_ts_driver = {
1257 .probe = sitronix_ts_probe,
1258 .remove = sitronix_ts_remove,
1259 .id_table = sitronix_ts_id,
1261 .name = SITRONIX_I2C_TOUCH_DRV_NAME,
1265 #ifdef SITRONIX_FW_UPGRADE_FEATURE
1266 static struct file_operations nc_fops = {
1267 .owner = THIS_MODULE,
1268 .write = sitronix_write,
1269 .read = sitronix_read,
1270 .open = sitronix_open,
1271 .unlocked_ioctl = sitronix_ioctl,
1272 .release = sitronix_release,
1274 #endif // SITRONIX_FW_UPGRADE_FEATURE
1276 static int __init sitronix_ts_init(void)
1278 #ifdef SITRONIX_FW_UPGRADE_FEATURE
1281 #endif // SITRONIX_FW_UPGRADE_FEATURE
1283 #ifdef CONFIG_RK_CONFIG
1284 int ret = tp_board_init();
1289 printk("Sitronix touch driver %d.%d.%d\n", DRIVER_MAJOR, DRIVER_MINOR, DRIVER_PATCHLEVEL);
1290 printk("Release date: %s\n", DRIVER_DATE);
1291 #ifdef SITRONIX_FW_UPGRADE_FEATURE
1292 dev_t devno = MKDEV(sitronix_major, 0);
1293 result = alloc_chrdev_region(&devno, 0, 1, SITRONIX_I2C_TOUCH_DEV_NAME);
1295 printk("fail to allocate chrdev (%d) \n", result);
1298 sitronix_major = MAJOR(devno);
1299 cdev_init(&sitronix_cdev, &nc_fops);
1300 sitronix_cdev.owner = THIS_MODULE;
1301 sitronix_cdev.ops = &nc_fops;
1302 err = cdev_add(&sitronix_cdev, devno, 1);
1304 printk("fail to add cdev (%d) \n", err);
1308 sitronix_class = class_create(THIS_MODULE, SITRONIX_I2C_TOUCH_DEV_NAME);
1309 if (IS_ERR(sitronix_class)) {
1310 result = PTR_ERR(sitronix_class);
1311 unregister_chrdev(sitronix_major, SITRONIX_I2C_TOUCH_DEV_NAME);
1312 printk("fail to create class (%d) \n", result);
1315 device_create(sitronix_class, NULL, MKDEV(sitronix_major, 0), NULL, SITRONIX_I2C_TOUCH_DEV_NAME);
1316 #endif // SITRONIX_FW_UPGRADE_FEATURE
1319 return i2c_add_driver(&sitronix_ts_driver);
1322 static void __exit sitronix_ts_exit(void)
1324 #ifdef SITRONIX_FW_UPGRADE_FEATURE
1325 dev_t dev_id = MKDEV(sitronix_major, 0);
1326 #endif // SITRONIX_FW_UPGRADE_FEATURE
1327 i2c_del_driver(&sitronix_ts_driver);
1328 #ifdef SITRONIX_FW_UPGRADE_FEATURE
1329 cdev_del(&sitronix_cdev);
1331 device_destroy(sitronix_class, dev_id); //delete device node under /dev
1332 class_destroy(sitronix_class); //delete class created by us
1333 unregister_chrdev_region(dev_id, 1);
1334 #endif // SITRONIX_FW_UPGRADE_FEATURE
1337 module_init(sitronix_ts_init);
1338 module_exit(sitronix_ts_exit);
1340 MODULE_DESCRIPTION("Sitronix Multi-Touch Driver");
1341 MODULE_LICENSE("GPL");