2 * Copyright (C) 2012-2013 MundoReader S.L.
3 * Author: Heiko Stuebner <heiko@sntech.de>
5 * based in parts on Nook zforce driver
7 * Copyright (C) 2010 Barnes & Noble, Inc.
8 * Author: Pieter Truter<ptruter@intrinsyc.com>
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
20 #include <linux/module.h>
21 #include <linux/hrtimer.h>
22 #include <linux/slab.h>
23 #include <linux/input.h>
24 #include <linux/interrupt.h>
25 #include <linux/i2c.h>
26 #include <linux/delay.h>
27 #include <linux/gpio.h>
28 #include <linux/device.h>
29 #include <linux/sysfs.h>
30 #include <linux/input/mt.h>
31 #include <linux/platform_data/zforce_ts.h>
32 #include <linux/regulator/consumer.h>
34 #include <linux/of_gpio.h>
36 #define WAIT_TIMEOUT msecs_to_jiffies(1000)
38 #define FRAME_START 0xee
39 #define FRAME_MAXSIZE 257
41 /* Offsets of the different parts of the payload the controller sends */
42 #define PAYLOAD_HEADER 0
43 #define PAYLOAD_LENGTH 1
44 #define PAYLOAD_BODY 2
46 /* Response offsets */
48 #define RESPONSE_DATA 1
51 #define COMMAND_DEACTIVATE 0x00
52 #define COMMAND_INITIALIZE 0x01
53 #define COMMAND_RESOLUTION 0x02
54 #define COMMAND_SETCONFIG 0x03
55 #define COMMAND_DATAREQUEST 0x04
56 #define COMMAND_SCANFREQ 0x08
57 #define COMMAND_STATUS 0X1e
60 * Responses the controller sends as a result of
63 #define RESPONSE_DEACTIVATE 0x00
64 #define RESPONSE_INITIALIZE 0x01
65 #define RESPONSE_RESOLUTION 0x02
66 #define RESPONSE_SETCONFIG 0x03
67 #define RESPONSE_SCANFREQ 0x08
68 #define RESPONSE_STATUS 0X1e
71 * Notifications are sent by the touch controller without
72 * being requested by the driver and include for example
75 #define NOTIFICATION_TOUCH 0x04
76 #define NOTIFICATION_BOOTCOMPLETE 0x07
77 #define NOTIFICATION_OVERRUN 0x25
78 #define NOTIFICATION_PROXIMITY 0x26
79 #define NOTIFICATION_INVALID_COMMAND 0xfe
81 #define ZFORCE_REPORT_POINTS 2
82 #define ZFORCE_MAX_AREA 0xff
88 #define SETCONFIG_DUALTOUCH (1 << 0)
103 * @client the i2c_client
104 * @input the input device
105 * @suspending in the process of going to suspend (don't emit wakeup
106 * events for commands executed to suspend the device)
107 * @suspended device suspended
108 * @access_mutex serialize i2c-access, to keep multipart reads together
109 * @command_done completion to wait for the command result
110 * @command_mutex serialize commands sent to the ic
111 * @command_waiting the id of the command that is currently waiting
113 * @command_result returned result of the command
116 struct i2c_client *client;
117 struct input_dev *input;
118 const struct zforce_ts_platdata *pdata;
121 struct regulator *reg_vdd;
127 /* Firmware version information */
133 struct mutex access_mutex;
135 struct completion command_done;
136 struct mutex command_mutex;
141 static int zforce_command(struct zforce_ts *ts, u8 cmd)
143 struct i2c_client *client = ts->client;
147 dev_dbg(&client->dev, "%s: 0x%x\n", __func__, cmd);
149 buf[0] = FRAME_START;
150 buf[1] = 1; /* data size, command only */
153 mutex_lock(&ts->access_mutex);
154 ret = i2c_master_send(client, &buf[0], ARRAY_SIZE(buf));
155 mutex_unlock(&ts->access_mutex);
157 dev_err(&client->dev, "i2c send data request error: %d\n", ret);
164 static int zforce_send_wait(struct zforce_ts *ts, const char *buf, int len)
166 struct i2c_client *client = ts->client;
169 ret = mutex_trylock(&ts->command_mutex);
171 dev_err(&client->dev, "already waiting for a command\n");
175 dev_dbg(&client->dev, "sending %d bytes for command 0x%x\n",
178 ts->command_waiting = buf[2];
180 mutex_lock(&ts->access_mutex);
181 ret = i2c_master_send(client, buf, len);
182 mutex_unlock(&ts->access_mutex);
184 dev_err(&client->dev, "i2c send data request error: %d\n", ret);
188 dev_dbg(&client->dev, "waiting for result for command 0x%x\n", buf[2]);
190 if (wait_for_completion_timeout(&ts->command_done, WAIT_TIMEOUT) == 0) {
195 ret = ts->command_result;
198 mutex_unlock(&ts->command_mutex);
202 static int zforce_command_wait(struct zforce_ts *ts, u8 cmd)
204 struct i2c_client *client = ts->client;
208 dev_dbg(&client->dev, "%s: 0x%x\n", __func__, cmd);
210 buf[0] = FRAME_START;
211 buf[1] = 1; /* data size, command only */
214 ret = zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf));
216 dev_err(&client->dev, "i2c send data request error: %d\n", ret);
223 static int zforce_resolution(struct zforce_ts *ts, u16 x, u16 y)
225 struct i2c_client *client = ts->client;
226 char buf[7] = { FRAME_START, 5, COMMAND_RESOLUTION,
227 (x & 0xff), ((x >> 8) & 0xff),
228 (y & 0xff), ((y >> 8) & 0xff) };
230 dev_dbg(&client->dev, "set resolution to (%d,%d)\n", x, y);
232 return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf));
235 static int zforce_scan_frequency(struct zforce_ts *ts, u16 idle, u16 finger,
238 struct i2c_client *client = ts->client;
239 char buf[9] = { FRAME_START, 7, COMMAND_SCANFREQ,
240 (idle & 0xff), ((idle >> 8) & 0xff),
241 (finger & 0xff), ((finger >> 8) & 0xff),
242 (stylus & 0xff), ((stylus >> 8) & 0xff) };
244 dev_dbg(&client->dev,
245 "set scan frequency to (idle: %d, finger: %d, stylus: %d)\n",
246 idle, finger, stylus);
248 return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf));
251 static int zforce_setconfig(struct zforce_ts *ts, char b1)
253 struct i2c_client *client = ts->client;
254 char buf[7] = { FRAME_START, 5, COMMAND_SETCONFIG,
257 dev_dbg(&client->dev, "set config to (%d)\n", b1);
259 return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf));
262 static int zforce_start(struct zforce_ts *ts)
264 struct i2c_client *client = ts->client;
265 const struct zforce_ts_platdata *pdata = ts->pdata;
268 dev_dbg(&client->dev, "starting device\n");
270 ret = zforce_command_wait(ts, COMMAND_INITIALIZE);
272 dev_err(&client->dev, "Unable to initialize, %d\n", ret);
276 ret = zforce_resolution(ts, pdata->x_max, pdata->y_max);
278 dev_err(&client->dev, "Unable to set resolution, %d\n", ret);
282 ret = zforce_scan_frequency(ts, 10, 50, 50);
284 dev_err(&client->dev, "Unable to set scan frequency, %d\n",
289 ret = zforce_setconfig(ts, SETCONFIG_DUALTOUCH);
291 dev_err(&client->dev, "Unable to set config\n");
295 /* start sending touch events */
296 ret = zforce_command(ts, COMMAND_DATAREQUEST);
298 dev_err(&client->dev, "Unable to request data\n");
303 * Per NN, initial cal. take max. of 200msec.
304 * Allow time to complete this calibration
311 zforce_command_wait(ts, COMMAND_DEACTIVATE);
315 static int zforce_stop(struct zforce_ts *ts)
317 struct i2c_client *client = ts->client;
320 dev_dbg(&client->dev, "stopping device\n");
322 /* Deactivates touch sensing and puts the device into sleep. */
323 ret = zforce_command_wait(ts, COMMAND_DEACTIVATE);
325 dev_err(&client->dev, "could not deactivate device, %d\n",
333 static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
335 struct i2c_client *client = ts->client;
336 const struct zforce_ts_platdata *pdata = ts->pdata;
337 struct zforce_point point;
338 int count, i, num = 0;
341 if (count > ZFORCE_REPORT_POINTS) {
342 dev_warn(&client->dev,
343 "too many coordinates %d, expected max %d\n",
344 count, ZFORCE_REPORT_POINTS);
345 count = ZFORCE_REPORT_POINTS;
348 for (i = 0; i < count; i++) {
350 payload[9 * i + 2] << 8 | payload[9 * i + 1];
352 payload[9 * i + 4] << 8 | payload[9 * i + 3];
354 if (point.coord_x > pdata->x_max ||
355 point.coord_y > pdata->y_max) {
356 dev_warn(&client->dev, "coordinates (%d,%d) invalid\n",
357 point.coord_x, point.coord_y);
358 point.coord_x = point.coord_y = 0;
361 point.state = payload[9 * i + 5] & 0x03;
362 point.id = (payload[9 * i + 5] & 0xfc) >> 2;
364 /* determine touch major, minor and orientation */
365 point.area_major = max(payload[9 * i + 6],
367 point.area_minor = min(payload[9 * i + 6],
369 point.orientation = payload[9 * i + 6] > payload[9 * i + 7];
371 point.pressure = payload[9 * i + 8];
372 point.prblty = payload[9 * i + 9];
374 dev_dbg(&client->dev,
375 "point %d/%d: state %d, id %d, pressure %d, prblty %d, x %d, y %d, amajor %d, aminor %d, ori %d\n",
376 i, count, point.state, point.id,
377 point.pressure, point.prblty,
378 point.coord_x, point.coord_y,
379 point.area_major, point.area_minor,
382 /* the zforce id starts with "1", so needs to be decreased */
383 input_mt_slot(ts->input, point.id - 1);
385 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER,
386 point.state != STATE_UP);
388 if (point.state != STATE_UP) {
389 input_report_abs(ts->input, ABS_MT_POSITION_X,
391 input_report_abs(ts->input, ABS_MT_POSITION_Y,
393 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR,
395 input_report_abs(ts->input, ABS_MT_TOUCH_MINOR,
397 input_report_abs(ts->input, ABS_MT_ORIENTATION,
403 input_mt_sync_frame(ts->input);
405 input_mt_report_finger_count(ts->input, num);
407 input_sync(ts->input);
412 static int zforce_read_packet(struct zforce_ts *ts, u8 *buf)
414 struct i2c_client *client = ts->client;
417 mutex_lock(&ts->access_mutex);
419 /* read 2 byte message header */
420 ret = i2c_master_recv(client, buf, 2);
422 dev_err(&client->dev, "error reading header: %d\n", ret);
426 if (buf[PAYLOAD_HEADER] != FRAME_START) {
427 dev_err(&client->dev, "invalid frame start: %d\n", buf[0]);
432 if (buf[PAYLOAD_LENGTH] == 0) {
433 dev_err(&client->dev, "invalid payload length: %d\n",
434 buf[PAYLOAD_LENGTH]);
439 /* read the message */
440 ret = i2c_master_recv(client, &buf[PAYLOAD_BODY], buf[PAYLOAD_LENGTH]);
442 dev_err(&client->dev, "error reading payload: %d\n", ret);
446 dev_dbg(&client->dev, "read %d bytes for response command 0x%x\n",
447 buf[PAYLOAD_LENGTH], buf[PAYLOAD_BODY]);
450 mutex_unlock(&ts->access_mutex);
454 static void zforce_complete(struct zforce_ts *ts, int cmd, int result)
456 struct i2c_client *client = ts->client;
458 if (ts->command_waiting == cmd) {
459 dev_dbg(&client->dev, "completing command 0x%x\n", cmd);
460 ts->command_result = result;
461 complete(&ts->command_done);
463 dev_dbg(&client->dev, "command %d not for us\n", cmd);
467 static irqreturn_t zforce_irq(int irq, void *dev_id)
469 struct zforce_ts *ts = dev_id;
470 struct i2c_client *client = ts->client;
472 if (ts->suspended && device_may_wakeup(&client->dev))
473 pm_wakeup_event(&client->dev, 500);
475 return IRQ_WAKE_THREAD;
478 static irqreturn_t zforce_irq_thread(int irq, void *dev_id)
480 struct zforce_ts *ts = dev_id;
481 struct i2c_client *client = ts->client;
482 const struct zforce_ts_platdata *pdata = ts->pdata;
484 u8 payload_buffer[FRAME_MAXSIZE];
488 * When still suspended, return.
489 * Due to the level-interrupt we will get re-triggered later.
496 dev_dbg(&client->dev, "handling interrupt\n");
498 /* Don't emit wakeup events from commands run by zforce_suspend */
499 if (!ts->suspending && device_may_wakeup(&client->dev))
500 pm_stay_awake(&client->dev);
502 while (!gpio_get_value(pdata->gpio_int)) {
503 ret = zforce_read_packet(ts, payload_buffer);
505 dev_err(&client->dev,
506 "could not read packet, ret: %d\n", ret);
510 payload = &payload_buffer[PAYLOAD_BODY];
512 switch (payload[RESPONSE_ID]) {
513 case NOTIFICATION_TOUCH:
515 * Always report touch-events received while
516 * suspending, when being a wakeup source
518 if (ts->suspending && device_may_wakeup(&client->dev))
519 pm_wakeup_event(&client->dev, 500);
520 zforce_touch_event(ts, &payload[RESPONSE_DATA]);
523 case NOTIFICATION_BOOTCOMPLETE:
524 ts->boot_complete = payload[RESPONSE_DATA];
525 zforce_complete(ts, payload[RESPONSE_ID], 0);
528 case RESPONSE_INITIALIZE:
529 case RESPONSE_DEACTIVATE:
530 case RESPONSE_SETCONFIG:
531 case RESPONSE_RESOLUTION:
532 case RESPONSE_SCANFREQ:
533 zforce_complete(ts, payload[RESPONSE_ID],
534 payload[RESPONSE_DATA]);
537 case RESPONSE_STATUS:
539 * Version Payload Results
540 * [2:major] [2:minor] [2:build] [2:rev]
542 ts->version_major = (payload[RESPONSE_DATA + 1] << 8) |
543 payload[RESPONSE_DATA];
544 ts->version_minor = (payload[RESPONSE_DATA + 3] << 8) |
545 payload[RESPONSE_DATA + 2];
546 ts->version_build = (payload[RESPONSE_DATA + 5] << 8) |
547 payload[RESPONSE_DATA + 4];
548 ts->version_rev = (payload[RESPONSE_DATA + 7] << 8) |
549 payload[RESPONSE_DATA + 6];
550 dev_dbg(&ts->client->dev,
551 "Firmware Version %04x:%04x %04x:%04x\n",
552 ts->version_major, ts->version_minor,
553 ts->version_build, ts->version_rev);
555 zforce_complete(ts, payload[RESPONSE_ID], 0);
558 case NOTIFICATION_INVALID_COMMAND:
559 dev_err(&ts->client->dev, "invalid command: 0x%x\n",
560 payload[RESPONSE_DATA]);
564 dev_err(&ts->client->dev,
565 "unrecognized response id: 0x%x\n",
566 payload[RESPONSE_ID]);
571 if (!ts->suspending && device_may_wakeup(&client->dev))
572 pm_relax(&client->dev);
574 dev_dbg(&client->dev, "finished interrupt\n");
579 static int zforce_input_open(struct input_dev *dev)
581 struct zforce_ts *ts = input_get_drvdata(dev);
584 ret = zforce_start(ts);
591 static void zforce_input_close(struct input_dev *dev)
593 struct zforce_ts *ts = input_get_drvdata(dev);
594 struct i2c_client *client = ts->client;
597 ret = zforce_stop(ts);
599 dev_warn(&client->dev, "stopping zforce failed\n");
604 static int __maybe_unused zforce_suspend(struct device *dev)
606 struct i2c_client *client = to_i2c_client(dev);
607 struct zforce_ts *ts = i2c_get_clientdata(client);
608 struct input_dev *input = ts->input;
611 mutex_lock(&input->mutex);
612 ts->suspending = true;
615 * When configured as a wakeup source device should always wake
616 * the system, therefore start device if necessary.
618 if (device_may_wakeup(&client->dev)) {
619 dev_dbg(&client->dev, "suspend while being a wakeup source\n");
621 /* Need to start device, if not open, to be a wakeup source. */
623 ret = zforce_start(ts);
628 enable_irq_wake(client->irq);
629 } else if (input->users) {
630 dev_dbg(&client->dev,
631 "suspend without being a wakeup source\n");
633 ret = zforce_stop(ts);
637 disable_irq(client->irq);
640 ts->suspended = true;
643 ts->suspending = false;
644 mutex_unlock(&input->mutex);
649 static int __maybe_unused zforce_resume(struct device *dev)
651 struct i2c_client *client = to_i2c_client(dev);
652 struct zforce_ts *ts = i2c_get_clientdata(client);
653 struct input_dev *input = ts->input;
656 mutex_lock(&input->mutex);
658 ts->suspended = false;
660 if (device_may_wakeup(&client->dev)) {
661 dev_dbg(&client->dev, "resume from being a wakeup source\n");
663 disable_irq_wake(client->irq);
665 /* need to stop device if it was not open on suspend */
667 ret = zforce_stop(ts);
671 } else if (input->users) {
672 dev_dbg(&client->dev, "resume without being a wakeup source\n");
674 enable_irq(client->irq);
676 ret = zforce_start(ts);
682 mutex_unlock(&input->mutex);
687 static SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume);
689 static void zforce_reset(void *data)
691 struct zforce_ts *ts = data;
693 gpio_set_value(ts->pdata->gpio_rst, 0);
697 if (!IS_ERR(ts->reg_vdd))
698 regulator_disable(ts->reg_vdd);
701 static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)
703 struct zforce_ts_platdata *pdata;
704 struct device_node *np = dev->of_node;
707 return ERR_PTR(-ENOENT);
709 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
711 dev_err(dev, "failed to allocate platform data\n");
712 return ERR_PTR(-ENOMEM);
715 pdata->gpio_int = of_get_gpio(np, 0);
716 if (!gpio_is_valid(pdata->gpio_int)) {
717 dev_err(dev, "failed to get interrupt gpio\n");
718 return ERR_PTR(-EINVAL);
721 pdata->gpio_rst = of_get_gpio(np, 1);
722 if (!gpio_is_valid(pdata->gpio_rst)) {
723 dev_err(dev, "failed to get reset gpio\n");
724 return ERR_PTR(-EINVAL);
727 if (of_property_read_u32(np, "x-size", &pdata->x_max)) {
728 dev_err(dev, "failed to get x-size property\n");
729 return ERR_PTR(-EINVAL);
732 if (of_property_read_u32(np, "y-size", &pdata->y_max)) {
733 dev_err(dev, "failed to get y-size property\n");
734 return ERR_PTR(-EINVAL);
740 static int zforce_probe(struct i2c_client *client,
741 const struct i2c_device_id *id)
743 const struct zforce_ts_platdata *pdata = dev_get_platdata(&client->dev);
744 struct zforce_ts *ts;
745 struct input_dev *input_dev;
749 pdata = zforce_parse_dt(&client->dev);
751 return PTR_ERR(pdata);
754 ts = devm_kzalloc(&client->dev, sizeof(struct zforce_ts), GFP_KERNEL);
758 ret = devm_gpio_request_one(&client->dev, pdata->gpio_int, GPIOF_IN,
761 dev_err(&client->dev, "request of gpio %d failed, %d\n",
762 pdata->gpio_int, ret);
766 ret = devm_gpio_request_one(&client->dev, pdata->gpio_rst,
767 GPIOF_OUT_INIT_LOW, "zforce_ts_rst");
769 dev_err(&client->dev, "request of gpio %d failed, %d\n",
770 pdata->gpio_rst, ret);
774 ts->reg_vdd = devm_regulator_get_optional(&client->dev, "vdd");
775 if (IS_ERR(ts->reg_vdd)) {
776 ret = PTR_ERR(ts->reg_vdd);
777 if (ret == -EPROBE_DEFER)
780 ret = regulator_enable(ts->reg_vdd);
785 * according to datasheet add 100us grace time after regular
786 * regulator enable delay.
791 ret = devm_add_action(&client->dev, zforce_reset, ts);
793 dev_err(&client->dev, "failed to register reset action, %d\n",
796 /* hereafter the regulator will be disabled by the action */
797 if (!IS_ERR(ts->reg_vdd))
798 regulator_disable(ts->reg_vdd);
803 snprintf(ts->phys, sizeof(ts->phys),
804 "%s/input0", dev_name(&client->dev));
806 input_dev = devm_input_allocate_device(&client->dev);
808 dev_err(&client->dev, "could not allocate input device\n");
812 mutex_init(&ts->access_mutex);
813 mutex_init(&ts->command_mutex);
817 ts->input = input_dev;
819 input_dev->name = "Neonode zForce touchscreen";
820 input_dev->phys = ts->phys;
821 input_dev->id.bustype = BUS_I2C;
823 input_dev->open = zforce_input_open;
824 input_dev->close = zforce_input_close;
826 __set_bit(EV_KEY, input_dev->evbit);
827 __set_bit(EV_SYN, input_dev->evbit);
828 __set_bit(EV_ABS, input_dev->evbit);
830 /* For multi touch */
831 input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0,
833 input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0,
836 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0,
837 ZFORCE_MAX_AREA, 0, 0);
838 input_set_abs_params(input_dev, ABS_MT_TOUCH_MINOR, 0,
839 ZFORCE_MAX_AREA, 0, 0);
840 input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0);
841 input_mt_init_slots(input_dev, ZFORCE_REPORT_POINTS, INPUT_MT_DIRECT);
843 input_set_drvdata(ts->input, ts);
845 init_completion(&ts->command_done);
848 * The zforce pulls the interrupt low when it has data ready.
849 * After it is triggered the isr thread runs until all the available
850 * packets have been read and the interrupt is high again.
851 * Therefore we can trigger the interrupt anytime it is low and do
852 * not need to limit it to the interrupt edge.
854 ret = devm_request_threaded_irq(&client->dev, client->irq,
855 zforce_irq, zforce_irq_thread,
856 IRQF_TRIGGER_LOW | IRQF_ONESHOT,
857 input_dev->name, ts);
859 dev_err(&client->dev, "irq %d request failed\n", client->irq);
863 i2c_set_clientdata(client, ts);
865 /* let the controller boot */
866 gpio_set_value(pdata->gpio_rst, 1);
868 ts->command_waiting = NOTIFICATION_BOOTCOMPLETE;
869 if (wait_for_completion_timeout(&ts->command_done, WAIT_TIMEOUT) == 0)
870 dev_warn(&client->dev, "bootcomplete timed out\n");
872 /* need to start device to get version information */
873 ret = zforce_command_wait(ts, COMMAND_INITIALIZE);
875 dev_err(&client->dev, "unable to initialize, %d\n", ret);
879 /* this gets the firmware version among other information */
880 ret = zforce_command_wait(ts, COMMAND_STATUS);
882 dev_err(&client->dev, "couldn't get status, %d\n", ret);
887 /* stop device and put it into sleep until it is opened */
888 ret = zforce_stop(ts);
892 device_set_wakeup_capable(&client->dev, true);
894 ret = input_register_device(input_dev);
896 dev_err(&client->dev, "could not register input device, %d\n",
904 static struct i2c_device_id zforce_idtable[] = {
908 MODULE_DEVICE_TABLE(i2c, zforce_idtable);
911 static const struct of_device_id zforce_dt_idtable[] = {
912 { .compatible = "neonode,zforce" },
915 MODULE_DEVICE_TABLE(of, zforce_dt_idtable);
918 static struct i2c_driver zforce_driver = {
920 .owner = THIS_MODULE,
922 .pm = &zforce_pm_ops,
923 .of_match_table = of_match_ptr(zforce_dt_idtable),
925 .probe = zforce_probe,
926 .id_table = zforce_idtable,
929 module_i2c_driver(zforce_driver);
931 MODULE_AUTHOR("Heiko Stuebner <heiko@sntech.de>");
932 MODULE_DESCRIPTION("zForce TouchScreen Driver");
933 MODULE_LICENSE("GPL");