xref: /linux/drivers/platform/x86/touchscreen_dmi.c (revision 17cfcb68af3bc7d5e8ae08779b1853310a2949f3)
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_mini3_props[] = {
314 	PROPERTY_ENTRY_U32("touchscreen-min-x", 23),
315 	PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
316 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
317 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1138),
318 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
319 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
320 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
321 	{ }
322 };
323 
324 static const struct ts_dmi_data jumper_ezpad_mini3_data = {
325 	.acpi_name	= "MSSL1680:00",
326 	.properties	= jumper_ezpad_mini3_props,
327 };
328 
329 static const struct property_entry myria_my8307_props[] = {
330 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1720),
331 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
332 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
333 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
334 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
335 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-myria-my8307.fw"),
336 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
337 	PROPERTY_ENTRY_BOOL("silead,home-button"),
338 	{ }
339 };
340 
341 static const struct ts_dmi_data myria_my8307_data = {
342 	.acpi_name	= "MSSL1680:00",
343 	.properties	= myria_my8307_props,
344 };
345 
346 static const struct property_entry onda_obook_20_plus_props[] = {
347 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
348 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
349 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
350 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
351 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
352 	PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"),
353 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
354 	PROPERTY_ENTRY_BOOL("silead,home-button"),
355 	{ }
356 };
357 
358 static const struct ts_dmi_data onda_obook_20_plus_data = {
359 	.acpi_name	= "MSSL1680:00",
360 	.properties	= onda_obook_20_plus_props,
361 };
362 
363 static const struct property_entry onda_v80_plus_v3_props[] = {
364 	PROPERTY_ENTRY_U32("touchscreen-min-x", 22),
365 	PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
366 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1698),
367 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
368 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
369 	PROPERTY_ENTRY_STRING("firmware-name",
370 			      "gsl3676-onda-v80-plus-v3.fw"),
371 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
372 	PROPERTY_ENTRY_BOOL("silead,home-button"),
373 	{ }
374 };
375 
376 static const struct ts_dmi_data onda_v80_plus_v3_data = {
377 	.acpi_name	= "MSSL1680:00",
378 	.properties	= onda_v80_plus_v3_props,
379 };
380 
381 static const struct property_entry onda_v820w_32g_props[] = {
382 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
383 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
384 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
385 	PROPERTY_ENTRY_STRING("firmware-name",
386 			      "gsl1680-onda-v820w-32g.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_v820w_32g_data = {
393 	.acpi_name	= "MSSL1680:00",
394 	.properties	= onda_v820w_32g_props,
395 };
396 
397 static const struct property_entry onda_v891w_v1_props[] = {
398 	PROPERTY_ENTRY_U32("touchscreen-min-x", 46),
399 	PROPERTY_ENTRY_U32("touchscreen-min-y",  8),
400 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1676),
401 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1130),
402 	PROPERTY_ENTRY_STRING("firmware-name",
403 			      "gsl3680-onda-v891w-v1.fw"),
404 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
405 	PROPERTY_ENTRY_BOOL("silead,home-button"),
406 	{ }
407 };
408 
409 static const struct ts_dmi_data onda_v891w_v1_data = {
410 	.acpi_name	= "MSSL1680:00",
411 	.properties	= onda_v891w_v1_props,
412 };
413 
414 static const struct property_entry onda_v891w_v3_props[] = {
415 	PROPERTY_ENTRY_U32("touchscreen-min-x", 35),
416 	PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
417 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1625),
418 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1135),
419 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
420 	PROPERTY_ENTRY_STRING("firmware-name",
421 			      "gsl3676-onda-v891w-v3.fw"),
422 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
423 	PROPERTY_ENTRY_BOOL("silead,home-button"),
424 	{ }
425 };
426 
427 static const struct ts_dmi_data onda_v891w_v3_data = {
428 	.acpi_name	= "MSSL1680:00",
429 	.properties	= onda_v891w_v3_props,
430 };
431 
432 static const struct property_entry pipo_w2s_props[] = {
433 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
434 	PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
435 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
436 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
437 	PROPERTY_ENTRY_STRING("firmware-name",
438 			      "gsl1680-pipo-w2s.fw"),
439 	{ }
440 };
441 
442 static const struct ts_dmi_data pipo_w2s_data = {
443 	.acpi_name	= "MSSL1680:00",
444 	.properties	= pipo_w2s_props,
445 };
446 
447 static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
448 	PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
449 	PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
450 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1692),
451 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1146),
452 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
453 	PROPERTY_ENTRY_STRING("firmware-name",
454 			      "gsl3680-pov-mobii-wintab-p800w-v20.fw"),
455 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
456 	PROPERTY_ENTRY_BOOL("silead,home-button"),
457 	{ }
458 };
459 
460 static const struct ts_dmi_data pov_mobii_wintab_p800w_v20_data = {
461 	.acpi_name	= "MSSL1680:00",
462 	.properties	= pov_mobii_wintab_p800w_v20_props,
463 };
464 
465 static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
466 	PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
467 	PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
468 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1794),
469 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
470 	PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
471 	PROPERTY_ENTRY_STRING("firmware-name",
472 			      "gsl3692-pov-mobii-wintab-p800w.fw"),
473 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
474 	PROPERTY_ENTRY_BOOL("silead,home-button"),
475 	{ }
476 };
477 
478 static const struct ts_dmi_data pov_mobii_wintab_p800w_v21_data = {
479 	.acpi_name	= "MSSL1680:00",
480 	.properties	= pov_mobii_wintab_p800w_v21_props,
481 };
482 
483 static const struct property_entry pov_mobii_wintab_p1006w_v10_props[] = {
484 	PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
485 	PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
486 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1984),
487 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1520),
488 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
489 	PROPERTY_ENTRY_STRING("firmware-name",
490 			      "gsl3692-pov-mobii-wintab-p1006w-v10.fw"),
491 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
492 	PROPERTY_ENTRY_BOOL("silead,home-button"),
493 	{ }
494 };
495 
496 static const struct ts_dmi_data pov_mobii_wintab_p1006w_v10_data = {
497 	.acpi_name	= "MSSL1680:00",
498 	.properties	= pov_mobii_wintab_p1006w_v10_props,
499 };
500 
501 static const struct property_entry teclast_x3_plus_props[] = {
502 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
503 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
504 	PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"),
505 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
506 	PROPERTY_ENTRY_BOOL("silead,home-button"),
507 	{ }
508 };
509 
510 static const struct ts_dmi_data teclast_x3_plus_data = {
511 	.acpi_name	= "MSSL1680:00",
512 	.properties	= teclast_x3_plus_props,
513 };
514 
515 static const struct property_entry teclast_x98plus2_props[] = {
516 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2048),
517 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
518 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
519 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
520 	PROPERTY_ENTRY_STRING("firmware-name",
521 			      "gsl1686-teclast_x98plus2.fw"),
522 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
523 	{ }
524 };
525 
526 static const struct ts_dmi_data teclast_x98plus2_data = {
527 	.acpi_name	= "MSSL1680:00",
528 	.properties	= teclast_x98plus2_props,
529 };
530 
531 static const struct property_entry trekstor_primebook_c11_props[] = {
532 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1970),
533 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1530),
534 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
535 	PROPERTY_ENTRY_STRING("firmware-name",
536 			      "gsl1680-trekstor-primebook-c11.fw"),
537 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
538 	PROPERTY_ENTRY_BOOL("silead,home-button"),
539 	{ }
540 };
541 
542 static const struct ts_dmi_data trekstor_primebook_c11_data = {
543 	.acpi_name	= "MSSL1680:00",
544 	.properties	= trekstor_primebook_c11_props,
545 };
546 
547 static const struct property_entry trekstor_primebook_c13_props[] = {
548 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
549 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
550 	PROPERTY_ENTRY_STRING("firmware-name",
551 			      "gsl1680-trekstor-primebook-c13.fw"),
552 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
553 	PROPERTY_ENTRY_BOOL("silead,home-button"),
554 	{ }
555 };
556 
557 static const struct ts_dmi_data trekstor_primebook_c13_data = {
558 	.acpi_name	= "MSSL1680:00",
559 	.properties	= trekstor_primebook_c13_props,
560 };
561 
562 static const struct property_entry trekstor_primetab_t13b_props[] = {
563 	PROPERTY_ENTRY_U32("touchscreen-size-x", 2500),
564 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1900),
565 	PROPERTY_ENTRY_STRING("firmware-name",
566 			      "gsl1680-trekstor-primetab-t13b.fw"),
567 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
568 	PROPERTY_ENTRY_BOOL("silead,home-button"),
569 	PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
570 	{ }
571 };
572 
573 static const struct ts_dmi_data trekstor_primetab_t13b_data = {
574 	.acpi_name  = "MSSL1680:00",
575 	.properties = trekstor_primetab_t13b_props,
576 };
577 
578 static const struct property_entry trekstor_surftab_twin_10_1_props[] = {
579 	PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
580 	PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
581 	PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1),
582 	PROPERTY_ENTRY_STRING("firmware-name",
583 			      "gsl3670-surftab-twin-10-1-st10432-8.fw"),
584 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
585 	{ }
586 };
587 
588 static const struct ts_dmi_data trekstor_surftab_twin_10_1_data = {
589 	.acpi_name	= "MSSL1680:00",
590 	.properties	= trekstor_surftab_twin_10_1_props,
591 };
592 
593 static const struct property_entry trekstor_surftab_wintron70_props[] = {
594 	PROPERTY_ENTRY_U32("touchscreen-min-x", 12),
595 	PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
596 	PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
597 	PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
598 	PROPERTY_ENTRY_STRING("firmware-name",
599 			      "gsl1686-surftab-wintron70-st70416-6.fw"),
600 	PROPERTY_ENTRY_U32("silead,max-fingers", 10),
601 	PROPERTY_ENTRY_BOOL("silead,home-button"),
602 	{ }
603 };
604 
605 static const struct ts_dmi_data trekstor_surftab_wintron70_data = {
606 	.acpi_name	= "MSSL1680:00",
607 	.properties	= trekstor_surftab_wintron70_props,
608 };
609 
610 /* NOTE: Please keep this table sorted alphabetically */
611 static const struct dmi_system_id touchscreen_dmi_table[] = {
612 	{
613 		/* Chuwi Hi8 */
614 		.driver_data = (void *)&chuwi_hi8_data,
615 		.matches = {
616 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
617 			DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
618 		},
619 	},
620 	{
621 		/* Chuwi Hi8 (H1D_S806_206) */
622 		.driver_data = (void *)&chuwi_hi8_data,
623 		.matches = {
624 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
625 			DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
626 			DMI_MATCH(DMI_BIOS_VERSION, "H1D_S806_206"),
627 		},
628 	},
629 	{
630 		/* Chuwi Hi8 Air (CWI543) */
631 		.driver_data = (void *)&chuwi_hi8_air_data,
632 		.matches = {
633 			DMI_MATCH(DMI_BOARD_VENDOR, "Default string"),
634 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
635 			DMI_MATCH(DMI_PRODUCT_NAME, "Hi8 Air"),
636 		},
637 	},
638 	{
639 		/* Chuwi Hi8 Pro (CWI513) */
640 		.driver_data = (void *)&chuwi_hi8_pro_data,
641 		.matches = {
642 			DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"),
643 			DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
644 		},
645 	},
646 	{
647 		/* Chuwi Hi10 Air */
648 		.driver_data = (void *)&chuwi_hi10_air_data,
649 		.matches = {
650 			DMI_MATCH(DMI_SYS_VENDOR, "CHUWI INNOVATION AND TECHNOLOGY(SHENZHEN)CO.LTD"),
651 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
652 			DMI_MATCH(DMI_PRODUCT_SKU, "P1W6_C109D_B"),
653 		},
654 	},
655 	{
656 		/* Chuwi Hi10 Plus (CWI527) */
657 		.driver_data = (void *)&chuwi_hi10_plus_data,
658 		.matches = {
659 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
660 			DMI_MATCH(DMI_PRODUCT_NAME, "Hi10 plus tablet"),
661 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
662 		},
663 	},
664 	{
665 		/* Chuwi Vi8 (CWI506) */
666 		.driver_data = (void *)&chuwi_vi8_data,
667 		.matches = {
668 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
669 			DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
670 			DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
671 		},
672 	},
673 	{
674 		/* Chuwi Vi10 (CWI505) */
675 		.driver_data = (void *)&chuwi_vi10_data,
676 		.matches = {
677 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
678 			DMI_MATCH(DMI_BOARD_NAME, "BYT-PF02"),
679 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
680 			DMI_MATCH(DMI_PRODUCT_NAME, "S165"),
681 		},
682 	},
683 	{
684 		/* Chuwi Surbook Mini (CWI540) */
685 		.driver_data = (void *)&chuwi_surbook_mini_data,
686 		.matches = {
687 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
688 			DMI_MATCH(DMI_PRODUCT_NAME, "C3W6_AP108_4G"),
689 		},
690 	},
691 	{
692 		/* Connect Tablet 9 */
693 		.driver_data = (void *)&connect_tablet9_data,
694 		.matches = {
695 			DMI_MATCH(DMI_SYS_VENDOR, "Connect"),
696 			DMI_MATCH(DMI_PRODUCT_NAME, "Tablet 9"),
697 		},
698 	},
699 	{
700 		/* CUBE iwork8 Air */
701 		.driver_data = (void *)&cube_iwork8_air_data,
702 		.matches = {
703 			DMI_MATCH(DMI_SYS_VENDOR, "cube"),
704 			DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"),
705 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
706 		},
707 	},
708 	{
709 		/* Cube KNote i1101 */
710 		.driver_data = (void *)&cube_knote_i1101_data,
711 		.matches = {
712 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
713 			DMI_MATCH(DMI_BOARD_NAME, "L1W6_I1101"),
714 			DMI_MATCH(DMI_SYS_VENDOR, "ALLDOCUBE"),
715 			DMI_MATCH(DMI_PRODUCT_NAME, "i1101"),
716 		},
717 	},
718 	{
719 		/* DEXP Ursus 7W */
720 		.driver_data = (void *)&dexp_ursus_7w_data,
721 		.matches = {
722 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
723 			DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
724 		},
725 	},
726 	{
727 		/* Digma Citi E200 */
728 		.driver_data = (void *)&digma_citi_e200_data,
729 		.matches = {
730 			DMI_MATCH(DMI_SYS_VENDOR, "Digma"),
731 			DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"),
732 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
733 		},
734 	},
735 	{
736 		/* GP-electronic T701 */
737 		.driver_data = (void *)&gp_electronic_t701_data,
738 		.matches = {
739 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
740 			DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
741 			DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
742 		},
743 	},
744 	{
745 		/* I.T.Works TW701 (same hardware as the Trekstor ST70416-6) */
746 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
747 		.matches = {
748 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
749 			DMI_MATCH(DMI_PRODUCT_NAME, "i71c"),
750 			DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"),
751 		},
752 	},
753 	{
754 		/* Irbis TW90 */
755 		.driver_data = (void *)&irbis_tw90_data,
756 		.matches = {
757 			DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
758 			DMI_MATCH(DMI_PRODUCT_NAME, "TW90"),
759 		},
760 	},
761 	{
762 		/* I.T.Works TW891 */
763 		.driver_data = (void *)&itworks_tw891_data,
764 		.matches = {
765 			DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
766 			DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
767 		},
768 	},
769 	{
770 		/* Jumper EZpad 6 Pro */
771 		.driver_data = (void *)&jumper_ezpad_6_pro_data,
772 		.matches = {
773 			DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
774 			DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
775 			DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
776 			/* Above matches are too generic, add bios-date match */
777 			DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"),
778 		},
779 	},
780 	{
781 		/* Jumper EZpad 6 Pro B */
782 		.driver_data = (void *)&jumper_ezpad_6_pro_b_data,
783 		.matches = {
784 			DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
785 			DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
786 			DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
787 			/* Above matches are too generic, add bios-date match */
788 			DMI_MATCH(DMI_BIOS_DATE, "04/24/2018"),
789 		},
790 	},
791 	{
792 		/* Jumper EZpad mini3 */
793 		.driver_data = (void *)&jumper_ezpad_mini3_data,
794 		.matches = {
795 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
796 			/* jumperx.T87.KFBNEEA02 with the version-nr dropped */
797 			DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
798 		},
799 	},
800 	{
801 		/* Mediacom Flexbook Edge 11 (same hw as TS Primebook C11) */
802 		.driver_data = (void *)&trekstor_primebook_c11_data,
803 		.matches = {
804 			DMI_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
805 			DMI_MATCH(DMI_PRODUCT_NAME, "FlexBook edge11 - M-FBE11"),
806 		},
807 	},
808 	{
809 		/* Myria MY8307 */
810 		.driver_data = (void *)&myria_my8307_data,
811 		.matches = {
812 			DMI_MATCH(DMI_SYS_VENDOR, "Complet Electro Serv"),
813 			DMI_MATCH(DMI_PRODUCT_NAME, "MY8307"),
814 		},
815 	},
816 	{
817 		/* Onda oBook 20 Plus */
818 		.driver_data = (void *)&onda_obook_20_plus_data,
819 		.matches = {
820 			DMI_MATCH(DMI_SYS_VENDOR, "ONDA"),
821 			DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
822 		},
823 	},
824 	{
825 		/* ONDA V80 plus v3 (P80PSBG9V3A01501) */
826 		.driver_data = (void *)&onda_v80_plus_v3_data,
827 		.matches = {
828 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONDA"),
829 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V80 PLUS")
830 		},
831 	},
832 	{
833 		/* ONDA V820w DualOS */
834 		.driver_data = (void *)&onda_v820w_32g_data,
835 		.matches = {
836 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
837 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V820w DualOS")
838 		},
839 	},
840 	{
841 		/* ONDA V891w revision P891WBEBV1B00 aka v1 */
842 		.driver_data = (void *)&onda_v891w_v1_data,
843 		.matches = {
844 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
845 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONDA Tablet"),
846 			DMI_EXACT_MATCH(DMI_BOARD_VERSION, "V001"),
847 			/* Exact match, different versions need different fw */
848 			DMI_EXACT_MATCH(DMI_BIOS_VERSION, "ONDA.W89EBBN08"),
849 		},
850 	},
851 	{
852 		/* ONDA V891w Dual OS P891DCF2V1A01274 64GB */
853 		.driver_data = (void *)&onda_v891w_v3_data,
854 		.matches = {
855 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
856 			DMI_MATCH(DMI_PRODUCT_NAME, "ONDA Tablet"),
857 			DMI_MATCH(DMI_BIOS_VERSION, "ONDA.D890HBBNR0A"),
858 		},
859 	},
860 	{
861 		/* Pipo W2S */
862 		.driver_data = (void *)&pipo_w2s_data,
863 		.matches = {
864 			DMI_MATCH(DMI_SYS_VENDOR, "PIPO"),
865 			DMI_MATCH(DMI_PRODUCT_NAME, "W2S"),
866 		},
867 	},
868 	{
869 		/* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
870 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
871 		.matches = {
872 			DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
873 			DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
874 			/* Exact match, different versions need different fw */
875 			DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
876 		},
877 	},
878 	{
879 		/* Point of View mobii wintab p800w (v2.0) */
880 		.driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
881 		.matches = {
882 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
883 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
884 			DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1014"),
885 			/* Above matches are too generic, add bios-date match */
886 			DMI_MATCH(DMI_BIOS_DATE, "10/24/2014"),
887 		},
888 	},
889 	{
890 		/* Point of View mobii wintab p800w (v2.1) */
891 		.driver_data = (void *)&pov_mobii_wintab_p800w_v21_data,
892 		.matches = {
893 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
894 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
895 			DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"),
896 			/* Above matches are too generic, add bios-date match */
897 			DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
898 		},
899 	},
900 	{
901 		/* Point of View mobii wintab p1006w (v1.0) */
902 		.driver_data = (void *)&pov_mobii_wintab_p1006w_v10_data,
903 		.matches = {
904 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
905 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
906 			/* Note 105b is Foxcon's USB/PCI vendor id */
907 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
908 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
909 		},
910 	},
911 	{
912 		/* Teclast X3 Plus */
913 		.driver_data = (void *)&teclast_x3_plus_data,
914 		.matches = {
915 			DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
916 			DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"),
917 			DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
918 		},
919 	},
920 	{
921 		/* Teclast X98 Plus II */
922 		.driver_data = (void *)&teclast_x98plus2_data,
923 		.matches = {
924 			DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
925 			DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
926 		},
927 	},
928 	{
929 		/* Trekstor Primebook C11 */
930 		.driver_data = (void *)&trekstor_primebook_c11_data,
931 		.matches = {
932 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
933 			DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C11"),
934 		},
935 	},
936 	{
937 		/* Trekstor Primebook C11B (same touchscreen as the C11) */
938 		.driver_data = (void *)&trekstor_primebook_c11_data,
939 		.matches = {
940 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
941 			DMI_MATCH(DMI_PRODUCT_NAME, "PRIMEBOOK C11B"),
942 		},
943 	},
944 	{
945 		/* Trekstor Primebook C13 */
946 		.driver_data = (void *)&trekstor_primebook_c13_data,
947 		.matches = {
948 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
949 			DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
950 		},
951 	},
952 	{
953 		/* Trekstor Primetab T13B */
954 		.driver_data = (void *)&trekstor_primetab_t13b_data,
955 		.matches = {
956 			DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
957 			DMI_MATCH(DMI_PRODUCT_NAME, "Primetab T13B"),
958 		},
959 	},
960 	{
961 		/* TrekStor SurfTab twin 10.1 ST10432-8 */
962 		.driver_data = (void *)&trekstor_surftab_twin_10_1_data,
963 		.matches = {
964 			DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
965 			DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"),
966 		},
967 	},
968 	{
969 		/* Trekstor Surftab Wintron 7.0 ST70416-6 */
970 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
971 		.matches = {
972 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
973 			DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"),
974 			/* Exact match, different versions need different fw */
975 			DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
976 		},
977 	},
978 	{
979 		/* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */
980 		.driver_data = (void *)&trekstor_surftab_wintron70_data,
981 		.matches = {
982 			DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
983 			DMI_MATCH(DMI_PRODUCT_NAME,
984 					     "SurfTab wintron 7.0 ST70416-6"),
985 			/* Exact match, different versions need different fw */
986 			DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"),
987 		},
988 	},
989 	{
990 		/* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
991 		.driver_data = (void *)&chuwi_vi8_data,
992 		.matches = {
993 			DMI_MATCH(DMI_SYS_VENDOR, "YOURS"),
994 			DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"),
995 		},
996 	},
997 	{ },
998 };
999 
1000 static const struct ts_dmi_data *ts_data;
1001 
1002 static void ts_dmi_add_props(struct i2c_client *client)
1003 {
1004 	struct device *dev = &client->dev;
1005 	int error;
1006 
1007 	if (has_acpi_companion(dev) &&
1008 	    !strncmp(ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
1009 		error = device_add_properties(dev, ts_data->properties);
1010 		if (error)
1011 			dev_err(dev, "failed to add properties: %d\n", error);
1012 	}
1013 }
1014 
1015 static int ts_dmi_notifier_call(struct notifier_block *nb,
1016 				       unsigned long action, void *data)
1017 {
1018 	struct device *dev = data;
1019 	struct i2c_client *client;
1020 
1021 	switch (action) {
1022 	case BUS_NOTIFY_ADD_DEVICE:
1023 		client = i2c_verify_client(dev);
1024 		if (client)
1025 			ts_dmi_add_props(client);
1026 		break;
1027 
1028 	default:
1029 		break;
1030 	}
1031 
1032 	return 0;
1033 }
1034 
1035 static struct notifier_block ts_dmi_notifier = {
1036 	.notifier_call = ts_dmi_notifier_call,
1037 };
1038 
1039 static int __init ts_dmi_init(void)
1040 {
1041 	const struct dmi_system_id *dmi_id;
1042 	int error;
1043 
1044 	dmi_id = dmi_first_match(touchscreen_dmi_table);
1045 	if (!dmi_id)
1046 		return 0; /* Not an error */
1047 
1048 	ts_data = dmi_id->driver_data;
1049 
1050 	error = bus_register_notifier(&i2c_bus_type, &ts_dmi_notifier);
1051 	if (error)
1052 		pr_err("%s: failed to register i2c bus notifier: %d\n",
1053 			__func__, error);
1054 
1055 	return error;
1056 }
1057 
1058 /*
1059  * We are registering out notifier after i2c core is initialized and i2c bus
1060  * itself is ready (which happens at postcore initcall level), but before
1061  * ACPI starts enumerating devices (at subsys initcall level).
1062  */
1063 arch_initcall(ts_dmi_init);
1064