blob: 853a7ce4601cd1f0d508197b27e79455e936e2f1 [file] [log] [blame]
Hans de Goedecef9dd82017-01-23 18:35:30 +01001/*
2 * Silead touchscreen driver DMI based configuration code
3 *
4 * Copyright (c) 2017 Red Hat Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Red Hat authors:
12 * Hans de Goede <hdegoede@redhat.com>
13 */
14
15#include <linux/acpi.h>
16#include <linux/device.h>
17#include <linux/dmi.h>
18#include <linux/i2c.h>
19#include <linux/notifier.h>
20#include <linux/property.h>
21#include <linux/string.h>
22
23struct silead_ts_dmi_data {
24 const char *acpi_name;
Hans de Goedeae311152017-03-22 16:55:53 +010025 const struct property_entry *properties;
Hans de Goedecef9dd82017-01-23 18:35:30 +010026};
27
Hans de Goedeae311152017-03-22 16:55:53 +010028static const struct property_entry cube_iwork8_air_props[] = {
Hans de Goedecef9dd82017-01-23 18:35:30 +010029 PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
30 PROPERTY_ENTRY_U32("touchscreen-size-y", 900),
31 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
32 PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"),
33 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
34 { }
35};
36
37static const struct silead_ts_dmi_data cube_iwork8_air_data = {
38 .acpi_name = "MSSL1680:00",
39 .properties = cube_iwork8_air_props,
40};
41
Hans de Goedeae311152017-03-22 16:55:53 +010042static const struct property_entry jumper_ezpad_mini3_props[] = {
Hans de Goedecef9dd82017-01-23 18:35:30 +010043 PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
44 PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
45 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
46 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
47 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
48 { }
49};
50
51static const struct silead_ts_dmi_data jumper_ezpad_mini3_data = {
52 .acpi_name = "MSSL1680:00",
53 .properties = jumper_ezpad_mini3_props,
54};
55
Hans de Goede828615f2018-05-30 12:43:39 +020056static const struct property_entry jumper_ezpad_6_pro_props[] = {
57 PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
58 PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
59 PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro.fw"),
60 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
61 PROPERTY_ENTRY_BOOL("silead,home-button"),
62 { }
63};
64
65static const struct silead_ts_dmi_data jumper_ezpad_6_pro_data = {
66 .acpi_name = "MSSL1680:00",
67 .properties = jumper_ezpad_6_pro_props,
68};
69
Hans de Goede6b8e7d82017-03-22 16:55:54 +010070static const struct property_entry dexp_ursus_7w_props[] = {
71 PROPERTY_ENTRY_U32("touchscreen-size-x", 890),
72 PROPERTY_ENTRY_U32("touchscreen-size-y", 630),
73 PROPERTY_ENTRY_STRING("firmware-name", "gsl1686-dexp-ursus-7w.fw"),
74 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goedeaaa40962017-10-19 09:17:28 +020075 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goede6b8e7d82017-03-22 16:55:54 +010076 { }
77};
78
79static const struct silead_ts_dmi_data dexp_ursus_7w_data = {
80 .acpi_name = "MSSL1680:00",
81 .properties = dexp_ursus_7w_props,
82};
83
Bernhard Übelackerf4c12d42017-11-26 19:32:58 +010084static const struct property_entry surftab_twin_10_1_st10432_8_props[] = {
85 PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
86 PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
87 PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1),
88 PROPERTY_ENTRY_STRING("firmware-name",
89 "gsl3670-surftab-twin-10-1-st10432-8.fw"),
90 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
91 { }
92};
93
94static const struct silead_ts_dmi_data surftab_twin_10_1_st10432_8_data = {
95 .acpi_name = "MSSL1680:00",
96 .properties = surftab_twin_10_1_st10432_8_props,
97};
98
Hans de Goede5b7bb3a2017-04-09 11:07:44 +020099static const struct property_entry surftab_wintron70_st70416_6_props[] = {
100 PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
101 PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
102 PROPERTY_ENTRY_STRING("firmware-name",
103 "gsl1686-surftab-wintron70-st70416-6.fw"),
104 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goedeaaa40962017-10-19 09:17:28 +0200105 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200106 { }
107};
108
109static const struct silead_ts_dmi_data surftab_wintron70_st70416_6_data = {
110 .acpi_name = "MSSL1680:00",
111 .properties = surftab_wintron70_st70416_6_props,
112};
113
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200114static const struct property_entry gp_electronic_t701_props[] = {
115 PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
116 PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
Hans de Goede5c24c052017-10-19 09:44:14 +0200117 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
118 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200119 PROPERTY_ENTRY_STRING("firmware-name",
120 "gsl1680-gp-electronic-t701.fw"),
121 { }
122};
123
124static const struct silead_ts_dmi_data gp_electronic_t701_data = {
125 .acpi_name = "MSSL1680:00",
126 .properties = gp_electronic_t701_props,
127};
128
Hans de Goede13fadfa2017-06-15 08:48:32 +0200129static const struct property_entry pipo_w2s_props[] = {
130 PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
131 PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
132 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
133 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
134 PROPERTY_ENTRY_STRING("firmware-name",
135 "gsl1680-pipo-w2s.fw"),
136 { }
137};
138
139static const struct silead_ts_dmi_data pipo_w2s_data = {
140 .acpi_name = "MSSL1680:00",
141 .properties = pipo_w2s_props,
142};
143
Hans de Goede3cd33db2018-05-30 12:43:40 +0200144static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
145 PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
146 PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
147 PROPERTY_ENTRY_U32("touchscreen-size-x", 1692),
148 PROPERTY_ENTRY_U32("touchscreen-size-y", 1146),
149 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
150 PROPERTY_ENTRY_STRING("firmware-name",
151 "gsl3680-pov-mobii-wintab-p800w-v20.fw"),
152 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
153 PROPERTY_ENTRY_BOOL("silead,home-button"),
154 { }
155};
156
157static const struct silead_ts_dmi_data pov_mobii_wintab_p800w_v20_data = {
158 .acpi_name = "MSSL1680:00",
159 .properties = pov_mobii_wintab_p800w_v20_props,
160};
161
162static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
Hans de Goedef4d342c2017-06-15 08:48:31 +0200163 PROPERTY_ENTRY_U32("touchscreen-size-x", 1800),
164 PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
165 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
166 PROPERTY_ENTRY_STRING("firmware-name",
167 "gsl3692-pov-mobii-wintab-p800w.fw"),
Hans de Goedeaaa40962017-10-19 09:17:28 +0200168 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goedef4d342c2017-06-15 08:48:31 +0200169 { }
170};
171
Hans de Goede3cd33db2018-05-30 12:43:40 +0200172static const struct silead_ts_dmi_data pov_mobii_wintab_p800w_v21_data = {
Hans de Goedef4d342c2017-06-15 08:48:31 +0200173 .acpi_name = "MSSL1680:00",
Hans de Goede3cd33db2018-05-30 12:43:40 +0200174 .properties = pov_mobii_wintab_p800w_v21_props,
Hans de Goedef4d342c2017-06-15 08:48:31 +0200175};
176
Hans de Goede4edfc542017-07-01 12:15:22 +0200177static const struct property_entry itworks_tw891_props[] = {
178 PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
179 PROPERTY_ENTRY_U32("touchscreen-size-y", 890),
180 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
181 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
182 PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
183 { }
184};
185
186static const struct silead_ts_dmi_data itworks_tw891_data = {
187 .acpi_name = "MSSL1680:00",
188 .properties = itworks_tw891_props,
189};
190
Hans de Goede485f2a52017-10-04 15:30:12 +0200191static const struct property_entry chuwi_hi8_pro_props[] = {
192 PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
193 PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
194 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
195 PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"),
Hans de Goedeaaa40962017-10-19 09:17:28 +0200196 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goede485f2a52017-10-04 15:30:12 +0200197 { }
198};
199
200static const struct silead_ts_dmi_data chuwi_hi8_pro_data = {
201 .acpi_name = "MSSL1680:00",
202 .properties = chuwi_hi8_pro_props,
203};
204
Sergey Tshovrebov3fcf2b22017-10-27 12:27:07 +0200205static const struct property_entry digma_citi_e200_props[] = {
206 PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
207 PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
208 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
209 PROPERTY_ENTRY_STRING("firmware-name",
210 "gsl1686-digma_citi_e200.fw"),
211 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
212 PROPERTY_ENTRY_BOOL("silead,home-button"),
213 { }
214};
215
216static const struct silead_ts_dmi_data digma_citi_e200_data = {
217 .acpi_name = "MSSL1680:00",
218 .properties = digma_citi_e200_props,
219};
220
Nerijus Baliunas170e9a52017-12-11 00:02:13 +0200221static const struct property_entry onda_obook_20_plus_props[] = {
222 PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
223 PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
224 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
225 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
226 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
227 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"),
228 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
229 PROPERTY_ENTRY_BOOL("silead,home-button"),
230 { }
231};
232
233static const struct silead_ts_dmi_data onda_obook_20_plus_data = {
234 .acpi_name = "MSSL1680:00",
235 .properties = onda_obook_20_plus_props,
236};
237
Maruyama Shoheid2d541e2017-12-20 11:30:08 +0100238static const struct property_entry chuwi_hi8_props[] = {
239 PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
240 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
241 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
242 PROPERTY_ENTRY_BOOL("silead,home-button"),
243 PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"),
244 { }
245};
246
247static const struct silead_ts_dmi_data chuwi_hi8_data = {
248 .acpi_name = "MSSL0001:00",
249 .properties = chuwi_hi8_props,
250};
251
Hans de Goedef1905b92017-12-20 11:30:09 +0100252static const struct property_entry chuwi_vi8_props[] = {
253 PROPERTY_ENTRY_U32("touchscreen-size-x", 1724),
254 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
255 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
256 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-vi8.fw"),
257 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
258 PROPERTY_ENTRY_BOOL("silead,home-button"),
259 { }
260};
261
262static const struct silead_ts_dmi_data chuwi_vi8_data = {
263 .acpi_name = "MSSL1680:00",
264 .properties = chuwi_vi8_props,
265};
266
Hans de Goede2aeb2c32017-12-25 13:45:25 +0100267static const struct property_entry trekstor_primebook_c13_props[] = {
268 PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
269 PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
270 PROPERTY_ENTRY_STRING("firmware-name",
271 "gsl1680-trekstor-primebook-c13.fw"),
272 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
273 PROPERTY_ENTRY_BOOL("silead,home-button"),
274 { }
275};
276
277static const struct silead_ts_dmi_data trekstor_primebook_c13_data = {
278 .acpi_name = "MSSL1680:00",
279 .properties = trekstor_primebook_c13_props,
280};
281
Paul Cercueila346aa22018-01-02 19:39:27 +0100282static const struct property_entry teclast_x98plus2_props[] = {
283 PROPERTY_ENTRY_U32("touchscreen-size-x", 2048),
284 PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
285 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
286 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
287 PROPERTY_ENTRY_STRING("firmware-name",
288 "gsl1686-teclast_x98plus2.fw"),
289 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
290 { }
291};
292
293static const struct silead_ts_dmi_data teclast_x98plus2_data = {
294 .acpi_name = "MSSL1680:00",
295 .properties = teclast_x98plus2_props,
296};
297
Alberto Poncesc58a4f22018-01-23 18:33:38 +0000298static const struct property_entry teclast_x3_plus_props[] = {
299 PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
300 PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
301 PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"),
302 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
303 PROPERTY_ENTRY_BOOL("silead,home-button"),
304 { }
305};
306
307static const struct silead_ts_dmi_data teclast_x3_plus_data = {
308 .acpi_name = "MSSL1680:00",
309 .properties = teclast_x3_plus_props,
310};
311
Hans de Goedeadf762d2018-05-30 12:43:41 +0200312static const struct property_entry onda_v891w_v1_props[] = {
313 PROPERTY_ENTRY_U32("touchscreen-min-x", 46),
314 PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
315 PROPERTY_ENTRY_U32("touchscreen-size-x", 1676),
316 PROPERTY_ENTRY_U32("touchscreen-size-y", 1130),
317 PROPERTY_ENTRY_STRING("firmware-name",
318 "gsl3680-onda-v891w-v1.fw"),
319 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
320 PROPERTY_ENTRY_BOOL("silead,home-button"),
321 { }
322};
323
324static const struct silead_ts_dmi_data onda_v891w_v1_data = {
325 .acpi_name = "MSSL1680:00",
326 .properties = onda_v891w_v1_props,
327};
328
Hans de Goedecef9dd82017-01-23 18:35:30 +0100329static const struct dmi_system_id silead_ts_dmi_table[] = {
330 {
331 /* CUBE iwork8 Air */
332 .driver_data = (void *)&cube_iwork8_air_data,
333 .matches = {
334 DMI_MATCH(DMI_SYS_VENDOR, "cube"),
335 DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"),
336 DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
337 },
338 },
339 {
340 /* Jumper EZpad mini3 */
341 .driver_data = (void *)&jumper_ezpad_mini3_data,
342 .matches = {
343 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
344 /* jumperx.T87.KFBNEEA02 with the version-nr dropped */
345 DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
346 },
347 },
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100348 {
Hans de Goede828615f2018-05-30 12:43:39 +0200349 /* Jumper EZpad 6 Pro */
350 .driver_data = (void *)&jumper_ezpad_6_pro_data,
351 .matches = {
352 DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
353 DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
354 DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
355 /* Above matches are too generic, add bios-date match */
356 DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"),
357 },
358 },
359 {
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100360 /* DEXP Ursus 7W */
361 .driver_data = (void *)&dexp_ursus_7w_data,
362 .matches = {
363 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
364 DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
365 },
366 },
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200367 {
Bernhard Übelackerf4c12d42017-11-26 19:32:58 +0100368 /* TrekStor SurfTab twin 10.1 ST10432-8 */
369 .driver_data = (void *)&surftab_twin_10_1_st10432_8_data,
370 .matches = {
371 DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
372 DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"),
373 },
374 },
375 {
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200376 /* Trekstor Surftab Wintron 7.0 ST70416-6 */
377 .driver_data = (void *)&surftab_wintron70_st70416_6_data,
378 .matches = {
379 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
380 DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"),
381 /* Exact match, different versions need different fw */
382 DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
383 },
384 },
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200385 {
Hans de Goede4245c152018-01-16 20:24:15 +0100386 /* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */
387 .driver_data = (void *)&surftab_wintron70_st70416_6_data,
388 .matches = {
389 DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
390 DMI_MATCH(DMI_PRODUCT_NAME,
391 "SurfTab wintron 7.0 ST70416-6"),
392 /* Exact match, different versions need different fw */
393 DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"),
394 },
395 },
396 {
Hans de Goedec3a73ed2017-07-12 13:15:11 +0200397 /* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
398 .driver_data = (void *)&surftab_wintron70_st70416_6_data,
399 .matches = {
400 DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
401 DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
402 /* Exact match, different versions need different fw */
403 DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
404 },
405 },
406 {
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200407 /* GP-electronic T701 */
408 .driver_data = (void *)&gp_electronic_t701_data,
409 .matches = {
410 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
411 DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
412 DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
413 },
414 },
Hans de Goede13fadfa2017-06-15 08:48:32 +0200415 {
416 /* Pipo W2S */
417 .driver_data = (void *)&pipo_w2s_data,
418 .matches = {
419 DMI_MATCH(DMI_SYS_VENDOR, "PIPO"),
420 DMI_MATCH(DMI_PRODUCT_NAME, "W2S"),
421 },
422 },
Hans de Goedef4d342c2017-06-15 08:48:31 +0200423 {
Hans de Goede3cd33db2018-05-30 12:43:40 +0200424 /* Point of View mobii wintab p800w (v2.0) */
425 .driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
426 .matches = {
427 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
428 DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
429 DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1014"),
430 /* Above matches are too generic, add bios-date match */
431 DMI_MATCH(DMI_BIOS_DATE, "10/24/2014"),
432 },
433 },
434 {
435 /* Point of View mobii wintab p800w (v2.1) */
436 .driver_data = (void *)&pov_mobii_wintab_p800w_v21_data,
Hans de Goedef4d342c2017-06-15 08:48:31 +0200437 .matches = {
438 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
439 DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
440 DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"),
441 /* Above matches are too generic, add bios-date match */
442 DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
443 },
444 },
Hans de Goede4edfc542017-07-01 12:15:22 +0200445 {
446 /* I.T.Works TW891 */
447 .driver_data = (void *)&itworks_tw891_data,
448 .matches = {
449 DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
450 DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
451 },
452 },
Hans de Goede485f2a52017-10-04 15:30:12 +0200453 {
454 /* Chuwi Hi8 Pro */
455 .driver_data = (void *)&chuwi_hi8_pro_data,
456 .matches = {
457 DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"),
458 DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
459 },
460 },
Sergey Tshovrebov3fcf2b22017-10-27 12:27:07 +0200461 {
462 /* Digma Citi E200 */
463 .driver_data = (void *)&digma_citi_e200_data,
464 .matches = {
465 DMI_MATCH(DMI_SYS_VENDOR, "Digma"),
466 DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"),
467 DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
468 },
469 },
Nerijus Baliunas170e9a52017-12-11 00:02:13 +0200470 {
471 /* Onda oBook 20 Plus */
472 .driver_data = (void *)&onda_obook_20_plus_data,
473 .matches = {
474 DMI_MATCH(DMI_SYS_VENDOR, "ONDA"),
475 DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
476 },
477 },
Maruyama Shoheid2d541e2017-12-20 11:30:08 +0100478 {
479 /* Chuwi Hi8 */
480 .driver_data = (void *)&chuwi_hi8_data,
481 .matches = {
482 DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
483 DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
484 },
485 },
Hans de Goedef1905b92017-12-20 11:30:09 +0100486 {
yuk726ed9d12018-06-05 10:16:02 +0900487 /* Chuwi Hi8 (H1D_S806_206) */
488 .driver_data = (void *)&chuwi_hi8_data,
489 .matches = {
490 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
491 DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
492 DMI_MATCH(DMI_BIOS_VERSION, "H1D_S806_206"),
493 },
494 },
495 {
Hans de Goedef1905b92017-12-20 11:30:09 +0100496 /* Chuwi Vi8 (CWI506) */
497 .driver_data = (void *)&chuwi_vi8_data,
498 .matches = {
499 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
500 DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
501 DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
502 },
503 },
Hans de Goede2aeb2c32017-12-25 13:45:25 +0100504 {
505 /* Trekstor Primebook C13 */
506 .driver_data = (void *)&trekstor_primebook_c13_data,
507 .matches = {
508 DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
509 DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
510 },
511 },
Paul Cercueila346aa22018-01-02 19:39:27 +0100512 {
513 /* Teclast X98 Plus II */
514 .driver_data = (void *)&teclast_x98plus2_data,
515 .matches = {
516 DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
517 DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
518 },
519 },
Alberto Poncesc58a4f22018-01-23 18:33:38 +0000520 {
521 /* Teclast X3 Plus */
522 .driver_data = (void *)&teclast_x3_plus_data,
523 .matches = {
524 DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
525 DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"),
526 DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
527 },
528 },
Hans de Goede5488bfd2018-02-22 11:18:38 +0100529 {
530 /* I.T.Works TW701 */
531 .driver_data = (void *)&surftab_wintron70_st70416_6_data,
532 .matches = {
533 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
534 DMI_MATCH(DMI_PRODUCT_NAME, "i71c"),
535 DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"),
536 },
537 },
Hans de Goede24e2bb32018-03-09 15:03:58 +0100538 {
539 /* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
540 .driver_data = (void *)&chuwi_vi8_data,
541 .matches = {
542 DMI_MATCH(DMI_SYS_VENDOR, "YOURS"),
543 DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"),
544 },
545 },
Hans de Goedeadf762d2018-05-30 12:43:41 +0200546 {
547 /* ONDA V891w revision P891WBEBV1B00 aka v1 */
548 .driver_data = (void *)&onda_v891w_v1_data,
549 .matches = {
550 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
551 DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONDA Tablet"),
552 DMI_EXACT_MATCH(DMI_BOARD_VERSION, "V001"),
553 /* Exact match, different versions need different fw */
554 DMI_EXACT_MATCH(DMI_BIOS_VERSION, "ONDA.W89EBBN08"),
555 },
556 },
Hans de Goedecef9dd82017-01-23 18:35:30 +0100557 { },
558};
559
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700560static const struct silead_ts_dmi_data *silead_ts_data;
561
Dmitry Torokhove1053962017-04-03 20:25:13 -0700562static void silead_ts_dmi_add_props(struct i2c_client *client)
Hans de Goedecef9dd82017-01-23 18:35:30 +0100563{
Dmitry Torokhove1053962017-04-03 20:25:13 -0700564 struct device *dev = &client->dev;
Hans de Goedecef9dd82017-01-23 18:35:30 +0100565 int error;
566
Hans de Goedecef9dd82017-01-23 18:35:30 +0100567 if (has_acpi_companion(dev) &&
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700568 !strncmp(silead_ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
569 error = device_add_properties(dev, silead_ts_data->properties);
Hans de Goedecef9dd82017-01-23 18:35:30 +0100570 if (error)
571 dev_err(dev, "failed to add properties: %d\n", error);
572 }
573}
574
575static int silead_ts_dmi_notifier_call(struct notifier_block *nb,
576 unsigned long action, void *data)
577{
578 struct device *dev = data;
Dmitry Torokhove1053962017-04-03 20:25:13 -0700579 struct i2c_client *client;
Hans de Goedecef9dd82017-01-23 18:35:30 +0100580
581 switch (action) {
582 case BUS_NOTIFY_ADD_DEVICE:
Dmitry Torokhove1053962017-04-03 20:25:13 -0700583 client = i2c_verify_client(dev);
584 if (client)
585 silead_ts_dmi_add_props(client);
Hans de Goedecef9dd82017-01-23 18:35:30 +0100586 break;
587
588 default:
589 break;
590 }
591
592 return 0;
593}
594
595static struct notifier_block silead_ts_dmi_notifier = {
596 .notifier_call = silead_ts_dmi_notifier_call,
597};
598
599static int __init silead_ts_dmi_init(void)
600{
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700601 const struct dmi_system_id *dmi_id;
Hans de Goedecef9dd82017-01-23 18:35:30 +0100602 int error;
603
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700604 dmi_id = dmi_first_match(silead_ts_dmi_table);
605 if (!dmi_id)
606 return 0; /* Not an error */
607
608 silead_ts_data = dmi_id->driver_data;
609
Hans de Goedecef9dd82017-01-23 18:35:30 +0100610 error = bus_register_notifier(&i2c_bus_type, &silead_ts_dmi_notifier);
611 if (error)
612 pr_err("%s: failed to register i2c bus notifier: %d\n",
613 __func__, error);
614
615 return error;
616}
617
618/*
619 * We are registering out notifier after i2c core is initialized and i2c bus
620 * itself is ready (which happens at postcore initcall level), but before
621 * ACPI starts enumerating devices (at subsys initcall level).
622 */
623arch_initcall(silead_ts_dmi_init);