1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Touchscreen driver DMI based configuration code
4  *
5  * Copyright (c) 2017 Red Hat Inc.
6  *
7  * Red Hat authors:
8  * Hans de Goede <hdegoede@redhat.com>
9  */
10 
11 #include <linux/acpi.h>
12 #include <linux/device.h>
13 #include <linux/dmi.h>
14 #include <linux/i2c.h>
15 #include <linux/notifier.h>
16 #include <linux/property.h>
17 #include <linux/string.h>
18 
19 struct ts_dmi_data {
20 	const char *acpi_name;
21 	const struct property_entry *properties;
22 };
23 
24 /* NOTE: Please keep all entries sorted alphabetically */
25 
26 static const struct property_entry chuwi_hi8_props[] = {
27 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
28 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
29 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
30 	PROPERTY_ENTRY_BOOL("silead,home-button"),
31 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"),
32 	{ }
33 };
34 
35 static const struct ts_dmi_data chuwi_hi8_data = {
36 	.acpi_name      = "MSSL0001:00",
37 	.properties     = chuwi_hi8_props,
38 };
39 
40 static const struct property_entry chuwi_hi8_air_props[] = {
41 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
42 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
43 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
44 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-hi8-air.fw"),
45 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
46 	{ }
47 };
48 
49 static const struct ts_dmi_data chuwi_hi8_air_data = {
50 	.acpi_name	= "MSSL1680:00",
51 	.properties	= chuwi_hi8_air_props,
52 };
53 
54 static const struct property_entry chuwi_hi8_pro_props[] = {
55 	PROPERTY_ENTRY_U32("touchscreen-min-x", 6),
56 	PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
57 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
58 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
59 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
60 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"),
61 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
62 	PROPERTY_ENTRY_BOOL("silead,home-button"),
63 	{ }
64 };
65 
66 static const struct ts_dmi_data chuwi_hi8_pro_data = {
67 	.acpi_name	= "MSSL1680:00",
68 	.properties	= chuwi_hi8_pro_props,
69 };
70 
71 static const struct property_entry chuwi_hi10_air_props[] = {
72 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1981),
73 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1271),
74 	PROPERTY_ENTRY_U32("touchscreen-min-x", 99),
75 	PROPERTY_ENTRY_U32("touchscreen-min-y", 9),
76 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
77 	PROPERTY_ENTRY_U32("touchscreen-fuzz-x", 5),
78 	PROPERTY_ENTRY_U32("touchscreen-fuzz-y", 4),
79 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi10-air.fw"),
80 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
81 	PROPERTY_ENTRY_BOOL("silead,home-button"),
82 	{ }
83 };
84 
85 static const struct ts_dmi_data chuwi_hi10_air_data = {
86 	.acpi_name	= "MSSL1680:00",
87 	.properties	= chuwi_hi10_air_props,
88 };
89 
90 static const struct property_entry chuwi_hi10_plus_props[] = {
91 	PROPERTY_ENTRY_U32("touchscreen-min-x", 0),
92 	PROPERTY_ENTRY_U32("touchscreen-min-y", 5),
93 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1914),
94 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1283),
95 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi10plus.fw"),
96 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
97 	PROPERTY_ENTRY_BOOL("silead,home-button"),
98 	{ }
99 };
100 
101 static const struct ts_dmi_data chuwi_hi10_plus_data = {
102 	.acpi_name      = "MSSL0017:00",
103 	.properties     = chuwi_hi10_plus_props,
104 };
105 
106 static const struct property_entry chuwi_vi8_props[] = {
107 	PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
108 	PROPERTY_ENTRY_U32("touchscreen-min-y", 6),
109 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1724),
110 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
111 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
112 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-vi8.fw"),
113 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
114 	PROPERTY_ENTRY_BOOL("silead,home-button"),
115 	{ }
116 };
117 
118 static const struct ts_dmi_data chuwi_vi8_data = {
119 	.acpi_name      = "MSSL1680:00",
120 	.properties     = chuwi_vi8_props,
121 };
122 
123 static const struct property_entry chuwi_vi10_props[] = {
124 	PROPERTY_ENTRY_U32("touchscreen-min-x", 0),
125 	PROPERTY_ENTRY_U32("touchscreen-min-y", 4),
126 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1858),
127 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
128 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-vi10.fw"),
129 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
130 	PROPERTY_ENTRY_BOOL("silead,home-button"),
131 	{ }
132 };
133 
134 static const struct ts_dmi_data chuwi_vi10_data = {
135 	.acpi_name      = "MSSL0002:00",
136 	.properties     = chuwi_vi10_props,
137 };
138 
139 static const struct property_entry chuwi_surbook_mini_props[] = {
140 	PROPERTY_ENTRY_U32("touchscreen-min-x", 88),
141 	PROPERTY_ENTRY_U32("touchscreen-min-y", 13),
142 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2040),
143 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1524),
144 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-surbook-mini.fw"),
145 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
146 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
147 	{ }
148 };
149 
150 static const struct ts_dmi_data chuwi_surbook_mini_data = {
151 	.acpi_name      = "MSSL1680:00",
152 	.properties     = chuwi_surbook_mini_props,
153 };
154 
155 static const struct property_entry connect_tablet9_props[] = {
156 	PROPERTY_ENTRY_U32("touchscreen-min-x", 9),
157 	PROPERTY_ENTRY_U32("touchscreen-min-y", 10),
158 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
159 	PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
160 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
161 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
162 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-connect-tablet9.fw"),
163 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
164 	{ }
165 };
166 
167 static const struct ts_dmi_data connect_tablet9_data = {
168 	.acpi_name      = "MSSL1680:00",
169 	.properties     = connect_tablet9_props,
170 };
171 
172 static const struct property_entry cube_iwork8_air_props[] = {
173 	PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
174 	PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
175 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
176 	PROPERTY_ENTRY_U32("touchscreen-size-y", 896),
177 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
178 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"),
179 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
180 	{ }
181 };
182 
183 static const struct ts_dmi_data cube_iwork8_air_data = {
184 	.acpi_name	= "MSSL1680:00",
185 	.properties	= cube_iwork8_air_props,
186 };
187 
188 static const struct property_entry cube_knote_i1101_props[] = {
189 	PROPERTY_ENTRY_U32("touchscreen-min-x", 20),
190 	PROPERTY_ENTRY_U32("touchscreen-min-y",  22),
191 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1961),
192 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1513),
193 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-cube-knote-i1101.fw"),
194 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
195 	PROPERTY_ENTRY_BOOL("silead,home-button"),
196 	{ }
197 };
198 
199 static const struct ts_dmi_data cube_knote_i1101_data = {
200 	.acpi_name	= "MSSL1680:00",
201 	.properties	= cube_knote_i1101_props,
202 };
203 
204 static const struct property_entry dexp_ursus_7w_props[] = {
205 	PROPERTY_ENTRY_U32("touchscreen-size-x", 890),
206 	PROPERTY_ENTRY_U32("touchscreen-size-y", 630),
207 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1686-dexp-ursus-7w.fw"),
208 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
209 	PROPERTY_ENTRY_BOOL("silead,home-button"),
210 	{ }
211 };
212 
213 static const struct ts_dmi_data dexp_ursus_7w_data = {
214 	.acpi_name	= "MSSL1680:00",
215 	.properties	= dexp_ursus_7w_props,
216 };
217 
218 static const struct property_entry digma_citi_e200_props[] = {
219 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
220 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
221 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
222 	PROPERTY_ENTRY_STRING("firmware-name",
223 			      "gsl1686-digma_citi_e200.fw"),
224 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
225 	PROPERTY_ENTRY_BOOL("silead,home-button"),
226 	{ }
227 };
228 
229 static const struct ts_dmi_data digma_citi_e200_data = {
230 	.acpi_name	= "MSSL1680:00",
231 	.properties	= digma_citi_e200_props,
232 };
233 
234 static const struct property_entry gp_electronic_t701_props[] = {
235 	PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
236 	PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
237 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
238 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
239 	PROPERTY_ENTRY_STRING("firmware-name",
240 			      "gsl1680-gp-electronic-t701.fw"),
241 	{ }
242 };
243 
244 static const struct ts_dmi_data gp_electronic_t701_data = {
245 	.acpi_name	= "MSSL1680:00",
246 	.properties	= gp_electronic_t701_props,
247 };
248 
249 static const struct property_entry irbis_tw90_props[] = {
250 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1720),
251 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1138),
252 	PROPERTY_ENTRY_U32("touchscreen-min-x", 8),
253 	PROPERTY_ENTRY_U32("touchscreen-min-y", 14),
254 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
255 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
256 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-irbis_tw90.fw"),
257 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
258 	PROPERTY_ENTRY_BOOL("silead,home-button"),
259 	{ }
260 };
261 
262 static const struct ts_dmi_data irbis_tw90_data = {
263 	.acpi_name	= "MSSL1680:00",
264 	.properties	= irbis_tw90_props,
265 };
266 
267 static const struct property_entry itworks_tw891_props[] = {
268 	PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
269 	PROPERTY_ENTRY_U32("touchscreen-min-y", 5),
270 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
271 	PROPERTY_ENTRY_U32("touchscreen-size-y", 896),
272 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
273 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
274 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
275 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
276 	{ }
277 };
278 
279 static const struct ts_dmi_data itworks_tw891_data = {
280 	.acpi_name	= "MSSL1680:00",
281 	.properties	= itworks_tw891_props,
282 };
283 
284 static const struct property_entry jumper_ezpad_6_pro_props[] = {
285 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
286 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
287 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro.fw"),
288 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
289 	PROPERTY_ENTRY_BOOL("silead,home-button"),
290 	{ }
291 };
292 
293 static const struct ts_dmi_data jumper_ezpad_6_pro_data = {
294 	.acpi_name	= "MSSL1680:00",
295 	.properties	= jumper_ezpad_6_pro_props,
296 };
297 
298 static const struct property_entry jumper_ezpad_6_pro_b_props[] = {
299 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
300 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
301 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro-b.fw"),
302 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
303 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
304 	PROPERTY_ENTRY_BOOL("silead,home-button"),
305 	{ }
306 };
307 
308 static const struct ts_dmi_data jumper_ezpad_6_pro_b_data = {
309 	.acpi_name      = "MSSL1680:00",
310 	.properties     = jumper_ezpad_6_pro_b_props,
311 };
312 
313 static const struct property_entry jumper_ezpad_6_m4_props[] = {
314 	PROPERTY_ENTRY_U32("touchscreen-min-x", 35),
315 	PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
316 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1950),
317 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1525),
318 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-m4.fw"),
319 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
320 	PROPERTY_ENTRY_BOOL("silead,home-button"),
321 	{ }
322 };
323 
324 static const struct ts_dmi_data jumper_ezpad_6_m4_data = {
325 	.acpi_name	= "MSSL1680:00",
326 	.properties	= jumper_ezpad_6_m4_props,
327 };
328 
329 static const struct property_entry jumper_ezpad_mini3_props[] = {
330 	PROPERTY_ENTRY_U32("touchscreen-min-x", 23),
331 	PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
332 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
333 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1138),
334 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
335 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
336 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
337 	{ }
338 };
339 
340 static const struct ts_dmi_data jumper_ezpad_mini3_data = {
341 	.acpi_name	= "MSSL1680:00",
342 	.properties	= jumper_ezpad_mini3_props,
343 };
344 
345 static const struct property_entry myria_my8307_props[] = {
346 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1720),
347 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
348 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
349 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
350 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
351 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-myria-my8307.fw"),
352 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
353 	PROPERTY_ENTRY_BOOL("silead,home-button"),
354 	{ }
355 };
356 
357 static const struct ts_dmi_data myria_my8307_data = {
358 	.acpi_name	= "MSSL1680:00",
359 	.properties	= myria_my8307_props,
360 };
361 
362 static const struct property_entry onda_obook_20_plus_props[] = {
363 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
364 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
365 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
366 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
367 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
368 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"),
369 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
370 	PROPERTY_ENTRY_BOOL("silead,home-button"),
371 	{ }
372 };
373 
374 static const struct ts_dmi_data onda_obook_20_plus_data = {
375 	.acpi_name	= "MSSL1680:00",
376 	.properties	= onda_obook_20_plus_props,
377 };
378 
379 static const struct property_entry onda_v80_plus_v3_props[] = {
380 	PROPERTY_ENTRY_U32("touchscreen-min-x", 22),
381 	PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
382 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1698),
383 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
384 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
385 	PROPERTY_ENTRY_STRING("firmware-name",
386 			      "gsl3676-onda-v80-plus-v3.fw"),
387 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
388 	PROPERTY_ENTRY_BOOL("silead,home-button"),
389 	{ }
390 };
391 
392 static const struct ts_dmi_data onda_v80_plus_v3_data = {
393 	.acpi_name	= "MSSL1680:00",
394 	.properties	= onda_v80_plus_v3_props,
395 };
396 
397 static const struct property_entry onda_v820w_32g_props[] = {
398 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
399 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
400 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
401 	PROPERTY_ENTRY_STRING("firmware-name",
402 			      "gsl1680-onda-v820w-32g.fw"),
403 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
404 	PROPERTY_ENTRY_BOOL("silead,home-button"),
405 	{ }
406 };
407 
408 static const struct ts_dmi_data onda_v820w_32g_data = {
409 	.acpi_name	= "MSSL1680:00",
410 	.properties	= onda_v820w_32g_props,
411 };
412 
413 static const struct property_entry onda_v891w_v1_props[] = {
414 	PROPERTY_ENTRY_U32("touchscreen-min-x", 46),
415 	PROPERTY_ENTRY_U32("touchscreen-min-y",  8),
416 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1676),
417 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1130),
418 	PROPERTY_ENTRY_STRING("firmware-name",
419 			      "gsl3680-onda-v891w-v1.fw"),
420 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
421 	PROPERTY_ENTRY_BOOL("silead,home-button"),
422 	{ }
423 };
424 
425 static const struct ts_dmi_data onda_v891w_v1_data = {
426 	.acpi_name	= "MSSL1680:00",
427 	.properties	= onda_v891w_v1_props,
428 };
429 
430 static const struct property_entry onda_v891w_v3_props[] = {
431 	PROPERTY_ENTRY_U32("touchscreen-min-x", 35),
432 	PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
433 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1625),
434 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1135),
435 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
436 	PROPERTY_ENTRY_STRING("firmware-name",
437 			      "gsl3676-onda-v891w-v3.fw"),
438 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
439 	PROPERTY_ENTRY_BOOL("silead,home-button"),
440 	{ }
441 };
442 
443 static const struct ts_dmi_data onda_v891w_v3_data = {
444 	.acpi_name	= "MSSL1680:00",
445 	.properties	= onda_v891w_v3_props,
446 };
447 
448 static const struct property_entry pipo_w2s_props[] = {
449 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
450 	PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
451 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
452 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
453 	PROPERTY_ENTRY_STRING("firmware-name",
454 			      "gsl1680-pipo-w2s.fw"),
455 	{ }
456 };
457 
458 static const struct ts_dmi_data pipo_w2s_data = {
459 	.acpi_name	= "MSSL1680:00",
460 	.properties	= pipo_w2s_props,
461 };
462 
463 static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
464 	PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
465 	PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
466 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1692),
467 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1146),
468 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
469 	PROPERTY_ENTRY_STRING("firmware-name",
470 			      "gsl3680-pov-mobii-wintab-p800w-v20.fw"),
471 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
472 	PROPERTY_ENTRY_BOOL("silead,home-button"),
473 	{ }
474 };
475 
476 static const struct ts_dmi_data pov_mobii_wintab_p800w_v20_data = {
477 	.acpi_name	= "MSSL1680:00",
478 	.properties	= pov_mobii_wintab_p800w_v20_props,
479 };
480 
481 static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
482 	PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
483 	PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
484 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1794),
485 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
486 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
487 	PROPERTY_ENTRY_STRING("firmware-name",
488 			      "gsl3692-pov-mobii-wintab-p800w.fw"),
489 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
490 	PROPERTY_ENTRY_BOOL("silead,home-button"),
491 	{ }
492 };
493 
494 static const struct ts_dmi_data pov_mobii_wintab_p800w_v21_data = {
495 	.acpi_name	= "MSSL1680:00",
496 	.properties	= pov_mobii_wintab_p800w_v21_props,
497 };
498 
499 static const struct property_entry pov_mobii_wintab_p1006w_v10_props[] = {
500 	PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
501 	PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
502 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1984),
503 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1520),
504 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
505 	PROPERTY_ENTRY_STRING("firmware-name",
506 			      "gsl3692-pov-mobii-wintab-p1006w-v10.fw"),
507 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
508 	PROPERTY_ENTRY_BOOL("silead,home-button"),
509 	{ }
510 };
511 
512 static const struct ts_dmi_data pov_mobii_wintab_p1006w_v10_data = {
513 	.acpi_name	= "MSSL1680:00",
514 	.properties	= pov_mobii_wintab_p1006w_v10_props,
515 };
516 
517 static const struct property_entry schneider_sct101ctm_props[] = {
518 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1715),
519 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
520 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
521 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
522 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
523 	PROPERTY_ENTRY_STRING("firmware-name",
524 			      "gsl1680-schneider-sct101ctm.fw"),
525 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
526 	PROPERTY_ENTRY_BOOL("silead,home-button"),
527 	{ }
528 };
529 
530 static const struct ts_dmi_data schneider_sct101ctm_data = {
531 	.acpi_name	= "MSSL1680:00",
532 	.properties	= schneider_sct101ctm_props,
533 };
534 
535 static const struct property_entry teclast_x3_plus_props[] = {
536 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
537 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
538 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"),
539 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
540 	PROPERTY_ENTRY_BOOL("silead,home-button"),
541 	{ }
542 };
543 
544 static const struct ts_dmi_data teclast_x3_plus_data = {
545 	.acpi_name	= "MSSL1680:00",
546 	.properties	= teclast_x3_plus_props,
547 };
548 
549 static const struct property_entry teclast_x98plus2_props[] = {
550 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2048),
551 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
552 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
553 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
554 	PROPERTY_ENTRY_STRING("firmware-name",
555 			      "gsl1686-teclast_x98plus2.fw"),
556 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
557 	{ }
558 };
559 
560 static const struct ts_dmi_data teclast_x98plus2_data = {
561 	.acpi_name	= "MSSL1680:00",
562 	.properties	= teclast_x98plus2_props,
563 };
564 
565 static const struct property_entry trekstor_primebook_c11_props[] = {
566 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1970),
567 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1530),
568 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
569 	PROPERTY_ENTRY_STRING("firmware-name",
570 			      "gsl1680-trekstor-primebook-c11.fw"),
571 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
572 	PROPERTY_ENTRY_BOOL("silead,home-button"),
573 	{ }
574 };
575 
576 static const struct ts_dmi_data trekstor_primebook_c11_data = {
577 	.acpi_name	= "MSSL1680:00",
578 	.properties	= trekstor_primebook_c11_props,
579 };
580 
581 static const struct property_entry trekstor_primebook_c13_props[] = {
582 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
583 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
584 	PROPERTY_ENTRY_STRING("firmware-name",
585 			      "gsl1680-trekstor-primebook-c13.fw"),
586 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
587 	PROPERTY_ENTRY_BOOL("silead,home-button"),
588 	{ }
589 };
590 
591 static const struct ts_dmi_data trekstor_primebook_c13_data = {
592 	.acpi_name	= "MSSL1680:00",
593 	.properties	= trekstor_primebook_c13_props,
594 };
595 
596 static const struct property_entry trekstor_primetab_t13b_props[] = {
597 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2500),
598 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1900),
599 	PROPERTY_ENTRY_STRING("firmware-name",
600 			      "gsl1680-trekstor-primetab-t13b.fw"),
601 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
602 	PROPERTY_ENTRY_BOOL("silead,home-button"),
603 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
604 	{ }
605 };
606 
607 static const struct ts_dmi_data trekstor_primetab_t13b_data = {
608 	.acpi_name  = "MSSL1680:00",
609 	.properties = trekstor_primetab_t13b_props,
610 };
611 
612 static const struct property_entry trekstor_surftab_twin_10_1_props[] = {
613 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
614 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
615 	PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1),
616 	PROPERTY_ENTRY_STRING("firmware-name",
617 			      "gsl3670-surftab-twin-10-1-st10432-8.fw"),
618 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
619 	{ }
620 };
621 
622 static const struct ts_dmi_data trekstor_surftab_twin_10_1_data = {
623 	.acpi_name	= "MSSL1680:00",
624 	.properties	= trekstor_surftab_twin_10_1_props,
625 };
626 
627 static const struct property_entry trekstor_surftab_wintron70_props[] = {
628 	PROPERTY_ENTRY_U32("touchscreen-min-x", 12),
629 	PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
630 	PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
631 	PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
632 	PROPERTY_ENTRY_STRING("firmware-name",
633 			      "gsl1686-surftab-wintron70-st70416-6.fw"),
634 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
635 	PROPERTY_ENTRY_BOOL("silead,home-button"),
636 	{ }
637 };
638 
639 static const struct ts_dmi_data trekstor_surftab_wintron70_data = {
640 	.acpi_name	= "MSSL1680:00",
641 	.properties	= trekstor_surftab_wintron70_props,
642 };
643 
644 /* NOTE: Please keep this table sorted alphabetically */
645 static const struct dmi_system_id touchscreen_dmi_table[] = {
646 	{
647 		/* Chuwi Hi8 */
648 		.driver_data = (void *)&chuwi_hi8_data,
649 		.matches = {
650 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
651 			DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
652 		},
653 	},
654 	{
655 		/* Chuwi Hi8 (H1D_S806_206) */
656 		.driver_data = (void *)&chuwi_hi8_data,
657 		.matches = {
658 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
659 			DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
660 			DMI_MATCH(DMI_BIOS_VERSION, "H1D_S806_206"),
661 		},
662 	},
663 	{
664 		/* Chuwi Hi8 Air (CWI543) */
665 		.driver_data = (void *)&chuwi_hi8_air_data,
666 		.matches = {
667 			DMI_MATCH(DMI_BOARD_VENDOR, "Default string"),
668 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
669 			DMI_MATCH(DMI_PRODUCT_NAME, "Hi8 Air"),
670 		},
671 	},
672 	{
673 		/* Chuwi Hi8 Pro (CWI513) */
674 		.driver_data = (void *)&chuwi_hi8_pro_data,
675 		.matches = {
676 			DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"),
677 			DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
678 		},
679 	},
680 	{
681 		/* Chuwi Hi10 Air */
682 		.driver_data = (void *)&chuwi_hi10_air_data,
683 		.matches = {
684 			DMI_MATCH(DMI_SYS_VENDOR, "CHUWI INNOVATION AND TECHNOLOGY(SHENZHEN)CO.LTD"),
685 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
686 			DMI_MATCH(DMI_PRODUCT_SKU, "P1W6_C109D_B"),
687 		},
688 	},
689 	{
690 		/* Chuwi Hi10 Plus (CWI527) */
691 		.driver_data = (void *)&chuwi_hi10_plus_data,
692 		.matches = {
693 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
694 			DMI_MATCH(DMI_PRODUCT_NAME, "Hi10 plus tablet"),
695 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
696 		},
697 	},
698 	{
699 		/* Chuwi Vi8 (CWI506) */
700 		.driver_data = (void *)&chuwi_vi8_data,
701 		.matches = {
702 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
703 			DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
704 			DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
705 		},
706 	},
707 	{
708 		/* Chuwi Vi10 (CWI505) */
709 		.driver_data = (void *)&chuwi_vi10_data,
710 		.matches = {
711 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
712 			DMI_MATCH(DMI_BOARD_NAME, "BYT-PF02"),
713 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
714 			DMI_MATCH(DMI_PRODUCT_NAME, "S165"),
715 		},
716 	},
717 	{
718 		/* Chuwi Surbook Mini (CWI540) */
719 		.driver_data = (void *)&chuwi_surbook_mini_data,
720 		.matches = {
721 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
722 			DMI_MATCH(DMI_PRODUCT_NAME, "C3W6_AP108_4G"),
723 		},
724 	},
725 	{
726 		/* Connect Tablet 9 */
727 		.driver_data = (void *)&connect_tablet9_data,
728 		.matches = {
729 			DMI_MATCH(DMI_SYS_VENDOR, "Connect"),
730 			DMI_MATCH(DMI_PRODUCT_NAME, "Tablet 9"),
731 		},
732 	},
733 	{
734 		/* CUBE iwork8 Air */
735 		.driver_data = (void *)&cube_iwork8_air_data,
736 		.matches = {
737 			DMI_MATCH(DMI_SYS_VENDOR, "cube"),
738 			DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"),
739 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
740 		},
741 	},
742 	{
743 		/* Cube KNote i1101 */
744 		.driver_data = (void *)&cube_knote_i1101_data,
745 		.matches = {
746 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
747 			DMI_MATCH(DMI_BOARD_NAME, "L1W6_I1101"),
748 			DMI_MATCH(DMI_SYS_VENDOR, "ALLDOCUBE"),
749 			DMI_MATCH(DMI_PRODUCT_NAME, "i1101"),
750 		},
751 	},
752 	{
753 		/* DEXP Ursus 7W */
754 		.driver_data = (void *)&dexp_ursus_7w_data,
755 		.matches = {
756 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
757 			DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
758 		},
759 	},
760 	{
761 		/* Digma Citi E200 */
762 		.driver_data = (void *)&digma_citi_e200_data,
763 		.matches = {
764 			DMI_MATCH(DMI_SYS_VENDOR, "Digma"),
765 			DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"),
766 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
767 		},
768 	},
769 	{
770 		/* GP-electronic T701 */
771 		.driver_data = (void *)&gp_electronic_t701_data,
772 		.matches = {
773 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
774 			DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
775 			DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
776 		},
777 	},
778 	{
779 		/* I.T.Works TW701 (same hardware as the Trekstor ST70416-6) */
780 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
781 		.matches = {
782 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
783 			DMI_MATCH(DMI_PRODUCT_NAME, "i71c"),
784 			DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"),
785 		},
786 	},
787 	{
788 		/* Irbis TW90 */
789 		.driver_data = (void *)&irbis_tw90_data,
790 		.matches = {
791 			DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
792 			DMI_MATCH(DMI_PRODUCT_NAME, "TW90"),
793 		},
794 	},
795 	{
796 		/* I.T.Works TW891 */
797 		.driver_data = (void *)&itworks_tw891_data,
798 		.matches = {
799 			DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
800 			DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
801 		},
802 	},
803 	{
804 		/* Jumper EZpad 6 Pro */
805 		.driver_data = (void *)&jumper_ezpad_6_pro_data,
806 		.matches = {
807 			DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
808 			DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
809 			DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
810 			/* Above matches are too generic, add bios-date match */
811 			DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"),
812 		},
813 	},
814 	{
815 		/* Jumper EZpad 6 Pro B */
816 		.driver_data = (void *)&jumper_ezpad_6_pro_b_data,
817 		.matches = {
818 			DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
819 			DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
820 			DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
821 			/* Above matches are too generic, add bios-date match */
822 			DMI_MATCH(DMI_BIOS_DATE, "04/24/2018"),
823 		},
824 	},
825 	{
826 		/* Jumper EZpad 6 m4 */
827 		.driver_data = (void *)&jumper_ezpad_6_m4_data,
828 		.matches = {
829 			DMI_MATCH(DMI_SYS_VENDOR, "jumper"),
830 			DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
831 			/* Jumper8.S106x.A00C.1066 with the version dropped */
832 			DMI_MATCH(DMI_BIOS_VERSION, "Jumper8.S106x"),
833 		},
834 	},
835 	{
836 		/* Jumper EZpad mini3 */
837 		.driver_data = (void *)&jumper_ezpad_mini3_data,
838 		.matches = {
839 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
840 			/* jumperx.T87.KFBNEEA02 with the version-nr dropped */
841 			DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
842 		},
843 	},
844 	{
845 		/* Mediacom Flexbook Edge 11 (same hw as TS Primebook C11) */
846 		.driver_data = (void *)&trekstor_primebook_c11_data,
847 		.matches = {
848 			DMI_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
849 			DMI_MATCH(DMI_PRODUCT_NAME, "FlexBook edge11 - M-FBE11"),
850 		},
851 	},
852 	{
853 		/* Myria MY8307 */
854 		.driver_data = (void *)&myria_my8307_data,
855 		.matches = {
856 			DMI_MATCH(DMI_SYS_VENDOR, "Complet Electro Serv"),
857 			DMI_MATCH(DMI_PRODUCT_NAME, "MY8307"),
858 		},
859 	},
860 	{
861 		/* Onda oBook 20 Plus */
862 		.driver_data = (void *)&onda_obook_20_plus_data,
863 		.matches = {
864 			DMI_MATCH(DMI_SYS_VENDOR, "ONDA"),
865 			DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
866 		},
867 	},
868 	{
869 		/* ONDA V80 plus v3 (P80PSBG9V3A01501) */
870 		.driver_data = (void *)&onda_v80_plus_v3_data,
871 		.matches = {
872 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONDA"),
873 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V80 PLUS")
874 		},
875 	},
876 	{
877 		/* ONDA V820w DualOS */
878 		.driver_data = (void *)&onda_v820w_32g_data,
879 		.matches = {
880 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
881 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V820w DualOS")
882 		},
883 	},
884 	{
885 		/* ONDA V891w revision P891WBEBV1B00 aka v1 */
886 		.driver_data = (void *)&onda_v891w_v1_data,
887 		.matches = {
888 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
889 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONDA Tablet"),
890 			DMI_EXACT_MATCH(DMI_BOARD_VERSION, "V001"),
891 			/* Exact match, different versions need different fw */
892 			DMI_EXACT_MATCH(DMI_BIOS_VERSION, "ONDA.W89EBBN08"),
893 		},
894 	},
895 	{
896 		/* ONDA V891w Dual OS P891DCF2V1A01274 64GB */
897 		.driver_data = (void *)&onda_v891w_v3_data,
898 		.matches = {
899 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
900 			DMI_MATCH(DMI_PRODUCT_NAME, "ONDA Tablet"),
901 			DMI_MATCH(DMI_BIOS_VERSION, "ONDA.D890HBBNR0A"),
902 		},
903 	},
904 	{
905 		/* Pipo W2S */
906 		.driver_data = (void *)&pipo_w2s_data,
907 		.matches = {
908 			DMI_MATCH(DMI_SYS_VENDOR, "PIPO"),
909 			DMI_MATCH(DMI_PRODUCT_NAME, "W2S"),
910 		},
911 	},
912 	{
913 		/* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
914 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
915 		.matches = {
916 			DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
917 			DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
918 			/* Exact match, different versions need different fw */
919 			DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
920 		},
921 	},
922 	{
923 		/* Point of View mobii wintab p800w (v2.0) */
924 		.driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
925 		.matches = {
926 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
927 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
928 			DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1014"),
929 			/* Above matches are too generic, add bios-date match */
930 			DMI_MATCH(DMI_BIOS_DATE, "10/24/2014"),
931 		},
932 	},
933 	{
934 		/* Point of View mobii wintab p800w (v2.1) */
935 		.driver_data = (void *)&pov_mobii_wintab_p800w_v21_data,
936 		.matches = {
937 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
938 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
939 			DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"),
940 			/* Above matches are too generic, add bios-date match */
941 			DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
942 		},
943 	},
944 	{
945 		/* Point of View mobii wintab p1006w (v1.0) */
946 		.driver_data = (void *)&pov_mobii_wintab_p1006w_v10_data,
947 		.matches = {
948 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
949 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
950 			/* Note 105b is Foxcon's USB/PCI vendor id */
951 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
952 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
953 		},
954 	},
955 	{
956 		/* Schneider SCT101CTM */
957 		.driver_data = (void *)&schneider_sct101ctm_data,
958 		.matches = {
959 			DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
960 			DMI_MATCH(DMI_PRODUCT_NAME, "SCT101CTM"),
961 		},
962 	},
963 	{
964 		/* Teclast X3 Plus */
965 		.driver_data = (void *)&teclast_x3_plus_data,
966 		.matches = {
967 			DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
968 			DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"),
969 			DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
970 		},
971 	},
972 	{
973 		/* Teclast X98 Plus II */
974 		.driver_data = (void *)&teclast_x98plus2_data,
975 		.matches = {
976 			DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
977 			DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
978 		},
979 	},
980 	{
981 		/* Trekstor Primebook C11 */
982 		.driver_data = (void *)&trekstor_primebook_c11_data,
983 		.matches = {
984 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
985 			DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C11"),
986 		},
987 	},
988 	{
989 		/* Trekstor Primebook C11B (same touchscreen as the C11) */
990 		.driver_data = (void *)&trekstor_primebook_c11_data,
991 		.matches = {
992 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
993 			DMI_MATCH(DMI_PRODUCT_NAME, "PRIMEBOOK C11B"),
994 		},
995 	},
996 	{
997 		/* Trekstor Primebook C13 */
998 		.driver_data = (void *)&trekstor_primebook_c13_data,
999 		.matches = {
1000 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
1001 			DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
1002 		},
1003 	},
1004 	{
1005 		/* Trekstor Primetab T13B */
1006 		.driver_data = (void *)&trekstor_primetab_t13b_data,
1007 		.matches = {
1008 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
1009 			DMI_MATCH(DMI_PRODUCT_NAME, "Primetab T13B"),
1010 		},
1011 	},
1012 	{
1013 		/* TrekStor SurfTab twin 10.1 ST10432-8 */
1014 		.driver_data = (void *)&trekstor_surftab_twin_10_1_data,
1015 		.matches = {
1016 			DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
1017 			DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"),
1018 		},
1019 	},
1020 	{
1021 		/* Trekstor Surftab Wintron 7.0 ST70416-6 */
1022 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
1023 		.matches = {
1024 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
1025 			DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"),
1026 			/* Exact match, different versions need different fw */
1027 			DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
1028 		},
1029 	},
1030 	{
1031 		/* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */
1032 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
1033 		.matches = {
1034 			DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
1035 			DMI_MATCH(DMI_PRODUCT_NAME,
1036 					     "SurfTab wintron 7.0 ST70416-6"),
1037 			/* Exact match, different versions need different fw */
1038 			DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"),
1039 		},
1040 	},
1041 	{
1042 		/* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
1043 		.driver_data = (void *)&chuwi_vi8_data,
1044 		.matches = {
1045 			DMI_MATCH(DMI_SYS_VENDOR, "YOURS"),
1046 			DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"),
1047 		},
1048 	},
1049 	{ },
1050 };
1051 
1052 static const struct ts_dmi_data *ts_data;
1053 
1054 static void ts_dmi_add_props(struct i2c_client *client)
1055 {
1056 	struct device *dev = &client->dev;
1057 	int error;
1058 
1059 	if (has_acpi_companion(dev) &&
1060 	    !strncmp(ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
1061 		error = device_add_properties(dev, ts_data->properties);
1062 		if (error)
1063 			dev_err(dev, "failed to add properties: %d\n", error);
1064 	}
1065 }
1066 
1067 static int ts_dmi_notifier_call(struct notifier_block *nb,
1068 				       unsigned long action, void *data)
1069 {
1070 	struct device *dev = data;
1071 	struct i2c_client *client;
1072 
1073 	switch (action) {
1074 	case BUS_NOTIFY_ADD_DEVICE:
1075 		client = i2c_verify_client(dev);
1076 		if (client)
1077 			ts_dmi_add_props(client);
1078 		break;
1079 
1080 	default:
1081 		break;
1082 	}
1083 
1084 	return 0;
1085 }
1086 
1087 static struct notifier_block ts_dmi_notifier = {
1088 	.notifier_call = ts_dmi_notifier_call,
1089 };
1090 
1091 static int __init ts_dmi_init(void)
1092 {
1093 	const struct dmi_system_id *dmi_id;
1094 	int error;
1095 
1096 	dmi_id = dmi_first_match(touchscreen_dmi_table);
1097 	if (!dmi_id)
1098 		return 0; /* Not an error */
1099 
1100 	ts_data = dmi_id->driver_data;
1101 
1102 	error = bus_register_notifier(&i2c_bus_type, &ts_dmi_notifier);
1103 	if (error)
1104 		pr_err("%s: failed to register i2c bus notifier: %d\n",
1105 			__func__, error);
1106 
1107 	return error;
1108 }
1109 
1110 /*
1111  * We are registering out notifier after i2c core is initialized and i2c bus
1112  * itself is ready (which happens at postcore initcall level), but before
1113  * ACPI starts enumerating devices (at subsys initcall level).
1114  */
1115 arch_initcall(ts_dmi_init);
1116