1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2012-2013 MundoReader S.L.
4 * Author: Heiko Stuebner <heiko@sntech.de>
6 * based in parts on Nook zforce driver
8 * Copyright (C) 2010 Barnes & Noble, Inc.
9 * Author: Pieter Truter<ptruter@intrinsyc.com>
12 #include <linux/delay.h>
13 #include <linux/device.h>
14 #include <linux/gpio/consumer.h>
15 #include <linux/i2c.h>
16 #include <linux/input.h>
17 #include <linux/input/mt.h>
18 #include <linux/input/touchscreen.h>
19 #include <linux/interrupt.h>
20 #include <linux/module.h>
22 #include <linux/property.h>
23 #include <linux/regulator/consumer.h>
24 #include <linux/slab.h>
25 #include <linux/unaligned.h>
27 #define WAIT_TIMEOUT msecs_to_jiffies(1000)
29 #define FRAME_START 0xee
30 #define FRAME_MAXSIZE 257
32 /* Offsets of the different parts of the payload the controller sends */
33 #define PAYLOAD_HEADER 0
34 #define PAYLOAD_LENGTH 1
35 #define PAYLOAD_BODY 2
37 /* Response offsets */
39 #define RESPONSE_DATA 1
42 #define COMMAND_DEACTIVATE 0x00
43 #define COMMAND_INITIALIZE 0x01
44 #define COMMAND_RESOLUTION 0x02
45 #define COMMAND_SETCONFIG 0x03
46 #define COMMAND_DATAREQUEST 0x04
47 #define COMMAND_SCANFREQ 0x08
48 #define COMMAND_STATUS 0X1e
51 * Responses the controller sends as a result of
54 #define RESPONSE_DEACTIVATE 0x00
55 #define RESPONSE_INITIALIZE 0x01
56 #define RESPONSE_RESOLUTION 0x02
57 #define RESPONSE_SETCONFIG 0x03
58 #define RESPONSE_SCANFREQ 0x08
59 #define RESPONSE_STATUS 0X1e
62 * Notifications are sent by the touch controller without
63 * being requested by the driver and include for example
66 #define NOTIFICATION_TOUCH 0x04
67 #define NOTIFICATION_BOOTCOMPLETE 0x07
68 #define NOTIFICATION_OVERRUN 0x25
69 #define NOTIFICATION_PROXIMITY 0x26
70 #define NOTIFICATION_INVALID_COMMAND 0xfe
72 #define ZFORCE_REPORT_POINTS 2
73 #define ZFORCE_MAX_AREA 0xff
79 #define SETCONFIG_DUALTOUCH (1 << 0)
94 * @client the i2c_client
95 * @input the input device
96 * @suspending in the process of going to suspend (don't emit wakeup
97 * events for commands executed to suspend the device)
98 * @suspended device suspended
99 * @command_done completion to wait for the command result
100 * @command_waiting the id of the command that is currently waiting
102 * @command_result returned result of the command
105 struct i2c_client
*client
;
106 struct input_dev
*input
;
107 struct touchscreen_properties prop
;
110 struct gpio_desc
*gpio_int
;
111 struct gpio_desc
*gpio_rst
;
117 /* Firmware version information */
123 struct completion command_done
;
128 static int zforce_command(struct zforce_ts
*ts
, u8 cmd
)
130 struct i2c_client
*client
= ts
->client
;
134 dev_dbg(&client
->dev
, "%s: 0x%x\n", __func__
, cmd
);
136 buf
[0] = FRAME_START
;
137 buf
[1] = 1; /* data size, command only */
140 ret
= i2c_master_send(client
, &buf
[0], ARRAY_SIZE(buf
));
142 dev_err(&client
->dev
, "i2c send data request error: %d\n", ret
);
149 static int zforce_send_wait(struct zforce_ts
*ts
, const char *buf
, int len
)
151 struct i2c_client
*client
= ts
->client
;
154 dev_dbg(&client
->dev
, "sending %d bytes for command 0x%x\n",
157 ts
->command_waiting
= buf
[2];
159 ret
= i2c_master_send(client
, buf
, len
);
161 dev_err(&client
->dev
, "i2c send data request error: %d\n", ret
);
165 dev_dbg(&client
->dev
, "waiting for result for command 0x%x\n", buf
[2]);
167 if (wait_for_completion_timeout(&ts
->command_done
, WAIT_TIMEOUT
) == 0)
170 ret
= ts
->command_result
;
174 static int zforce_command_wait(struct zforce_ts
*ts
, u8 cmd
)
176 struct i2c_client
*client
= ts
->client
;
180 dev_dbg(&client
->dev
, "%s: 0x%x\n", __func__
, cmd
);
182 buf
[0] = FRAME_START
;
183 buf
[1] = 1; /* data size, command only */
186 error
= zforce_send_wait(ts
, &buf
[0], ARRAY_SIZE(buf
));
188 dev_err(&client
->dev
, "i2c send data request error: %d\n",
196 static int zforce_resolution(struct zforce_ts
*ts
, u16 x
, u16 y
)
198 struct i2c_client
*client
= ts
->client
;
199 char buf
[7] = { FRAME_START
, 5, COMMAND_RESOLUTION
,
200 (x
& 0xff), ((x
>> 8) & 0xff),
201 (y
& 0xff), ((y
>> 8) & 0xff) };
203 dev_dbg(&client
->dev
, "set resolution to (%d,%d)\n", x
, y
);
205 return zforce_send_wait(ts
, &buf
[0], ARRAY_SIZE(buf
));
208 static int zforce_scan_frequency(struct zforce_ts
*ts
, u16 idle
, u16 finger
,
211 struct i2c_client
*client
= ts
->client
;
212 char buf
[9] = { FRAME_START
, 7, COMMAND_SCANFREQ
,
213 (idle
& 0xff), ((idle
>> 8) & 0xff),
214 (finger
& 0xff), ((finger
>> 8) & 0xff),
215 (stylus
& 0xff), ((stylus
>> 8) & 0xff) };
217 dev_dbg(&client
->dev
,
218 "set scan frequency to (idle: %d, finger: %d, stylus: %d)\n",
219 idle
, finger
, stylus
);
221 return zforce_send_wait(ts
, &buf
[0], ARRAY_SIZE(buf
));
224 static int zforce_setconfig(struct zforce_ts
*ts
, char b1
)
226 struct i2c_client
*client
= ts
->client
;
227 char buf
[7] = { FRAME_START
, 5, COMMAND_SETCONFIG
,
230 dev_dbg(&client
->dev
, "set config to (%d)\n", b1
);
232 return zforce_send_wait(ts
, &buf
[0], ARRAY_SIZE(buf
));
235 static int zforce_start(struct zforce_ts
*ts
)
237 struct i2c_client
*client
= ts
->client
;
240 dev_dbg(&client
->dev
, "starting device\n");
242 error
= zforce_command_wait(ts
, COMMAND_INITIALIZE
);
244 dev_err(&client
->dev
, "Unable to initialize, %d\n", error
);
248 error
= zforce_resolution(ts
, ts
->prop
.max_x
, ts
->prop
.max_y
);
250 dev_err(&client
->dev
, "Unable to set resolution, %d\n", error
);
254 error
= zforce_scan_frequency(ts
, 10, 50, 50);
256 dev_err(&client
->dev
, "Unable to set scan frequency, %d\n",
261 error
= zforce_setconfig(ts
, SETCONFIG_DUALTOUCH
);
263 dev_err(&client
->dev
, "Unable to set config\n");
267 /* start sending touch events */
268 error
= zforce_command(ts
, COMMAND_DATAREQUEST
);
270 dev_err(&client
->dev
, "Unable to request data\n");
275 * Per NN, initial cal. take max. of 200msec.
276 * Allow time to complete this calibration
283 zforce_command_wait(ts
, COMMAND_DEACTIVATE
);
287 static int zforce_stop(struct zforce_ts
*ts
)
289 struct i2c_client
*client
= ts
->client
;
292 dev_dbg(&client
->dev
, "stopping device\n");
294 /* Deactivates touch sensing and puts the device into sleep. */
295 error
= zforce_command_wait(ts
, COMMAND_DEACTIVATE
);
297 dev_err(&client
->dev
, "could not deactivate device, %d\n",
305 static int zforce_touch_event(struct zforce_ts
*ts
, u8
*payload
)
307 struct i2c_client
*client
= ts
->client
;
308 struct zforce_point point
;
309 int count
, i
, num
= 0;
313 if (count
> ZFORCE_REPORT_POINTS
) {
314 dev_warn(&client
->dev
,
315 "too many coordinates %d, expected max %d\n",
316 count
, ZFORCE_REPORT_POINTS
);
317 count
= ZFORCE_REPORT_POINTS
;
320 for (i
= 0; i
< count
; i
++) {
321 p
= &payload
[i
* 9 + 1];
323 point
.coord_x
= get_unaligned_le16(&p
[0]);
324 point
.coord_y
= get_unaligned_le16(&p
[2]);
326 if (point
.coord_x
> ts
->prop
.max_x
||
327 point
.coord_y
> ts
->prop
.max_y
) {
328 dev_warn(&client
->dev
, "coordinates (%d,%d) invalid\n",
329 point
.coord_x
, point
.coord_y
);
330 point
.coord_x
= point
.coord_y
= 0;
333 point
.state
= p
[4] & 0x0f;
334 point
.id
= (p
[4] & 0xf0) >> 4;
336 /* determine touch major, minor and orientation */
337 point
.area_major
= max(p
[5], p
[6]);
338 point
.area_minor
= min(p
[5], p
[6]);
339 point
.orientation
= p
[5] > p
[6];
341 point
.pressure
= p
[7];
344 dev_dbg(&client
->dev
,
345 "point %d/%d: state %d, id %d, pressure %d, prblty %d, x %d, y %d, amajor %d, aminor %d, ori %d\n",
346 i
, count
, point
.state
, point
.id
,
347 point
.pressure
, point
.prblty
,
348 point
.coord_x
, point
.coord_y
,
349 point
.area_major
, point
.area_minor
,
352 /* the zforce id starts with "1", so needs to be decreased */
353 input_mt_slot(ts
->input
, point
.id
- 1);
355 if (input_mt_report_slot_state(ts
->input
, MT_TOOL_FINGER
,
356 point
.state
!= STATE_UP
)) {
357 touchscreen_report_pos(ts
->input
, &ts
->prop
,
358 point
.coord_x
, point
.coord_y
,
360 input_report_abs(ts
->input
, ABS_MT_TOUCH_MAJOR
,
362 input_report_abs(ts
->input
, ABS_MT_TOUCH_MINOR
,
364 input_report_abs(ts
->input
, ABS_MT_ORIENTATION
,
370 input_mt_sync_frame(ts
->input
);
372 input_mt_report_finger_count(ts
->input
, num
);
374 input_sync(ts
->input
);
379 static int zforce_read_packet(struct zforce_ts
*ts
, u8
*buf
)
381 struct i2c_client
*client
= ts
->client
;
384 /* read 2 byte message header */
385 ret
= i2c_master_recv(client
, buf
, 2);
387 dev_err(&client
->dev
, "error reading header: %d\n", ret
);
391 if (buf
[PAYLOAD_HEADER
] != FRAME_START
) {
392 dev_err(&client
->dev
, "invalid frame start: %d\n", buf
[0]);
396 if (buf
[PAYLOAD_LENGTH
] == 0) {
397 dev_err(&client
->dev
, "invalid payload length: %d\n",
398 buf
[PAYLOAD_LENGTH
]);
402 /* read the message */
403 ret
= i2c_master_recv(client
, &buf
[PAYLOAD_BODY
], buf
[PAYLOAD_LENGTH
]);
405 dev_err(&client
->dev
, "error reading payload: %d\n", ret
);
409 dev_dbg(&client
->dev
, "read %d bytes for response command 0x%x\n",
410 buf
[PAYLOAD_LENGTH
], buf
[PAYLOAD_BODY
]);
415 static void zforce_complete(struct zforce_ts
*ts
, int cmd
, int result
)
417 struct i2c_client
*client
= ts
->client
;
419 if (ts
->command_waiting
== cmd
) {
420 dev_dbg(&client
->dev
, "completing command 0x%x\n", cmd
);
421 ts
->command_result
= result
;
422 complete(&ts
->command_done
);
424 dev_dbg(&client
->dev
, "command %d not for us\n", cmd
);
428 static irqreturn_t
zforce_irq(int irq
, void *dev_id
)
430 struct zforce_ts
*ts
= dev_id
;
431 struct i2c_client
*client
= ts
->client
;
433 if (ts
->suspended
&& device_may_wakeup(&client
->dev
))
434 pm_wakeup_event(&client
->dev
, 500);
436 return IRQ_WAKE_THREAD
;
439 static irqreturn_t
zforce_irq_thread(int irq
, void *dev_id
)
441 struct zforce_ts
*ts
= dev_id
;
442 struct i2c_client
*client
= ts
->client
;
444 u8 payload_buffer
[FRAME_MAXSIZE
];
449 * When still suspended, return.
450 * Due to the level-interrupt we will get re-triggered later.
457 dev_dbg(&client
->dev
, "handling interrupt\n");
459 /* Don't emit wakeup events from commands run by zforce_suspend */
460 suspending
= READ_ONCE(ts
->suspending
);
461 if (!suspending
&& device_may_wakeup(&client
->dev
))
462 pm_stay_awake(&client
->dev
);
465 * Run at least once and exit the loop if
466 * - the optional interrupt GPIO isn't specified
467 * (there is only one packet read per ISR invocation, then)
469 * - the GPIO isn't active any more
470 * (packet read until the level GPIO indicates that there is
474 error
= zforce_read_packet(ts
, payload_buffer
);
476 dev_err(&client
->dev
,
477 "could not read packet, ret: %d\n", error
);
481 payload
= &payload_buffer
[PAYLOAD_BODY
];
483 switch (payload
[RESPONSE_ID
]) {
484 case NOTIFICATION_TOUCH
:
486 * Always report touch-events received while
487 * suspending, when being a wakeup source
489 if (suspending
&& device_may_wakeup(&client
->dev
))
490 pm_wakeup_event(&client
->dev
, 500);
491 zforce_touch_event(ts
, &payload
[RESPONSE_DATA
]);
494 case NOTIFICATION_BOOTCOMPLETE
:
495 ts
->boot_complete
= payload
[RESPONSE_DATA
];
496 zforce_complete(ts
, payload
[RESPONSE_ID
], 0);
499 case RESPONSE_INITIALIZE
:
500 case RESPONSE_DEACTIVATE
:
501 case RESPONSE_SETCONFIG
:
502 case RESPONSE_RESOLUTION
:
503 case RESPONSE_SCANFREQ
:
504 zforce_complete(ts
, payload
[RESPONSE_ID
],
505 payload
[RESPONSE_DATA
]);
508 case RESPONSE_STATUS
:
510 * Version Payload Results
511 * [2:major] [2:minor] [2:build] [2:rev]
514 get_unaligned_le16(&payload
[RESPONSE_DATA
]);
516 get_unaligned_le16(&payload
[RESPONSE_DATA
+ 2]);
518 get_unaligned_le16(&payload
[RESPONSE_DATA
+ 4]);
520 get_unaligned_le16(&payload
[RESPONSE_DATA
+ 6]);
522 dev_dbg(&ts
->client
->dev
,
523 "Firmware Version %04x:%04x %04x:%04x\n",
524 ts
->version_major
, ts
->version_minor
,
525 ts
->version_build
, ts
->version_rev
);
527 zforce_complete(ts
, payload
[RESPONSE_ID
], 0);
530 case NOTIFICATION_INVALID_COMMAND
:
531 dev_err(&ts
->client
->dev
, "invalid command: 0x%x\n",
532 payload
[RESPONSE_DATA
]);
536 dev_err(&ts
->client
->dev
,
537 "unrecognized response id: 0x%x\n",
538 payload
[RESPONSE_ID
]);
541 } while (gpiod_get_value_cansleep(ts
->gpio_int
));
543 if (!suspending
&& device_may_wakeup(&client
->dev
))
544 pm_relax(&client
->dev
);
546 dev_dbg(&client
->dev
, "finished interrupt\n");
551 static int zforce_input_open(struct input_dev
*dev
)
553 struct zforce_ts
*ts
= input_get_drvdata(dev
);
555 return zforce_start(ts
);
558 static void zforce_input_close(struct input_dev
*dev
)
560 struct zforce_ts
*ts
= input_get_drvdata(dev
);
561 struct i2c_client
*client
= ts
->client
;
564 error
= zforce_stop(ts
);
566 dev_warn(&client
->dev
, "stopping zforce failed\n");
569 static int __zforce_suspend(struct zforce_ts
*ts
)
571 struct i2c_client
*client
= ts
->client
;
572 struct input_dev
*input
= ts
->input
;
575 guard(mutex
)(&input
->mutex
);
578 * When configured as a wakeup source device should always wake
579 * the system, therefore start device if necessary.
581 if (device_may_wakeup(&client
->dev
)) {
582 dev_dbg(&client
->dev
, "suspend while being a wakeup source\n");
584 /* Need to start device, if not open, to be a wakeup source. */
585 if (!input_device_enabled(input
)) {
586 error
= zforce_start(ts
);
591 enable_irq_wake(client
->irq
);
592 } else if (input_device_enabled(input
)) {
593 dev_dbg(&client
->dev
,
594 "suspend without being a wakeup source\n");
596 error
= zforce_stop(ts
);
600 disable_irq(client
->irq
);
603 ts
->suspended
= true;
607 static int zforce_suspend(struct device
*dev
)
609 struct i2c_client
*client
= to_i2c_client(dev
);
610 struct zforce_ts
*ts
= i2c_get_clientdata(client
);
613 WRITE_ONCE(ts
->suspending
, true);
616 ret
= __zforce_suspend(ts
);
619 WRITE_ONCE(ts
->suspending
, false);
624 static int zforce_resume(struct device
*dev
)
626 struct i2c_client
*client
= to_i2c_client(dev
);
627 struct zforce_ts
*ts
= i2c_get_clientdata(client
);
628 struct input_dev
*input
= ts
->input
;
631 guard(mutex
)(&input
->mutex
);
633 ts
->suspended
= false;
635 if (device_may_wakeup(&client
->dev
)) {
636 dev_dbg(&client
->dev
, "resume from being a wakeup source\n");
638 disable_irq_wake(client
->irq
);
640 /* need to stop device if it was not open on suspend */
641 if (!input_device_enabled(input
)) {
642 error
= zforce_stop(ts
);
646 } else if (input_device_enabled(input
)) {
647 dev_dbg(&client
->dev
, "resume without being a wakeup source\n");
649 enable_irq(client
->irq
);
651 error
= zforce_start(ts
);
659 static DEFINE_SIMPLE_DEV_PM_OPS(zforce_pm_ops
, zforce_suspend
, zforce_resume
);
661 static void zforce_reset(void *data
)
663 struct zforce_ts
*ts
= data
;
665 gpiod_set_value_cansleep(ts
->gpio_rst
, 1);
669 static void zforce_ts_parse_legacy_properties(struct zforce_ts
*ts
)
674 device_property_read_u32(&ts
->client
->dev
, "x-size", &x_max
);
675 input_set_abs_params(ts
->input
, ABS_MT_POSITION_X
, 0, x_max
, 0, 0);
677 device_property_read_u32(&ts
->client
->dev
, "y-size", &y_max
);
678 input_set_abs_params(ts
->input
, ABS_MT_POSITION_Y
, 0, y_max
, 0, 0);
681 static int zforce_probe(struct i2c_client
*client
)
683 struct zforce_ts
*ts
;
684 struct input_dev
*input_dev
;
687 ts
= devm_kzalloc(&client
->dev
, sizeof(struct zforce_ts
), GFP_KERNEL
);
691 ts
->gpio_rst
= devm_gpiod_get_optional(&client
->dev
, "reset",
693 error
= PTR_ERR_OR_ZERO(ts
->gpio_rst
);
695 return dev_err_probe(&client
->dev
, error
,
696 "failed to request reset GPIO\n");
699 ts
->gpio_int
= devm_gpiod_get_optional(&client
->dev
, "irq",
701 error
= PTR_ERR_OR_ZERO(ts
->gpio_int
);
703 return dev_err_probe(&client
->dev
, error
,
704 "failed to request interrupt GPIO\n");
707 * Deprecated GPIO handling for compatibility
708 * with legacy binding.
712 ts
->gpio_int
= devm_gpiod_get_index(&client
->dev
, NULL
, 0,
715 error
= PTR_ERR_OR_ZERO(ts
->gpio_int
);
717 return dev_err_probe(&client
->dev
, error
,
718 "failed to request interrupt GPIO\n");
721 ts
->gpio_rst
= devm_gpiod_get_index(&client
->dev
, NULL
, 1,
723 error
= PTR_ERR_OR_ZERO(ts
->gpio_rst
);
725 return dev_err_probe(&client
->dev
, error
,
726 "failed to request reset GPIO\n");
729 error
= devm_regulator_get_enable(&client
->dev
, "vdd");
731 return dev_err_probe(&client
->dev
, error
,
732 "failed to request vdd supply\n");
735 * According to datasheet add 100us grace time after regular
736 * regulator enable delay.
738 usleep_range(100, 200);
740 error
= devm_add_action_or_reset(&client
->dev
, zforce_reset
, ts
);
742 return dev_err_probe(&client
->dev
, error
,
743 "failed to register reset action\n");
745 snprintf(ts
->phys
, sizeof(ts
->phys
),
746 "%s/input0", dev_name(&client
->dev
));
748 input_dev
= devm_input_allocate_device(&client
->dev
);
750 return dev_err_probe(&client
->dev
, -ENOMEM
,
751 "could not allocate input device\n");
754 ts
->input
= input_dev
;
756 input_dev
->name
= "Neonode zForce touchscreen";
757 input_dev
->phys
= ts
->phys
;
758 input_dev
->id
.bustype
= BUS_I2C
;
760 input_dev
->open
= zforce_input_open
;
761 input_dev
->close
= zforce_input_close
;
763 zforce_ts_parse_legacy_properties(ts
);
764 touchscreen_parse_properties(input_dev
, true, &ts
->prop
);
765 if (ts
->prop
.max_x
== 0 || ts
->prop
.max_y
== 0)
766 return dev_err_probe(&client
->dev
, -EINVAL
, "no size specified");
768 input_set_abs_params(input_dev
, ABS_MT_TOUCH_MAJOR
, 0,
769 ZFORCE_MAX_AREA
, 0, 0);
770 input_set_abs_params(input_dev
, ABS_MT_TOUCH_MINOR
, 0,
771 ZFORCE_MAX_AREA
, 0, 0);
772 input_set_abs_params(input_dev
, ABS_MT_ORIENTATION
, 0, 1, 0, 0);
774 error
= input_mt_init_slots(input_dev
, ZFORCE_REPORT_POINTS
,
779 input_set_drvdata(ts
->input
, ts
);
781 init_completion(&ts
->command_done
);
784 * The zforce pulls the interrupt low when it has data ready.
785 * After it is triggered the isr thread runs until all the available
786 * packets have been read and the interrupt is high again.
787 * Therefore we can trigger the interrupt anytime it is low and do
788 * not need to limit it to the interrupt edge.
790 error
= devm_request_threaded_irq(&client
->dev
, client
->irq
,
791 zforce_irq
, zforce_irq_thread
,
792 IRQF_ONESHOT
, input_dev
->name
, ts
);
794 return dev_err_probe(&client
->dev
, error
,
795 "irq %d request failed\n", client
->irq
);
797 i2c_set_clientdata(client
, ts
);
799 /* let the controller boot */
800 gpiod_set_value_cansleep(ts
->gpio_rst
, 0);
802 ts
->command_waiting
= NOTIFICATION_BOOTCOMPLETE
;
803 if (wait_for_completion_timeout(&ts
->command_done
, WAIT_TIMEOUT
) == 0)
804 dev_warn(&client
->dev
, "bootcomplete timed out\n");
806 /* need to start device to get version information */
807 error
= zforce_command_wait(ts
, COMMAND_INITIALIZE
);
809 return dev_err_probe(&client
->dev
, error
, "unable to initialize\n");
811 /* this gets the firmware version among other information */
812 error
= zforce_command_wait(ts
, COMMAND_STATUS
);
814 dev_err_probe(&client
->dev
, error
, "couldn't get status\n");
819 /* stop device and put it into sleep until it is opened */
820 error
= zforce_stop(ts
);
824 device_set_wakeup_capable(&client
->dev
, true);
826 error
= input_register_device(input_dev
);
828 return dev_err_probe(&client
->dev
, error
,
829 "could not register input device\n");
834 static const struct i2c_device_id zforce_idtable
[] = {
838 MODULE_DEVICE_TABLE(i2c
, zforce_idtable
);
841 static const struct of_device_id zforce_dt_idtable
[] = {
842 { .compatible
= "neonode,zforce" },
845 MODULE_DEVICE_TABLE(of
, zforce_dt_idtable
);
848 static struct i2c_driver zforce_driver
= {
851 .pm
= pm_sleep_ptr(&zforce_pm_ops
),
852 .of_match_table
= of_match_ptr(zforce_dt_idtable
),
853 .probe_type
= PROBE_PREFER_ASYNCHRONOUS
,
855 .probe
= zforce_probe
,
856 .id_table
= zforce_idtable
,
859 module_i2c_driver(zforce_driver
);
861 MODULE_AUTHOR("Heiko Stuebner <heiko@sntech.de>");
862 MODULE_DESCRIPTION("zForce TouchScreen Driver");
863 MODULE_LICENSE("GPL");