1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* -------------------------------------------------------------------------
3 * Copyright (C) 2014-2015, Intel Corporation
7 * Copyright (C) 2010-2015, Shanghai Sileadinc Co.Ltd
9 * -------------------------------------------------------------------------
12 #include <linux/i2c.h>
13 #include <linux/module.h>
14 #include <linux/acpi.h>
15 #include <linux/interrupt.h>
16 #include <linux/gpio/consumer.h>
17 #include <linux/delay.h>
18 #include <linux/firmware.h>
19 #include <linux/input.h>
20 #include <linux/input/mt.h>
21 #include <linux/input/touchscreen.h>
23 #include <linux/pm_runtime.h>
24 #include <linux/irq.h>
25 #include <linux/regulator/consumer.h>
27 #include <linux/unaligned.h>
29 #define SILEAD_TS_NAME "silead_ts"
31 #define SILEAD_REG_RESET 0xE0
32 #define SILEAD_REG_DATA 0x80
33 #define SILEAD_REG_TOUCH_NR 0x80
34 #define SILEAD_REG_POWER 0xBC
35 #define SILEAD_REG_CLOCK 0xE4
36 #define SILEAD_REG_STATUS 0xB0
37 #define SILEAD_REG_ID 0xFC
38 #define SILEAD_REG_MEM_CHECK 0xB0
40 #define SILEAD_STATUS_OK 0x5A5A5A5A
41 #define SILEAD_TS_DATA_LEN 44
42 #define SILEAD_CLOCK 0x04
44 #define SILEAD_CMD_RESET 0x88
45 #define SILEAD_CMD_START 0x00
47 #define SILEAD_POINT_DATA_LEN 0x04
48 #define SILEAD_POINT_Y_OFF 0x00
49 #define SILEAD_POINT_Y_MSB_OFF 0x01
50 #define SILEAD_POINT_X_OFF 0x02
51 #define SILEAD_POINT_X_MSB_OFF 0x03
52 #define SILEAD_EXTRA_DATA_MASK 0xF0
54 #define SILEAD_CMD_SLEEP_MIN 10000
55 #define SILEAD_CMD_SLEEP_MAX 20000
56 #define SILEAD_POWER_SLEEP 20
57 #define SILEAD_STARTUP_SLEEP 30
59 #define SILEAD_MAX_FINGERS 10
61 enum silead_ts_power
{
66 struct silead_ts_data
{
67 struct i2c_client
*client
;
68 struct gpio_desc
*gpio_power
;
69 struct input_dev
*input
;
70 struct input_dev
*pen_input
;
71 struct regulator_bulk_data regulators
[2];
73 struct touchscreen_properties prop
;
75 struct input_mt_pos pos
[SILEAD_MAX_FINGERS
];
76 int slots
[SILEAD_MAX_FINGERS
];
77 int id
[SILEAD_MAX_FINGERS
];
78 u32 efi_fw_min_max
[4];
79 bool efi_fw_min_max_set
;
87 struct silead_fw_data
{
92 static void silead_apply_efi_fw_min_max(struct silead_ts_data
*data
)
94 struct input_absinfo
*absinfo_x
= &data
->input
->absinfo
[ABS_MT_POSITION_X
];
95 struct input_absinfo
*absinfo_y
= &data
->input
->absinfo
[ABS_MT_POSITION_Y
];
97 if (!data
->efi_fw_min_max_set
)
100 absinfo_x
->minimum
= data
->efi_fw_min_max
[0];
101 absinfo_x
->maximum
= data
->efi_fw_min_max
[1];
102 absinfo_y
->minimum
= data
->efi_fw_min_max
[2];
103 absinfo_y
->maximum
= data
->efi_fw_min_max
[3];
105 if (data
->prop
.invert_x
) {
106 absinfo_x
->maximum
-= absinfo_x
->minimum
;
107 absinfo_x
->minimum
= 0;
110 if (data
->prop
.invert_y
) {
111 absinfo_y
->maximum
-= absinfo_y
->minimum
;
112 absinfo_y
->minimum
= 0;
115 if (data
->prop
.swap_x_y
) {
116 swap(absinfo_x
->minimum
, absinfo_y
->minimum
);
117 swap(absinfo_x
->maximum
, absinfo_y
->maximum
);
121 static int silead_ts_request_input_dev(struct silead_ts_data
*data
)
123 struct device
*dev
= &data
->client
->dev
;
126 data
->input
= devm_input_allocate_device(dev
);
129 "Failed to allocate input device\n");
133 input_set_abs_params(data
->input
, ABS_MT_POSITION_X
, 0, 4095, 0, 0);
134 input_set_abs_params(data
->input
, ABS_MT_POSITION_Y
, 0, 4095, 0, 0);
135 touchscreen_parse_properties(data
->input
, true, &data
->prop
);
136 silead_apply_efi_fw_min_max(data
);
138 input_mt_init_slots(data
->input
, SILEAD_MAX_FINGERS
,
139 INPUT_MT_DIRECT
| INPUT_MT_DROP_UNUSED
|
142 if (device_property_read_bool(dev
, "silead,home-button"))
143 input_set_capability(data
->input
, EV_KEY
, KEY_LEFTMETA
);
145 data
->input
->name
= SILEAD_TS_NAME
;
146 data
->input
->phys
= "input/ts";
147 data
->input
->id
.bustype
= BUS_I2C
;
149 error
= input_register_device(data
->input
);
151 dev_err(dev
, "Failed to register input device: %d\n", error
);
158 static int silead_ts_request_pen_input_dev(struct silead_ts_data
*data
)
160 struct device
*dev
= &data
->client
->dev
;
163 if (!data
->pen_supported
)
166 data
->pen_input
= devm_input_allocate_device(dev
);
167 if (!data
->pen_input
)
170 input_set_abs_params(data
->pen_input
, ABS_X
, 0, 4095, 0, 0);
171 input_set_abs_params(data
->pen_input
, ABS_Y
, 0, 4095, 0, 0);
172 input_set_capability(data
->pen_input
, EV_KEY
, BTN_TOUCH
);
173 input_set_capability(data
->pen_input
, EV_KEY
, BTN_TOOL_PEN
);
174 set_bit(INPUT_PROP_DIRECT
, data
->pen_input
->propbit
);
175 touchscreen_parse_properties(data
->pen_input
, false, &data
->prop
);
176 input_abs_set_res(data
->pen_input
, ABS_X
, data
->pen_x_res
);
177 input_abs_set_res(data
->pen_input
, ABS_Y
, data
->pen_y_res
);
179 data
->pen_input
->name
= SILEAD_TS_NAME
" pen";
180 data
->pen_input
->phys
= "input/pen";
181 data
->input
->id
.bustype
= BUS_I2C
;
183 error
= input_register_device(data
->pen_input
);
185 dev_err(dev
, "Failed to register pen input device: %d\n", error
);
192 static void silead_ts_set_power(struct i2c_client
*client
,
193 enum silead_ts_power state
)
195 struct silead_ts_data
*data
= i2c_get_clientdata(client
);
197 if (data
->gpio_power
) {
198 gpiod_set_value_cansleep(data
->gpio_power
, state
);
199 msleep(SILEAD_POWER_SLEEP
);
203 static bool silead_ts_handle_pen_data(struct silead_ts_data
*data
, u8
*buf
)
205 u8
*coord
= buf
+ SILEAD_POINT_DATA_LEN
;
206 struct input_mt_pos pos
;
208 if (!data
->pen_supported
|| buf
[2] != 0x00 || buf
[3] != 0x00)
211 if (buf
[0] == 0x00 && buf
[1] == 0x00 && data
->pen_down
) {
212 data
->pen_up_count
++;
213 if (data
->pen_up_count
== 6) {
214 data
->pen_down
= false;
220 if (buf
[0] == 0x01 && buf
[1] == 0x08) {
221 touchscreen_set_mt_pos(&pos
, &data
->prop
,
222 get_unaligned_le16(&coord
[SILEAD_POINT_X_OFF
]) & 0xfff,
223 get_unaligned_le16(&coord
[SILEAD_POINT_Y_OFF
]) & 0xfff);
225 input_report_abs(data
->pen_input
, ABS_X
, pos
.x
);
226 input_report_abs(data
->pen_input
, ABS_Y
, pos
.y
);
228 data
->pen_up_count
= 0;
229 data
->pen_down
= true;
236 input_report_key(data
->pen_input
, BTN_TOOL_PEN
, data
->pen_down
);
237 input_report_key(data
->pen_input
, BTN_TOUCH
, data
->pen_down
);
238 input_sync(data
->pen_input
);
242 static void silead_ts_read_data(struct i2c_client
*client
)
244 struct silead_ts_data
*data
= i2c_get_clientdata(client
);
245 struct input_dev
*input
= data
->input
;
246 struct device
*dev
= &client
->dev
;
247 u8
*bufp
, buf
[SILEAD_TS_DATA_LEN
];
248 int touch_nr
, softbutton
, error
, i
;
249 bool softbutton_pressed
= false;
251 error
= i2c_smbus_read_i2c_block_data(client
, SILEAD_REG_DATA
,
252 SILEAD_TS_DATA_LEN
, buf
);
254 dev_err(dev
, "Data read error %d\n", error
);
258 if (buf
[0] > SILEAD_MAX_FINGERS
) {
259 dev_warn(dev
, "More touches reported then supported %d > %d\n",
260 buf
[0], SILEAD_MAX_FINGERS
);
261 buf
[0] = SILEAD_MAX_FINGERS
;
264 if (silead_ts_handle_pen_data(data
, buf
))
265 goto sync
; /* Pen is down, release all previous touches */
268 bufp
= buf
+ SILEAD_POINT_DATA_LEN
;
269 for (i
= 0; i
< buf
[0]; i
++, bufp
+= SILEAD_POINT_DATA_LEN
) {
270 softbutton
= (bufp
[SILEAD_POINT_Y_MSB_OFF
] &
271 SILEAD_EXTRA_DATA_MASK
) >> 4;
275 * For now only respond to softbutton == 0x01, some
276 * tablets *without* a capacative button send 0x04
277 * when crossing the edges of the screen.
279 if (softbutton
== 0x01)
280 softbutton_pressed
= true;
286 * Bits 4-7 are the touch id, note not all models have
287 * hardware touch ids so atm we don't use these.
289 data
->id
[touch_nr
] = (bufp
[SILEAD_POINT_X_MSB_OFF
] &
290 SILEAD_EXTRA_DATA_MASK
) >> 4;
291 touchscreen_set_mt_pos(&data
->pos
[touch_nr
], &data
->prop
,
292 get_unaligned_le16(&bufp
[SILEAD_POINT_X_OFF
]) & 0xfff,
293 get_unaligned_le16(&bufp
[SILEAD_POINT_Y_OFF
]) & 0xfff);
297 input_mt_assign_slots(input
, data
->slots
, data
->pos
, touch_nr
, 0);
299 for (i
= 0; i
< touch_nr
; i
++) {
300 input_mt_slot(input
, data
->slots
[i
]);
301 input_mt_report_slot_state(input
, MT_TOOL_FINGER
, true);
302 input_report_abs(input
, ABS_MT_POSITION_X
, data
->pos
[i
].x
);
303 input_report_abs(input
, ABS_MT_POSITION_Y
, data
->pos
[i
].y
);
305 dev_dbg(dev
, "x=%d y=%d hw_id=%d sw_id=%d\n", data
->pos
[i
].x
,
306 data
->pos
[i
].y
, data
->id
[i
], data
->slots
[i
]);
310 input_mt_sync_frame(input
);
311 input_report_key(input
, KEY_LEFTMETA
, softbutton_pressed
);
315 static int silead_ts_init(struct i2c_client
*client
)
319 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_RESET
,
323 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
325 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_TOUCH_NR
,
329 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
331 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_CLOCK
,
335 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
337 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_RESET
,
341 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
346 dev_err(&client
->dev
, "Registers clear error %d\n", error
);
350 static int silead_ts_reset(struct i2c_client
*client
)
354 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_RESET
,
358 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
360 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_CLOCK
,
364 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
366 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_POWER
,
370 usleep_range(SILEAD_CMD_SLEEP_MIN
, SILEAD_CMD_SLEEP_MAX
);
375 dev_err(&client
->dev
, "Chip reset error %d\n", error
);
379 static int silead_ts_startup(struct i2c_client
*client
)
383 error
= i2c_smbus_write_byte_data(client
, SILEAD_REG_RESET
, 0x00);
385 dev_err(&client
->dev
, "Startup error %d\n", error
);
389 msleep(SILEAD_STARTUP_SLEEP
);
394 static int silead_ts_load_fw(struct i2c_client
*client
)
396 struct device
*dev
= &client
->dev
;
397 struct silead_ts_data
*data
= i2c_get_clientdata(client
);
398 const struct firmware
*fw
= NULL
;
399 struct silead_fw_data
*fw_data
;
400 unsigned int fw_size
, i
;
403 dev_dbg(dev
, "Firmware file name: %s", data
->fw_name
);
406 * Unfortunately, at the time of writing this comment, we have been unable to
407 * get permission from Silead, or from device OEMs, to distribute the necessary
408 * Silead firmware files in linux-firmware.
410 * On a whole bunch of devices the UEFI BIOS code contains a touchscreen driver,
411 * which contains an embedded copy of the firmware. The fw-loader code has a
412 * "platform" fallback mechanism, which together with info on the firmware
413 * from drivers/platform/x86/touchscreen_dmi.c will use the firmware from the
414 * UEFI driver when the firmware is missing from /lib/firmware. This makes the
415 * touchscreen work OOTB without users needing to manually download the firmware.
417 * The firmware bundled with the original Windows/Android is usually newer then
418 * the firmware in the UEFI driver and it is better calibrated. This better
419 * calibration can lead to significant differences in the reported min/max
422 * To deal with this we first try to load the firmware without "platform"
423 * fallback. If that fails we retry with "platform" fallback and if that
424 * succeeds we apply an (optional) set of alternative min/max values from the
425 * "silead,efi-fw-min-max" property.
427 error
= firmware_request_nowarn(&fw
, data
->fw_name
, dev
);
429 error
= firmware_request_platform(&fw
, data
->fw_name
, dev
);
431 dev_err(dev
, "Firmware request error %d\n", error
);
435 error
= device_property_read_u32_array(dev
, "silead,efi-fw-min-max",
436 data
->efi_fw_min_max
,
437 ARRAY_SIZE(data
->efi_fw_min_max
));
439 data
->efi_fw_min_max_set
= true;
441 /* The EFI (platform) embedded fw does not have pen support */
442 if (data
->pen_supported
) {
443 dev_warn(dev
, "Warning loading '%s' from filesystem failed, using EFI embedded copy.\n",
445 dev_warn(dev
, "Warning pen support is known to be broken in the EFI embedded fw version\n");
446 data
->pen_supported
= false;
450 fw_size
= fw
->size
/ sizeof(*fw_data
);
451 fw_data
= (struct silead_fw_data
*)fw
->data
;
453 for (i
= 0; i
< fw_size
; i
++) {
454 error
= i2c_smbus_write_i2c_block_data(client
,
457 (u8
*)&fw_data
[i
].val
);
459 dev_err(dev
, "Firmware load error %d\n", error
);
464 release_firmware(fw
);
468 static u32
silead_ts_get_status(struct i2c_client
*client
)
473 error
= i2c_smbus_read_i2c_block_data(client
, SILEAD_REG_STATUS
,
474 sizeof(status
), (u8
*)&status
);
476 dev_err(&client
->dev
, "Status read error %d\n", error
);
480 return le32_to_cpu(status
);
483 static int silead_ts_get_id(struct i2c_client
*client
)
485 struct silead_ts_data
*data
= i2c_get_clientdata(client
);
489 error
= i2c_smbus_read_i2c_block_data(client
, SILEAD_REG_ID
,
490 sizeof(chip_id
), (u8
*)&chip_id
);
494 data
->chip_id
= le32_to_cpu(chip_id
);
495 dev_info(&client
->dev
, "Silead chip ID: 0x%8X", data
->chip_id
);
500 static int silead_ts_setup(struct i2c_client
*client
)
506 * Some buggy BIOS-es bring up the chip in a stuck state where it
507 * blocks the I2C bus. The following steps are necessary to
508 * unstuck the chip / bus:
509 * 1. Turn off the Silead chip.
510 * 2. Try to do an I2C transfer with the chip, this will fail in
511 * response to which the I2C-bus-driver will call:
512 * i2c_recover_bus() which will unstuck the I2C-bus. Note the
513 * unstuck-ing of the I2C bus only works if we first drop the
514 * chip off the bus by turning it off.
515 * 3. Turn the chip back on.
517 * On the x86/ACPI systems were this problem is seen, step 1. and
518 * 3. require making ACPI calls and dealing with ACPI Power
519 * Resources. The workaround below runtime-suspends the chip to
520 * turn it off, leaving it up to the ACPI subsystem to deal with
524 if (device_property_read_bool(&client
->dev
,
525 "silead,stuck-controller-bug")) {
526 pm_runtime_set_active(&client
->dev
);
527 pm_runtime_enable(&client
->dev
);
528 pm_runtime_allow(&client
->dev
);
530 pm_runtime_suspend(&client
->dev
);
532 dev_warn(&client
->dev
, FW_BUG
"Stuck I2C bus: please ignore the next 'controller timed out' error\n");
533 silead_ts_get_id(client
);
535 /* The forbid will also resume the device */
536 pm_runtime_forbid(&client
->dev
);
537 pm_runtime_disable(&client
->dev
);
540 silead_ts_set_power(client
, SILEAD_POWER_OFF
);
541 silead_ts_set_power(client
, SILEAD_POWER_ON
);
543 error
= silead_ts_get_id(client
);
545 dev_err(&client
->dev
, "Chip ID read error %d\n", error
);
549 error
= silead_ts_init(client
);
553 error
= silead_ts_reset(client
);
557 error
= silead_ts_load_fw(client
);
561 error
= silead_ts_startup(client
);
565 status
= silead_ts_get_status(client
);
566 if (status
!= SILEAD_STATUS_OK
) {
567 dev_err(&client
->dev
,
568 "Initialization error, status: 0x%X\n", status
);
575 static irqreturn_t
silead_ts_threaded_irq_handler(int irq
, void *id
)
577 struct silead_ts_data
*data
= id
;
578 struct i2c_client
*client
= data
->client
;
580 silead_ts_read_data(client
);
585 static void silead_ts_read_props(struct i2c_client
*client
)
587 struct silead_ts_data
*data
= i2c_get_clientdata(client
);
588 struct device
*dev
= &client
->dev
;
592 error
= device_property_read_string(dev
, "firmware-name", &str
);
594 snprintf(data
->fw_name
, sizeof(data
->fw_name
),
597 dev_dbg(dev
, "Firmware file name read error. Using default.");
599 data
->pen_supported
= device_property_read_bool(dev
, "silead,pen-supported");
600 device_property_read_u32(dev
, "silead,pen-resolution-x", &data
->pen_x_res
);
601 device_property_read_u32(dev
, "silead,pen-resolution-y", &data
->pen_y_res
);
605 static int silead_ts_set_default_fw_name(struct silead_ts_data
*data
,
606 const struct i2c_device_id
*id
)
608 const struct acpi_device_id
*acpi_id
;
609 struct device
*dev
= &data
->client
->dev
;
612 if (ACPI_HANDLE(dev
)) {
613 acpi_id
= acpi_match_device(dev
->driver
->acpi_match_table
, dev
);
617 snprintf(data
->fw_name
, sizeof(data
->fw_name
),
618 "silead/%s.fw", acpi_id
->id
);
620 for (i
= 0; i
< strlen(data
->fw_name
); i
++)
621 data
->fw_name
[i
] = tolower(data
->fw_name
[i
]);
623 snprintf(data
->fw_name
, sizeof(data
->fw_name
),
624 "silead/%s.fw", id
->name
);
630 static int silead_ts_set_default_fw_name(struct silead_ts_data
*data
,
631 const struct i2c_device_id
*id
)
633 snprintf(data
->fw_name
, sizeof(data
->fw_name
),
634 "silead/%s.fw", id
->name
);
639 static void silead_disable_regulator(void *arg
)
641 struct silead_ts_data
*data
= arg
;
643 regulator_bulk_disable(ARRAY_SIZE(data
->regulators
), data
->regulators
);
646 static int silead_ts_probe(struct i2c_client
*client
)
648 const struct i2c_device_id
*id
= i2c_client_get_device_id(client
);
649 struct silead_ts_data
*data
;
650 struct device
*dev
= &client
->dev
;
653 if (!i2c_check_functionality(client
->adapter
,
655 I2C_FUNC_SMBUS_READ_I2C_BLOCK
|
656 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
)) {
657 dev_err(dev
, "I2C functionality check failed\n");
661 data
= devm_kzalloc(dev
, sizeof(*data
), GFP_KERNEL
);
665 i2c_set_clientdata(client
, data
);
666 data
->client
= client
;
668 error
= silead_ts_set_default_fw_name(data
, id
);
672 silead_ts_read_props(client
);
674 /* We must have the IRQ provided by DT or ACPI subsystem */
675 if (client
->irq
<= 0)
678 data
->regulators
[0].supply
= "vddio";
679 data
->regulators
[1].supply
= "avdd";
680 error
= devm_regulator_bulk_get(dev
, ARRAY_SIZE(data
->regulators
),
686 * Enable regulators at probe and disable them at remove, we need
687 * to keep the chip powered otherwise it forgets its firmware.
689 error
= regulator_bulk_enable(ARRAY_SIZE(data
->regulators
),
694 error
= devm_add_action_or_reset(dev
, silead_disable_regulator
, data
);
699 data
->gpio_power
= devm_gpiod_get_optional(dev
, "power", GPIOD_OUT_LOW
);
700 if (IS_ERR(data
->gpio_power
))
701 return dev_err_probe(dev
, PTR_ERR(data
->gpio_power
),
702 "Shutdown GPIO request failed\n");
704 error
= silead_ts_setup(client
);
708 error
= silead_ts_request_input_dev(data
);
712 error
= silead_ts_request_pen_input_dev(data
);
716 error
= devm_request_threaded_irq(dev
, client
->irq
,
717 NULL
, silead_ts_threaded_irq_handler
,
718 IRQF_ONESHOT
, client
->name
, data
);
720 if (error
!= -EPROBE_DEFER
)
721 dev_err(dev
, "IRQ request failed %d\n", error
);
728 static int silead_ts_suspend(struct device
*dev
)
730 struct i2c_client
*client
= to_i2c_client(dev
);
732 disable_irq(client
->irq
);
733 silead_ts_set_power(client
, SILEAD_POWER_OFF
);
737 static int silead_ts_resume(struct device
*dev
)
739 struct i2c_client
*client
= to_i2c_client(dev
);
740 bool second_try
= false;
743 silead_ts_set_power(client
, SILEAD_POWER_ON
);
746 error
= silead_ts_reset(client
);
751 error
= silead_ts_load_fw(client
);
756 error
= silead_ts_startup(client
);
760 status
= silead_ts_get_status(client
);
761 if (status
!= SILEAD_STATUS_OK
) {
764 dev_dbg(dev
, "Reloading firmware after unsuccessful resume\n");
767 dev_err(dev
, "Resume error, status: 0x%02x\n", status
);
771 enable_irq(client
->irq
);
776 static DEFINE_SIMPLE_DEV_PM_OPS(silead_ts_pm
, silead_ts_suspend
, silead_ts_resume
);
778 static const struct i2c_device_id silead_ts_id
[] = {
787 MODULE_DEVICE_TABLE(i2c
, silead_ts_id
);
790 static const struct acpi_device_id silead_ts_acpi_match
[] = {
802 MODULE_DEVICE_TABLE(acpi
, silead_ts_acpi_match
);
806 static const struct of_device_id silead_ts_of_match
[] = {
807 { .compatible
= "silead,gsl1680" },
808 { .compatible
= "silead,gsl1688" },
809 { .compatible
= "silead,gsl3670" },
810 { .compatible
= "silead,gsl3675" },
811 { .compatible
= "silead,gsl3692" },
814 MODULE_DEVICE_TABLE(of
, silead_ts_of_match
);
817 static struct i2c_driver silead_ts_driver
= {
818 .probe
= silead_ts_probe
,
819 .id_table
= silead_ts_id
,
821 .name
= SILEAD_TS_NAME
,
822 .acpi_match_table
= ACPI_PTR(silead_ts_acpi_match
),
823 .of_match_table
= of_match_ptr(silead_ts_of_match
),
824 .pm
= pm_sleep_ptr(&silead_ts_pm
),
827 module_i2c_driver(silead_ts_driver
);
829 MODULE_AUTHOR("Robert Dolca <robert.dolca@intel.com>");
830 MODULE_DESCRIPTION("Silead I2C touchscreen driver");
831 MODULE_LICENSE("GPL");