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