2 * drivers/input/touchscreen/gslX680.c
4 * Copyright (c) 2012 Shanghai Basewin
5 * Guan Yuwei<guanyuwei@basewin.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
13 #include <linux/module.h>
14 #include <linux/delay.h>
15 #include <linux/earlysuspend.h>
16 #include <linux/hrtimer.h>
17 #include <linux/i2c.h>
18 #include <linux/input.h>
19 #include <linux/interrupt.h>
21 #include <linux/platform_device.h>
22 #include <linux/async.h>
23 #include <mach/gpio.h>
24 #include <mach/iomux.h>
25 #include <linux/irq.h>
26 #include <mach/board.h>
27 #include <linux/workqueue.h>
28 #include <linux/proc_fs.h>
29 #include <linux/input/mt.h>
30 #if defined(CONFIG_MACH_RK3168_86V)||defined(CONFIG_MACH_RK3168_FAC)
31 #include <rockchip_gslX680_86v.h>
33 #include "rockchip_gslX680.h"
37 #define REPORT_DATA_ANDROID_4_0
39 //#define HAVE_TOUCH_KEY
41 #define GSLX680_I2C_NAME "gslX680"
42 #define GSLX680_I2C_ADDR 0x40
44 #define IRQ_PORT RK2928_PIN1_PB0
45 #define WAKE_PORT RK2928_PIN0_PD3
47 #define GSL_DATA_REG 0x80
48 #define GSL_STATUS_REG 0xe0
49 #define GSL_PAGE_REG 0xf0
53 #define MAX_CONTACTS 10
54 #define DMA_TRANS_LEN 0x20
56 #define I2C_SPEED 200*1000
60 static int key_state_flag = 0;
69 const u16 key_array[]={
75 #define MAX_KEY_NUM (sizeof(key_array)/sizeof(key_array[0]))
77 struct key_data gsl_key_data[MAX_KEY_NUM] = {
78 {KEY_BACK, 2048, 2048, 2048, 2048},
79 {KEY_HOME, 2048, 2048, 2048, 2048},
80 {KEY_MENU, 2048, 2048, 2048, 2048},
81 {KEY_SEARCH, 2048, 2048, 2048, 2048},
100 static struct gsl_ts_data devices[] = {
106 .data_reg = GSL_DATA_REG,
107 .status_reg = GSL_STATUS_REG,
110 .touch_meta_data = 4,
116 struct i2c_client *client;
117 struct input_dev *input;
118 struct work_struct work;
119 struct workqueue_struct *wq;
120 struct gsl_ts_data *dd;
126 struct mutex sus_lock;
127 // uint32_t gpio_irq;
129 #if defined(CONFIG_HAS_EARLYSUSPEND)
130 struct early_suspend early_suspend;
133 struct timer_list gsl_timer;
135 int reset_gpio; //lizhengwei
140 #define print_info(fmt, args...) \
142 printk(fmt, ##args); \
145 #define print_info(fmt, args...)
148 static int ts_global_reset_pin; //lizhengwei add
150 static u32 id_sign[MAX_CONTACTS+1] = {0};
151 static u8 id_state_flag[MAX_CONTACTS+1] = {0};
152 static u8 id_state_old_flag[MAX_CONTACTS+1] = {0};
153 static u16 x_old[MAX_CONTACTS+1] = {0};
154 static u16 y_old[MAX_CONTACTS+1] = {0};
155 static u16 x_new = 0;
156 static u16 y_new = 0;
158 static int gslX680_chip_init(void)
161 gpio_free(WAKE_PORT);
162 if (gpio_request(WAKE_PORT, "gslx680 wake")) {
163 printk("pjf gpio_request(WAKE_PORT) error\n");
164 goto exit_alloc_gpio_wake_failed;
167 gpio_direction_output(WAKE_PORT, 0);
168 gpio_set_value(WAKE_PORT,GPIO_HIGH);
172 if (gpio_request(IRQ_PORT, "gslx680 irq")) {
173 printk("pjf gpio_request(IRQ_PORT) error\n");
174 goto exit_alloc_gpio_irg_failed;
177 gpio_pull_updown(IRQ_PORT, 1);
182 exit_alloc_gpio_irg_failed:
184 exit_alloc_gpio_wake_failed:
185 gpio_free(WAKE_PORT);
189 static int gslX680_shutdown_low(void)
191 gpio_direction_output(ts_global_reset_pin, 0);
192 gpio_set_value(ts_global_reset_pin,GPIO_LOW);
196 static int gslX680_shutdown_high(void)
198 gpio_direction_output(ts_global_reset_pin, 0);
199 gpio_set_value(ts_global_reset_pin,GPIO_HIGH);
203 static inline u16 join_bytes(u8 a, u8 b)
211 static u32 gsl_read_interface(struct i2c_client *client, u8 reg, u8 *buf, u32 num)
213 struct i2c_msg xfer_msg[2];
215 xfer_msg[0].addr = client->addr;
217 xfer_msg[0].flags = client->flags & I2C_M_TEN;
218 xfer_msg[0].buf = ®
220 xfer_msg[1].addr = client->addr;
221 xfer_msg[1].len = num;
222 xfer_msg[1].flags |= I2C_M_RD;
223 xfer_msg[1].buf = buf;
226 i2c_transfer(client->adapter, xfer_msg, ARRAY_SIZE(xfer_msg));
230 return i2c_transfer(client->adapter, xfer_msg, ARRAY_SIZE(xfer_msg)) == ARRAY_SIZE(xfer_msg) ? 0 : -EFAULT;
233 static u32 gsl_write_interface(struct i2c_client *client, const u8 reg, u8 *buf, u32 num)
235 struct i2c_msg xfer_msg[1];
239 xfer_msg[0].addr = client->addr;
240 xfer_msg[0].len = num + 1;
241 xfer_msg[0].flags = client->flags & I2C_M_TEN;
242 xfer_msg[0].buf = buf;
243 xfer_msg[0].scl_rate = I2C_SPEED;
245 return i2c_transfer(client->adapter, xfer_msg, 1) == 1 ? 0 : -EFAULT;
248 static __inline__ void fw2buf(u8 *buf, const u32 *fw)
250 u32 *u32_buf = (int *)buf;
254 static void gsl_load_fw(struct i2c_client *client)
256 u8 buf[DMA_TRANS_LEN*4 + 1] = {0};
260 u32 source_len = ARRAY_SIZE(GSLX680_FW);
262 printk("=============gsl_load_fw start==============\n");
264 for (source_line = 0; source_line < source_len; source_line++)
266 /* init page trans, set the page val */
267 if (GSL_PAGE_REG == GSLX680_FW[source_line].offset)
269 fw2buf(cur, &GSLX680_FW[source_line].val);
270 gsl_write_interface(client, GSL_PAGE_REG, buf, 4);
275 if (1 == send_flag % (DMA_TRANS_LEN < 0x20 ? DMA_TRANS_LEN : 0x20))
276 buf[0] = (u8)GSLX680_FW[source_line].offset;
278 fw2buf(cur, &GSLX680_FW[source_line].val);
281 if (0 == send_flag % (DMA_TRANS_LEN < 0x20 ? DMA_TRANS_LEN : 0x20))
283 gsl_write_interface(client, buf[0], buf, cur - buf - 1);
291 printk("=============gsl_load_fw end==============\n");
296 static int gsl_ts_write(struct i2c_client *client, u8 addr, u8 *pdata, int datalen)
300 unsigned int bytelen = 0;
303 printk("%s too big datalen = %d!\n", __func__, datalen);
310 if (datalen != 0 && pdata != NULL)
312 memcpy(&tmp_buf[bytelen], pdata, datalen);
316 ret = i2c_master_send(client, tmp_buf, bytelen);
320 static int gsl_ts_read(struct i2c_client *client, u8 addr, u8 *pdata, unsigned int datalen)
326 printk("%s too big datalen = %d!\n", __func__, datalen);
330 ret = gsl_ts_write(client, addr, NULL, 0);
333 printk("%s set data address fail!\n", __func__);
337 return i2c_master_recv(client, pdata, datalen);
340 static void test_i2c(struct i2c_client *client)
345 ret = gsl_ts_read( client, 0xf0, &read_buf, sizeof(read_buf) );
348 pr_info("I2C transfer error!\n");
352 pr_info("I read reg 0xf0 is %x\n", read_buf);
356 ret = gsl_ts_write(client, 0xf0, &write_buf, sizeof(write_buf));
359 pr_info("I2C transfer error!\n");
363 pr_info("I write reg 0xf0 0x12\n");
367 ret = gsl_ts_read( client, 0xf0, &read_buf, sizeof(read_buf) );
370 pr_info("I2C transfer error!\n");
374 pr_info("I read reg 0xf0 is 0x%x\n", read_buf);
381 static void startup_chip(struct i2c_client *client)
384 gsl_ts_write(client, 0xe0, &tmp, 1);
388 static void reset_chip(struct i2c_client *client)
392 gsl_ts_write(client, 0xe0, &tmp, sizeof(tmp));
396 gsl_ts_write(client, 0xe4, &tmp, sizeof(tmp));
399 gsl_ts_write(client, 0xbc, buf, sizeof(buf));
403 static void init_chip(struct i2c_client *client)
408 startup_chip(client);
410 gslX680_shutdown_low();
412 gslX680_shutdown_high();
414 gslX680_shutdown_low();
416 gslX680_shutdown_high();
419 startup_chip(client);
422 static void check_mem_data(struct i2c_client *client)
425 char read_buf[4] = {0};
429 gsl_ts_write(client,0xf0, &write_buf, sizeof(write_buf));
430 gsl_ts_read(client,0x00, read_buf, sizeof(read_buf));
431 gsl_ts_read(client,0x00, read_buf, sizeof(read_buf));
432 if (read_buf[3] != 0x1 || read_buf[2] != 0 || read_buf[1] != 0 || read_buf[0] != 0)
434 printk("!!!!!!!!!!!page: %x offset: %x val: %x %x %x %x\n",0x0, 0x0, read_buf[3], read_buf[2], read_buf[1], read_buf[0]);
439 static void record_point(u16 x, u16 y , u8 id)
444 id_sign[id]=id_sign[id]+1;
451 x = (x_old[id] + x)/2;
452 y = (y_old[id] + y)/2;
468 if( (x_err > 3 && y_err > 1) || (x_err > 1 && y_err > 3) ){
469 x_new = x; x_old[id] = x;
470 y_new = y; y_old[id] = y;
474 x_new = x; x_old[id] = x;
479 y_new = y; y_old[id] = y;
492 #ifdef HAVE_TOUCH_KEY
493 static void report_key(struct gsl_ts *ts, u16 x, u16 y)
497 for(i = 0; i < MAX_KEY_NUM; i++)
499 if((gsl_key_data[i].x_min < x) && (x < gsl_key_data[i].x_max)&&(gsl_key_data[i].y_min < y) && (y < gsl_key_data[i].y_max))
501 key = gsl_key_data[i].key;
502 input_report_key(ts->input, key, 1);
503 input_sync(ts->input);
511 static void report_data(struct gsl_ts *ts, u16 x, u16 y, u8 pressure, u8 id)
515 if(x>=SCREEN_MAX_X||y>=SCREEN_MAX_Y)
517 #ifdef HAVE_TOUCH_KEY
523 //x = SCREEN_MAX_X-x-1;
524 y = SCREEN_MAX_Y-y-1;
525 //printk("#####id=%d,x=%d,y=%d######\n",id,x,y);
527 #ifdef REPORT_DATA_ANDROID_4_0
528 input_mt_slot(ts->input, id);
529 input_report_abs(ts->input, ABS_MT_TRACKING_ID, id);
530 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, pressure);
531 input_report_abs(ts->input, ABS_MT_POSITION_X, x);
532 input_report_abs(ts->input, ABS_MT_POSITION_Y, y);
533 input_report_abs(ts->input, ABS_MT_WIDTH_MAJOR, 1);
535 input_report_abs(ts->input, ABS_MT_TRACKING_ID, id);
536 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, pressure);
537 input_report_abs(ts->input, ABS_MT_POSITION_X,x);
538 input_report_abs(ts->input, ABS_MT_POSITION_Y, y);
539 input_report_abs(ts->input, ABS_MT_WIDTH_MAJOR, 1);
540 input_mt_sync(ts->input);
544 static void process_gslX680_data(struct gsl_ts *ts)
550 touches = ts->touch_data[ts->dd->touch_index];
551 for(i=1;i<=MAX_CONTACTS;i++)
555 id_state_flag[i] = 0;
557 for(i= 0;i < (touches > MAX_FINGERS ? MAX_FINGERS : touches);i ++)
559 x = join_bytes( ( ts->touch_data[ts->dd->x_index + 4 * i + 1] & 0xf),
560 ts->touch_data[ts->dd->x_index + 4 * i]);
561 y = join_bytes(ts->touch_data[ts->dd->y_index + 4 * i + 1],
562 ts->touch_data[ts->dd->y_index + 4 * i ]);
563 id = ts->touch_data[ts->dd->id_index + 4 * i] >> 4;
565 if(1 <=id && id <= MAX_CONTACTS)
567 record_point(x, y , id);
568 report_data(ts, x_new, y_new, 10, id);
569 id_state_flag[id] = 1;
572 for(i=1;i<=MAX_CONTACTS;i++)
574 if( (0 == touches) || ((0 != id_state_old_flag[i]) && (0 == id_state_flag[i])) )
576 #ifdef REPORT_DATA_ANDROID_4_0
577 input_mt_slot(ts->input, i);
578 input_report_abs(ts->input, ABS_MT_TRACKING_ID, -1);
579 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, false);
583 id_state_old_flag[i] = id_state_flag[i];
585 #ifndef REPORT_DATA_ANDROID_4_0
588 input_mt_sync(ts->input);
589 #ifdef HAVE_TOUCH_KEY
592 input_report_key(ts->input, key, 0);
593 input_sync(ts->input);
599 input_sync(ts->input);
600 ts->prev_touches = touches;
604 static void gsl_ts_xy_worker(struct work_struct *work)
607 u8 read_buf[4] = {0};
609 struct gsl_ts *ts = container_of(work, struct gsl_ts,work);
611 print_info("---gsl_ts_xy_worker---\n");
613 if (ts->is_suspended == true) {
614 dev_dbg(&ts->client->dev, "TS is supended\n");
615 ts->int_pending = true;
619 /* read data from DATA_REG */
620 rc = gsl_ts_read(ts->client, 0x80, ts->touch_data, ts->dd->data_size);
621 print_info("---touches: %d ---\n",ts->touch_data[0]);
625 dev_err(&ts->client->dev, "read failed\n");
629 if (ts->touch_data[ts->dd->touch_index] == 0xff) {
633 rc = gsl_ts_read( ts->client, 0xbc, read_buf, sizeof(read_buf));
636 dev_err(&ts->client->dev, "read 0xbc failed\n");
639 print_info("//////// reg %x : %x %x %x %x\n",0xbc, read_buf[3], read_buf[2], read_buf[1], read_buf[0]);
641 if (read_buf[3] == 0 && read_buf[2] == 0 && read_buf[1] == 0 && read_buf[0] == 0)
643 process_gslX680_data(ts);
647 reset_chip(ts->client);
648 startup_chip(ts->client);
656 static irqreturn_t gsl_ts_irq(int irq, void *dev_id)
658 struct gsl_ts *ts = dev_id;
660 if (ts->is_suspended == true)
662 print_info("==========GSLX680 Interrupt============\n");
664 disable_irq_nosync(ts->irq);
666 if (!work_pending(&ts->work))
668 queue_work(ts->wq, &ts->work);
676 static void gsl_timer_handle(unsigned long data)
678 struct gsl_ts *ts = (struct gsl_ts *)data;
681 printk("----------------gsl_timer_handle-----------------\n");
684 disable_irq_nosync(ts->irq);
685 check_mem_data(ts->client);
686 ts->gsl_timer.expires = jiffies + 3 * HZ;
687 add_timer(&ts->gsl_timer);
693 static int gsl_ts_init_ts(struct i2c_client *client, struct gsl_ts *ts)
695 struct input_dev *input_device;
698 printk("[GSLX680] Enter %s\n", __func__);
701 ts->dd = &devices[ts->device_id];
703 if (ts->device_id == 0) {
704 ts->dd->data_size = MAX_FINGERS * ts->dd->touch_bytes + ts->dd->touch_meta_data;
705 ts->dd->touch_index = 0;
708 ts->touch_data = kzalloc(ts->dd->data_size, GFP_KERNEL);
709 if (!ts->touch_data) {
710 pr_err("%s: Unable to allocate memory\n", __func__);
714 ts->prev_touches = 0;
716 input_device = input_allocate_device();
719 goto error_alloc_dev;
722 ts->input = input_device;
723 input_device->name = GSLX680_I2C_NAME;
724 input_device->id.bustype = BUS_I2C;
725 input_device->dev.parent = &client->dev;
726 input_set_drvdata(input_device, ts);
728 #ifdef REPORT_DATA_ANDROID_4_0
729 __set_bit(EV_ABS, input_device->evbit);
730 __set_bit(EV_KEY, input_device->evbit);
731 __set_bit(EV_REP, input_device->evbit);
732 __set_bit(INPUT_PROP_DIRECT, input_device->propbit);
733 input_mt_init_slots(input_device, (MAX_CONTACTS+1));
735 input_set_abs_params(input_device,ABS_MT_TRACKING_ID, 0, (MAX_CONTACTS+1), 0, 0);
736 set_bit(EV_ABS, input_device->evbit);
737 set_bit(EV_KEY, input_device->evbit);
740 #ifdef HAVE_TOUCH_KEY
741 input_device->evbit[0] = BIT_MASK(EV_KEY);
742 for (i = 0; i < MAX_KEY_NUM; i++)
743 set_bit(key_array[i], input_device->keybit);
746 set_bit(ABS_MT_POSITION_X, input_device->absbit);
747 set_bit(ABS_MT_POSITION_Y, input_device->absbit);
748 set_bit(ABS_MT_TOUCH_MAJOR, input_device->absbit);
749 set_bit(ABS_MT_WIDTH_MAJOR, input_device->absbit);
751 input_set_abs_params(input_device,ABS_MT_POSITION_X, 0, SCREEN_MAX_X, 0, 0);
752 input_set_abs_params(input_device,ABS_MT_POSITION_Y, 0, SCREEN_MAX_Y, 0, 0);
753 input_set_abs_params(input_device,ABS_MT_TOUCH_MAJOR, 0, PRESS_MAX, 0, 0);
754 input_set_abs_params(input_device,ABS_MT_WIDTH_MAJOR, 0, 200, 0, 0);
756 client->irq = ts->irq; //IRQ_PORT,
757 //ts->irq = client->irq;
759 ts->wq = create_singlethread_workqueue("kworkqueue_ts");
761 dev_err(&client->dev, "Could not create workqueue\n");
762 goto error_wq_create;
764 flush_workqueue(ts->wq);
766 INIT_WORK(&ts->work, gsl_ts_xy_worker);
768 rc = input_register_device(input_device);
770 goto error_unreg_device;
775 destroy_workqueue(ts->wq);
777 input_free_device(input_device);
779 kfree(ts->touch_data);
783 static int gsl_ts_suspend(struct device *dev)
785 struct gsl_ts *ts = dev_get_drvdata(dev);
788 printk("I'am in gsl_ts_suspend() start\n");
789 ts->is_suspended = true;
792 printk( "gsl_ts_suspend () : delete gsl_timer\n");
794 del_timer(&ts->gsl_timer);
796 disable_irq_nosync(ts->irq);
798 reset_chip(ts->client);
799 gslX680_shutdown_low();
805 static int gsl_ts_resume(struct device *dev)
807 struct gsl_ts *ts = dev_get_drvdata(dev);
810 printk("I'am in gsl_ts_resume() start\n");
812 gslX680_shutdown_high();
814 reset_chip(ts->client);
815 startup_chip(ts->client);
816 check_mem_data(ts->client);
819 printk( "gsl_ts_resume () : add gsl_timer\n");
821 init_timer(&ts->gsl_timer);
822 ts->gsl_timer.expires = jiffies + 3 * HZ;
823 ts->gsl_timer.function = &gsl_timer_handle;
824 ts->gsl_timer.data = (unsigned long)ts;
825 add_timer(&ts->gsl_timer);
829 ts->is_suspended = false;
834 #ifdef CONFIG_HAS_EARLYSUSPEND
835 static void gsl_ts_early_suspend(struct early_suspend *h)
837 struct gsl_ts *ts = container_of(h, struct gsl_ts, early_suspend);
838 printk("[GSL1680] Enter %s\n", __func__);
839 gsl_ts_suspend(&ts->client->dev);
842 static void gsl_ts_late_resume(struct early_suspend *h)
844 struct gsl_ts *ts = container_of(h, struct gsl_ts, early_suspend);
845 printk("[GSL1680] Enter %s\n", __func__);
846 gsl_ts_resume(&ts->client->dev);
850 static int __devinit gsl_ts_probe(struct i2c_client *client,
851 const struct i2c_device_id *id)
853 struct ts_hw_data *pdata = client->dev.platform_data;
858 printk("GSLX680 Enter %s\n", __func__);
859 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
860 dev_err(&client->dev, "I2C functionality not supported\n");
864 ts = kzalloc(sizeof(*ts), GFP_KERNEL);
867 printk("==kzalloc success=\n");
870 ts->device_id = id->driver_data;
872 ts->is_suspended = false;
873 ts->int_pending = false;
874 ts->reset_gpio = pdata->reset_gpio; //lizhengwei
875 ts->irq= pdata->touch_en_gpio; //lizhengwei
876 mutex_init(&ts->sus_lock);
878 ts_global_reset_pin=ts->reset_gpio;
880 i2c_set_clientdata(client, ts);
882 if (pdata->init_platform_hw)
883 pdata->init_platform_hw();
885 rc = gsl_ts_init_ts(client, ts);
887 dev_err(&client->dev, "GSLX680 init failed\n");
888 goto error_mutex_destroy;
890 //gslX680_chip_init();
891 init_chip(ts->client);
892 check_mem_data(ts->client);
894 rc= request_irq(client->irq, gsl_ts_irq, IRQF_TRIGGER_RISING, client->name, ts);
896 printk( "gsl_probe: request irq failed\n");
897 goto error_req_irq_fail;
904 ret = gsl_ts_read( client, 0xf0, &read_buf, sizeof(read_buf) );
907 pr_info("gslx680 I2C transfer error!\n");
908 goto error_req_irq_fail;
915 printk( "gsl_ts_probe () : add gsl_timer\n");
917 init_timer(&ts->gsl_timer);
918 ts->gsl_timer.expires = jiffies + 3 * HZ; //¶¨Ê±3 ÃëÖÓ
919 ts->gsl_timer.function = &gsl_timer_handle;
920 ts->gsl_timer.data = (unsigned long)ts;
921 add_timer(&ts->gsl_timer);
924 /* create debug attribute */
925 //rc = device_create_file(&ts->input->dev, &dev_attr_debug_enable);
927 #ifdef CONFIG_HAS_EARLYSUSPEND
928 ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
929 ts->early_suspend.suspend = gsl_ts_early_suspend;
930 ts->early_suspend.resume = gsl_ts_late_resume;
931 register_early_suspend(&ts->early_suspend);
934 printk("[GSLX680] End %s\n", __func__);
940 free_irq(ts->irq, ts);
943 mutex_destroy(&ts->sus_lock);
944 input_free_device(ts->input);
949 static int __devexit gsl_ts_remove(struct i2c_client *client)
951 struct gsl_ts *ts = i2c_get_clientdata(client);
952 printk("==gsl_ts_remove=\n");
954 #ifdef CONFIG_HAS_EARLYSUSPEND
955 unregister_early_suspend(&ts->early_suspend);
958 device_init_wakeup(&client->dev, 0);
959 cancel_work_sync(&ts->work);
960 free_irq(ts->irq, ts);
961 destroy_workqueue(ts->wq);
962 input_unregister_device(ts->input);
963 mutex_destroy(&ts->sus_lock);
965 //device_remove_file(&ts->input->dev, &dev_attr_debug_enable);
967 kfree(ts->touch_data);
973 static const struct i2c_device_id gsl_ts_id[] = {
974 {GSLX680_I2C_NAME, 0},
977 MODULE_DEVICE_TABLE(i2c, gsl_ts_id);
980 static struct i2c_driver gsl_ts_driver = {
982 .name = GSLX680_I2C_NAME,
983 .owner = THIS_MODULE,
985 #ifndef CONFIG_HAS_EARLYSUSPEND
986 .suspend = gsl_ts_suspend,
987 .resume = gsl_ts_resume,
989 .probe = gsl_ts_probe,
990 .remove = __devexit_p(gsl_ts_remove),
991 .id_table = gsl_ts_id,
994 static int __init gsl_ts_init(void)
997 printk("==gsl_ts_init==\n");
998 ret = i2c_add_driver(&gsl_ts_driver);
999 printk("ret=%d\n",ret);
1002 static void __exit gsl_ts_exit(void)
1004 printk("==gsl_ts_exit==\n");
1005 i2c_del_driver(&gsl_ts_driver);
1009 module_init(gsl_ts_init);
1010 module_exit(gsl_ts_exit);
1012 MODULE_LICENSE("GPL");
1013 MODULE_DESCRIPTION("GSLX680 touchscreen controller driver");
1014 MODULE_AUTHOR("Guan Yuwei, guanyuwei@basewin.com");
1015 MODULE_ALIAS("platform:gsl_ts");