blob: ce8ebbb1059ba070dbd36a06c13da84b47e4fd1f [file] [log] [blame]
Hans de Goedecef9dd82017-01-23 18:35:30 +01001/*
Hans de Goede74421782018-06-08 23:45:58 +02002 * Touchscreen driver DMI based configuration code
Hans de Goedecef9dd82017-01-23 18:35:30 +01003 *
4 * Copyright (c) 2017 Red Hat Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Red Hat authors:
12 * Hans de Goede <hdegoede@redhat.com>
13 */
14
15#include <linux/acpi.h>
16#include <linux/device.h>
17#include <linux/dmi.h>
18#include <linux/i2c.h>
19#include <linux/notifier.h>
20#include <linux/property.h>
21#include <linux/string.h>
22
Hans de Goede74421782018-06-08 23:45:58 +020023struct ts_dmi_data {
Hans de Goedecef9dd82017-01-23 18:35:30 +010024 const char *acpi_name;
Hans de Goedeae311152017-03-22 16:55:53 +010025 const struct property_entry *properties;
Hans de Goedecef9dd82017-01-23 18:35:30 +010026};
27
Hans de Goede6a655a02018-06-08 23:45:56 +020028/* NOTE: Please keep all entries sorted alphabetically */
29
30static const struct property_entry chuwi_hi8_props[] = {
31 PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
32 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
33 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
34 PROPERTY_ENTRY_BOOL("silead,home-button"),
35 PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"),
36 { }
37};
38
Hans de Goede74421782018-06-08 23:45:58 +020039static const struct ts_dmi_data chuwi_hi8_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +020040 .acpi_name = "MSSL0001:00",
41 .properties = chuwi_hi8_props,
42};
43
44static const struct property_entry chuwi_hi8_pro_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +020045 PROPERTY_ENTRY_U32("touchscreen-min-x", 6),
46 PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
Hans de Goede6a655a02018-06-08 23:45:56 +020047 PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
48 PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
49 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
50 PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"),
Hans de Goede41049162018-10-20 12:21:00 +020051 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goede6a655a02018-06-08 23:45:56 +020052 PROPERTY_ENTRY_BOOL("silead,home-button"),
53 { }
54};
55
Hans de Goede74421782018-06-08 23:45:58 +020056static const struct ts_dmi_data chuwi_hi8_pro_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +020057 .acpi_name = "MSSL1680:00",
58 .properties = chuwi_hi8_pro_props,
59};
60
61static const struct property_entry chuwi_vi8_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +020062 PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
63 PROPERTY_ENTRY_U32("touchscreen-min-y", 6),
Hans de Goede6a655a02018-06-08 23:45:56 +020064 PROPERTY_ENTRY_U32("touchscreen-size-x", 1724),
65 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
66 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
67 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-vi8.fw"),
68 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
69 PROPERTY_ENTRY_BOOL("silead,home-button"),
70 { }
71};
72
Hans de Goede74421782018-06-08 23:45:58 +020073static const struct ts_dmi_data chuwi_vi8_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +020074 .acpi_name = "MSSL1680:00",
75 .properties = chuwi_vi8_props,
76};
77
Hans de Goedeb4c86812018-06-08 23:45:57 +020078static const struct property_entry chuwi_vi10_props[] = {
79 PROPERTY_ENTRY_U32("touchscreen-min-x", 0),
80 PROPERTY_ENTRY_U32("touchscreen-min-y", 4),
81 PROPERTY_ENTRY_U32("touchscreen-size-x", 1858),
82 PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
83 PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-vi10.fw"),
84 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
85 PROPERTY_ENTRY_BOOL("silead,home-button"),
86 { }
87};
88
Hans de Goede74421782018-06-08 23:45:58 +020089static const struct ts_dmi_data chuwi_vi10_data = {
Hans de Goedeb4c86812018-06-08 23:45:57 +020090 .acpi_name = "MSSL0002:00",
91 .properties = chuwi_vi10_props,
92};
93
Hans de Goedec72d95e2018-07-01 11:32:56 +020094static const struct property_entry connect_tablet9_props[] = {
95 PROPERTY_ENTRY_U32("touchscreen-min-x", 9),
Hans de Goede41049162018-10-20 12:21:00 +020096 PROPERTY_ENTRY_U32("touchscreen-min-y", 10),
Hans de Goedec72d95e2018-07-01 11:32:56 +020097 PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
Hans de Goede41049162018-10-20 12:21:00 +020098 PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
Hans de Goedec72d95e2018-07-01 11:32:56 +020099 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
100 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
101 PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-connect-tablet9.fw"),
102 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
103 { }
104};
105
106static const struct ts_dmi_data connect_tablet9_data = {
107 .acpi_name = "MSSL1680:00",
108 .properties = connect_tablet9_props,
109};
110
Hans de Goedeae311152017-03-22 16:55:53 +0100111static const struct property_entry cube_iwork8_air_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +0200112 PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
113 PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
114 PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
115 PROPERTY_ENTRY_U32("touchscreen-size-y", 896),
Hans de Goedecef9dd82017-01-23 18:35:30 +0100116 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
117 PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"),
118 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
119 { }
120};
121
Hans de Goede74421782018-06-08 23:45:58 +0200122static const struct ts_dmi_data cube_iwork8_air_data = {
Hans de Goedecef9dd82017-01-23 18:35:30 +0100123 .acpi_name = "MSSL1680:00",
124 .properties = cube_iwork8_air_props,
125};
126
youling257cda59152018-07-31 17:32:56 +0800127static const struct property_entry cube_knote_i1101_props[] = {
128 PROPERTY_ENTRY_U32("touchscreen-min-x", 20),
129 PROPERTY_ENTRY_U32("touchscreen-min-y", 22),
130 PROPERTY_ENTRY_U32("touchscreen-size-x", 1961),
131 PROPERTY_ENTRY_U32("touchscreen-size-y", 1513),
132 PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-cube-knote-i1101.fw"),
133 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
134 PROPERTY_ENTRY_BOOL("silead,home-button"),
135 { }
136};
137
138static const struct ts_dmi_data cube_knote_i1101_data = {
139 .acpi_name = "MSSL1680:00",
140 .properties = cube_knote_i1101_props,
141};
142
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100143static const struct property_entry dexp_ursus_7w_props[] = {
144 PROPERTY_ENTRY_U32("touchscreen-size-x", 890),
145 PROPERTY_ENTRY_U32("touchscreen-size-y", 630),
146 PROPERTY_ENTRY_STRING("firmware-name", "gsl1686-dexp-ursus-7w.fw"),
147 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goedeaaa40962017-10-19 09:17:28 +0200148 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100149 { }
150};
151
Hans de Goede74421782018-06-08 23:45:58 +0200152static const struct ts_dmi_data dexp_ursus_7w_data = {
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100153 .acpi_name = "MSSL1680:00",
154 .properties = dexp_ursus_7w_props,
155};
156
Hans de Goede6a655a02018-06-08 23:45:56 +0200157static const struct property_entry digma_citi_e200_props[] = {
158 PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
159 PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
160 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
Bernhard Übelackerf4c12d42017-11-26 19:32:58 +0100161 PROPERTY_ENTRY_STRING("firmware-name",
Hans de Goede6a655a02018-06-08 23:45:56 +0200162 "gsl1686-digma_citi_e200.fw"),
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200163 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goedeaaa40962017-10-19 09:17:28 +0200164 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200165 { }
166};
167
Hans de Goede74421782018-06-08 23:45:58 +0200168static const struct ts_dmi_data digma_citi_e200_data = {
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200169 .acpi_name = "MSSL1680:00",
Hans de Goede6a655a02018-06-08 23:45:56 +0200170 .properties = digma_citi_e200_props,
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200171};
172
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200173static const struct property_entry gp_electronic_t701_props[] = {
174 PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
175 PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
Hans de Goede5c24c052017-10-19 09:44:14 +0200176 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
177 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200178 PROPERTY_ENTRY_STRING("firmware-name",
179 "gsl1680-gp-electronic-t701.fw"),
180 { }
181};
182
Hans de Goede74421782018-06-08 23:45:58 +0200183static const struct ts_dmi_data gp_electronic_t701_data = {
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200184 .acpi_name = "MSSL1680:00",
185 .properties = gp_electronic_t701_props,
186};
187
Hans de Goede6a655a02018-06-08 23:45:56 +0200188static const struct property_entry itworks_tw891_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +0200189 PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
190 PROPERTY_ENTRY_U32("touchscreen-min-y", 5),
Hans de Goede6a655a02018-06-08 23:45:56 +0200191 PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
Hans de Goede41049162018-10-20 12:21:00 +0200192 PROPERTY_ENTRY_U32("touchscreen-size-y", 896),
Hans de Goede6a655a02018-06-08 23:45:56 +0200193 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
194 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
195 PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
Hans de Goede41049162018-10-20 12:21:00 +0200196 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goede6a655a02018-06-08 23:45:56 +0200197 { }
198};
199
Hans de Goede74421782018-06-08 23:45:58 +0200200static const struct ts_dmi_data itworks_tw891_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200201 .acpi_name = "MSSL1680:00",
202 .properties = itworks_tw891_props,
203};
204
205static const struct property_entry jumper_ezpad_6_pro_props[] = {
206 PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
207 PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
208 PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro.fw"),
209 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
210 PROPERTY_ENTRY_BOOL("silead,home-button"),
211 { }
212};
213
Hans de Goede74421782018-06-08 23:45:58 +0200214static const struct ts_dmi_data jumper_ezpad_6_pro_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200215 .acpi_name = "MSSL1680:00",
216 .properties = jumper_ezpad_6_pro_props,
217};
218
219static const struct property_entry jumper_ezpad_mini3_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +0200220 PROPERTY_ENTRY_U32("touchscreen-min-x", 23),
221 PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
Hans de Goede6a655a02018-06-08 23:45:56 +0200222 PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
Hans de Goede41049162018-10-20 12:21:00 +0200223 PROPERTY_ENTRY_U32("touchscreen-size-y", 1138),
Hans de Goede6a655a02018-06-08 23:45:56 +0200224 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
225 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
226 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
227 { }
228};
229
Hans de Goede74421782018-06-08 23:45:58 +0200230static const struct ts_dmi_data jumper_ezpad_mini3_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200231 .acpi_name = "MSSL1680:00",
232 .properties = jumper_ezpad_mini3_props,
233};
234
235static const struct property_entry onda_obook_20_plus_props[] = {
236 PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
237 PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
238 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
239 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
240 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
241 PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"),
242 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
243 PROPERTY_ENTRY_BOOL("silead,home-button"),
244 { }
245};
246
Hans de Goede74421782018-06-08 23:45:58 +0200247static const struct ts_dmi_data onda_obook_20_plus_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200248 .acpi_name = "MSSL1680:00",
249 .properties = onda_obook_20_plus_props,
250};
251
Hans de Goede01b6b7e2018-10-10 15:16:40 +0200252static const struct property_entry onda_v80_plus_v3_props[] = {
253 PROPERTY_ENTRY_U32("touchscreen-min-x", 22),
254 PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
255 PROPERTY_ENTRY_U32("touchscreen-size-x", 1698),
256 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
257 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
258 PROPERTY_ENTRY_STRING("firmware-name",
259 "gsl3676-onda-v80-plus-v3.fw"),
260 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
261 PROPERTY_ENTRY_BOOL("silead,home-button"),
262 { }
263};
264
265static const struct ts_dmi_data onda_v80_plus_v3_data = {
266 .acpi_name = "MSSL1680:00",
267 .properties = onda_v80_plus_v3_props,
268};
269
Jun Bo Biee08f572018-07-01 17:47:14 -0400270static const struct property_entry onda_v820w_32g_props[] = {
271 PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
272 PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
273 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
274 PROPERTY_ENTRY_STRING("firmware-name",
275 "gsl1680-onda-v820w-32g.fw"),
276 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
277 PROPERTY_ENTRY_BOOL("silead,home-button"),
278 { }
279};
280
281static const struct ts_dmi_data onda_v820w_32g_data = {
282 .acpi_name = "MSSL1680:00",
283 .properties = onda_v820w_32g_props,
284};
285
Hans de Goede6a655a02018-06-08 23:45:56 +0200286static const struct property_entry onda_v891w_v1_props[] = {
287 PROPERTY_ENTRY_U32("touchscreen-min-x", 46),
288 PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
289 PROPERTY_ENTRY_U32("touchscreen-size-x", 1676),
290 PROPERTY_ENTRY_U32("touchscreen-size-y", 1130),
291 PROPERTY_ENTRY_STRING("firmware-name",
292 "gsl3680-onda-v891w-v1.fw"),
293 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
294 PROPERTY_ENTRY_BOOL("silead,home-button"),
295 { }
296};
297
Hans de Goede74421782018-06-08 23:45:58 +0200298static const struct ts_dmi_data onda_v891w_v1_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200299 .acpi_name = "MSSL1680:00",
300 .properties = onda_v891w_v1_props,
301};
302
youling257c0d73082018-06-18 15:11:44 +0200303static const struct property_entry onda_v891w_v3_props[] = {
304 PROPERTY_ENTRY_U32("touchscreen-min-x", 35),
305 PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
306 PROPERTY_ENTRY_U32("touchscreen-size-x", 1625),
307 PROPERTY_ENTRY_U32("touchscreen-size-y", 1135),
308 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
309 PROPERTY_ENTRY_STRING("firmware-name",
310 "gsl3676-onda-v891w-v3.fw"),
311 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
312 PROPERTY_ENTRY_BOOL("silead,home-button"),
313 { }
314};
315
316static const struct ts_dmi_data onda_v891w_v3_data = {
317 .acpi_name = "MSSL1680:00",
318 .properties = onda_v891w_v3_props,
319};
320
Hans de Goede13fadfa2017-06-15 08:48:32 +0200321static const struct property_entry pipo_w2s_props[] = {
322 PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
323 PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
324 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
325 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
326 PROPERTY_ENTRY_STRING("firmware-name",
327 "gsl1680-pipo-w2s.fw"),
328 { }
329};
330
Hans de Goede74421782018-06-08 23:45:58 +0200331static const struct ts_dmi_data pipo_w2s_data = {
Hans de Goede13fadfa2017-06-15 08:48:32 +0200332 .acpi_name = "MSSL1680:00",
333 .properties = pipo_w2s_props,
334};
335
Hans de Goede3cd33db2018-05-30 12:43:40 +0200336static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
337 PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
338 PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
339 PROPERTY_ENTRY_U32("touchscreen-size-x", 1692),
340 PROPERTY_ENTRY_U32("touchscreen-size-y", 1146),
341 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
342 PROPERTY_ENTRY_STRING("firmware-name",
343 "gsl3680-pov-mobii-wintab-p800w-v20.fw"),
344 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
345 PROPERTY_ENTRY_BOOL("silead,home-button"),
346 { }
347};
348
Hans de Goede74421782018-06-08 23:45:58 +0200349static const struct ts_dmi_data pov_mobii_wintab_p800w_v20_data = {
Hans de Goede3cd33db2018-05-30 12:43:40 +0200350 .acpi_name = "MSSL1680:00",
351 .properties = pov_mobii_wintab_p800w_v20_props,
352};
353
354static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +0200355 PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
356 PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
357 PROPERTY_ENTRY_U32("touchscreen-size-x", 1794),
358 PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
Hans de Goedef4d342c2017-06-15 08:48:31 +0200359 PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
360 PROPERTY_ENTRY_STRING("firmware-name",
361 "gsl3692-pov-mobii-wintab-p800w.fw"),
Hans de Goede41049162018-10-20 12:21:00 +0200362 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
Hans de Goedeaaa40962017-10-19 09:17:28 +0200363 PROPERTY_ENTRY_BOOL("silead,home-button"),
Hans de Goedef4d342c2017-06-15 08:48:31 +0200364 { }
365};
366
Hans de Goede74421782018-06-08 23:45:58 +0200367static const struct ts_dmi_data pov_mobii_wintab_p800w_v21_data = {
Hans de Goedef4d342c2017-06-15 08:48:31 +0200368 .acpi_name = "MSSL1680:00",
Hans de Goede3cd33db2018-05-30 12:43:40 +0200369 .properties = pov_mobii_wintab_p800w_v21_props,
Hans de Goedef4d342c2017-06-15 08:48:31 +0200370};
371
Hans de Goede8335ebc2018-12-20 22:21:50 +0100372static const struct property_entry pov_mobii_wintab_p1006w_v10_props[] = {
373 PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
374 PROPERTY_ENTRY_U32("touchscreen-min-y", 3),
375 PROPERTY_ENTRY_U32("touchscreen-size-x", 1984),
376 PROPERTY_ENTRY_U32("touchscreen-size-y", 1520),
377 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
378 PROPERTY_ENTRY_STRING("firmware-name",
379 "gsl3692-pov-mobii-wintab-p1006w-v10.fw"),
380 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
381 PROPERTY_ENTRY_BOOL("silead,home-button"),
382 { }
383};
384
385static const struct ts_dmi_data pov_mobii_wintab_p1006w_v10_data = {
386 .acpi_name = "MSSL1680:00",
387 .properties = pov_mobii_wintab_p1006w_v10_props,
388};
389
Hans de Goede6a655a02018-06-08 23:45:56 +0200390static const struct property_entry teclast_x3_plus_props[] = {
Sergey Tshovrebov3fcf2b22017-10-27 12:27:07 +0200391 PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
392 PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
Hans de Goede6a655a02018-06-08 23:45:56 +0200393 PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"),
Sergey Tshovrebov3fcf2b22017-10-27 12:27:07 +0200394 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
395 PROPERTY_ENTRY_BOOL("silead,home-button"),
396 { }
397};
398
Hans de Goede74421782018-06-08 23:45:58 +0200399static const struct ts_dmi_data teclast_x3_plus_data = {
Sergey Tshovrebov3fcf2b22017-10-27 12:27:07 +0200400 .acpi_name = "MSSL1680:00",
Hans de Goede6a655a02018-06-08 23:45:56 +0200401 .properties = teclast_x3_plus_props,
Hans de Goede2aeb2c32017-12-25 13:45:25 +0100402};
403
Paul Cercueila346aa22018-01-02 19:39:27 +0100404static const struct property_entry teclast_x98plus2_props[] = {
405 PROPERTY_ENTRY_U32("touchscreen-size-x", 2048),
406 PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
407 PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
408 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
409 PROPERTY_ENTRY_STRING("firmware-name",
410 "gsl1686-teclast_x98plus2.fw"),
411 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
412 { }
413};
414
Hans de Goede74421782018-06-08 23:45:58 +0200415static const struct ts_dmi_data teclast_x98plus2_data = {
Paul Cercueila346aa22018-01-02 19:39:27 +0100416 .acpi_name = "MSSL1680:00",
417 .properties = teclast_x98plus2_props,
418};
419
Hans de Goedecacad0b2018-10-04 14:34:45 +0200420static const struct property_entry trekstor_primebook_c11_props[] = {
421 PROPERTY_ENTRY_U32("touchscreen-size-x", 1970),
422 PROPERTY_ENTRY_U32("touchscreen-size-y", 1530),
423 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
424 PROPERTY_ENTRY_STRING("firmware-name",
425 "gsl1680-trekstor-primebook-c11.fw"),
426 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
427 PROPERTY_ENTRY_BOOL("silead,home-button"),
428 { }
429};
430
431static const struct ts_dmi_data trekstor_primebook_c11_data = {
432 .acpi_name = "MSSL1680:00",
433 .properties = trekstor_primebook_c11_props,
434};
435
Hans de Goede6a655a02018-06-08 23:45:56 +0200436static const struct property_entry trekstor_primebook_c13_props[] = {
437 PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
438 PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
Hans de Goedeadf762d2018-05-30 12:43:41 +0200439 PROPERTY_ENTRY_STRING("firmware-name",
Hans de Goede6a655a02018-06-08 23:45:56 +0200440 "gsl1680-trekstor-primebook-c13.fw"),
Hans de Goedeadf762d2018-05-30 12:43:41 +0200441 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
442 PROPERTY_ENTRY_BOOL("silead,home-button"),
443 { }
444};
445
Hans de Goede74421782018-06-08 23:45:58 +0200446static const struct ts_dmi_data trekstor_primebook_c13_data = {
Hans de Goedeadf762d2018-05-30 12:43:41 +0200447 .acpi_name = "MSSL1680:00",
Hans de Goede6a655a02018-06-08 23:45:56 +0200448 .properties = trekstor_primebook_c13_props,
Hans de Goedeadf762d2018-05-30 12:43:41 +0200449};
450
Marian Cepok30394a82018-10-08 09:25:05 +0200451static const struct property_entry trekstor_primetab_t13b_props[] = {
452 PROPERTY_ENTRY_U32("touchscreen-size-x", 2500),
453 PROPERTY_ENTRY_U32("touchscreen-size-y", 1900),
454 PROPERTY_ENTRY_STRING("firmware-name",
455 "gsl1680-trekstor-primetab-t13b.fw"),
456 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
457 PROPERTY_ENTRY_BOOL("silead,home-button"),
458 PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
459 { }
460};
461
462static const struct ts_dmi_data trekstor_primetab_t13b_data = {
463 .acpi_name = "MSSL1680:00",
464 .properties = trekstor_primetab_t13b_props,
465};
466
Hans de Goede6a655a02018-06-08 23:45:56 +0200467static const struct property_entry trekstor_surftab_twin_10_1_props[] = {
468 PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
469 PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
470 PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1),
471 PROPERTY_ENTRY_STRING("firmware-name",
472 "gsl3670-surftab-twin-10-1-st10432-8.fw"),
473 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
474 { }
475};
476
Hans de Goede74421782018-06-08 23:45:58 +0200477static const struct ts_dmi_data trekstor_surftab_twin_10_1_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200478 .acpi_name = "MSSL1680:00",
479 .properties = trekstor_surftab_twin_10_1_props,
480};
481
482static const struct property_entry trekstor_surftab_wintron70_props[] = {
Hans de Goede41049162018-10-20 12:21:00 +0200483 PROPERTY_ENTRY_U32("touchscreen-min-x", 12),
484 PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
Hans de Goede6a655a02018-06-08 23:45:56 +0200485 PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
486 PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
487 PROPERTY_ENTRY_STRING("firmware-name",
488 "gsl1686-surftab-wintron70-st70416-6.fw"),
489 PROPERTY_ENTRY_U32("silead,max-fingers", 10),
490 PROPERTY_ENTRY_BOOL("silead,home-button"),
491 { }
492};
493
Hans de Goede74421782018-06-08 23:45:58 +0200494static const struct ts_dmi_data trekstor_surftab_wintron70_data = {
Hans de Goede6a655a02018-06-08 23:45:56 +0200495 .acpi_name = "MSSL1680:00",
496 .properties = trekstor_surftab_wintron70_props,
497};
498
499/* NOTE: Please keep this table sorted alphabetically */
Hans de Goede74421782018-06-08 23:45:58 +0200500static const struct dmi_system_id touchscreen_dmi_table[] = {
Hans de Goedecef9dd82017-01-23 18:35:30 +0100501 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200502 /* Chuwi Hi8 */
503 .driver_data = (void *)&chuwi_hi8_data,
504 .matches = {
505 DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
506 DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
507 },
508 },
509 {
510 /* Chuwi Hi8 (H1D_S806_206) */
511 .driver_data = (void *)&chuwi_hi8_data,
512 .matches = {
513 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
514 DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
515 DMI_MATCH(DMI_BIOS_VERSION, "H1D_S806_206"),
516 },
517 },
518 {
519 /* Chuwi Hi8 Pro (CWI513) */
520 .driver_data = (void *)&chuwi_hi8_pro_data,
521 .matches = {
522 DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"),
523 DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
524 },
525 },
526 {
527 /* Chuwi Vi8 (CWI506) */
528 .driver_data = (void *)&chuwi_vi8_data,
529 .matches = {
530 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
531 DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
532 DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
533 },
534 },
535 {
Hans de Goedeb4c86812018-06-08 23:45:57 +0200536 /* Chuwi Vi10 (CWI505) */
537 .driver_data = (void *)&chuwi_vi10_data,
538 .matches = {
539 DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
540 DMI_MATCH(DMI_BOARD_NAME, "BYT-PF02"),
541 DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
542 DMI_MATCH(DMI_PRODUCT_NAME, "S165"),
543 },
544 },
545 {
Hans de Goedec72d95e2018-07-01 11:32:56 +0200546 /* Connect Tablet 9 */
547 .driver_data = (void *)&connect_tablet9_data,
548 .matches = {
549 DMI_MATCH(DMI_SYS_VENDOR, "Connect"),
550 DMI_MATCH(DMI_PRODUCT_NAME, "Tablet 9"),
551 },
552 },
553 {
Hans de Goedecef9dd82017-01-23 18:35:30 +0100554 /* CUBE iwork8 Air */
555 .driver_data = (void *)&cube_iwork8_air_data,
556 .matches = {
557 DMI_MATCH(DMI_SYS_VENDOR, "cube"),
558 DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"),
559 DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
560 },
561 },
562 {
youling257cda59152018-07-31 17:32:56 +0800563 /* Cube KNote i1101 */
564 .driver_data = (void *)&cube_knote_i1101_data,
565 .matches = {
566 DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
567 DMI_MATCH(DMI_BOARD_NAME, "L1W6_I1101"),
568 DMI_MATCH(DMI_SYS_VENDOR, "ALLDOCUBE"),
569 DMI_MATCH(DMI_PRODUCT_NAME, "i1101"),
570 },
571 },
572 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200573 /* DEXP Ursus 7W */
574 .driver_data = (void *)&dexp_ursus_7w_data,
Hans de Goedecef9dd82017-01-23 18:35:30 +0100575 .matches = {
576 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
Hans de Goede6a655a02018-06-08 23:45:56 +0200577 DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
578 },
579 },
580 {
581 /* Digma Citi E200 */
582 .driver_data = (void *)&digma_citi_e200_data,
583 .matches = {
584 DMI_MATCH(DMI_SYS_VENDOR, "Digma"),
585 DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"),
586 DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
587 },
588 },
589 {
590 /* GP-electronic T701 */
591 .driver_data = (void *)&gp_electronic_t701_data,
592 .matches = {
593 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
594 DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
595 DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
596 },
597 },
598 {
599 /* I.T.Works TW701 (same hardware as the Trekstor ST70416-6) */
600 .driver_data = (void *)&trekstor_surftab_wintron70_data,
601 .matches = {
602 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
603 DMI_MATCH(DMI_PRODUCT_NAME, "i71c"),
604 DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"),
605 },
606 },
607 {
608 /* I.T.Works TW891 */
609 .driver_data = (void *)&itworks_tw891_data,
610 .matches = {
611 DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
612 DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
Hans de Goedecef9dd82017-01-23 18:35:30 +0100613 },
614 },
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100615 {
Hans de Goede828615f2018-05-30 12:43:39 +0200616 /* Jumper EZpad 6 Pro */
617 .driver_data = (void *)&jumper_ezpad_6_pro_data,
618 .matches = {
619 DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
620 DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
621 DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
622 /* Above matches are too generic, add bios-date match */
623 DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"),
624 },
625 },
626 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200627 /* Jumper EZpad mini3 */
628 .driver_data = (void *)&jumper_ezpad_mini3_data,
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100629 .matches = {
630 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
Hans de Goede6a655a02018-06-08 23:45:56 +0200631 /* jumperx.T87.KFBNEEA02 with the version-nr dropped */
632 DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
633 },
634 },
635 {
Hans de Goedef25b6302018-12-04 10:20:04 +0100636 /* Mediacom Flexbook Edge 11 (same hw as TS Primebook C11) */
637 .driver_data = (void *)&trekstor_primebook_c11_data,
638 .matches = {
639 DMI_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
640 DMI_MATCH(DMI_PRODUCT_NAME, "FlexBook edge11 - M-FBE11"),
641 },
642 },
643 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200644 /* Onda oBook 20 Plus */
645 .driver_data = (void *)&onda_obook_20_plus_data,
646 .matches = {
647 DMI_MATCH(DMI_SYS_VENDOR, "ONDA"),
648 DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
649 },
650 },
651 {
Hans de Goede01b6b7e2018-10-10 15:16:40 +0200652 /* ONDA V80 plus v3 (P80PSBG9V3A01501) */
653 .driver_data = (void *)&onda_v80_plus_v3_data,
654 .matches = {
655 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONDA"),
656 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V80 PLUS")
657 },
658 },
659 {
Jun Bo Biee08f572018-07-01 17:47:14 -0400660 /* ONDA V820w DualOS */
661 .driver_data = (void *)&onda_v820w_32g_data,
662 .matches = {
663 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
664 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V820w DualOS")
665 },
666 },
667 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200668 /* ONDA V891w revision P891WBEBV1B00 aka v1 */
669 .driver_data = (void *)&onda_v891w_v1_data,
670 .matches = {
671 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
672 DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONDA Tablet"),
673 DMI_EXACT_MATCH(DMI_BOARD_VERSION, "V001"),
674 /* Exact match, different versions need different fw */
675 DMI_EXACT_MATCH(DMI_BIOS_VERSION, "ONDA.W89EBBN08"),
676 },
677 },
678 {
youling257c0d73082018-06-18 15:11:44 +0200679 /* ONDA V891w Dual OS P891DCF2V1A01274 64GB */
680 .driver_data = (void *)&onda_v891w_v3_data,
681 .matches = {
682 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
683 DMI_MATCH(DMI_PRODUCT_NAME, "ONDA Tablet"),
684 DMI_MATCH(DMI_BIOS_VERSION, "ONDA.D890HBBNR0A"),
685 },
686 },
687 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200688 /* Pipo W2S */
689 .driver_data = (void *)&pipo_w2s_data,
690 .matches = {
691 DMI_MATCH(DMI_SYS_VENDOR, "PIPO"),
692 DMI_MATCH(DMI_PRODUCT_NAME, "W2S"),
693 },
694 },
695 {
696 /* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
697 .driver_data = (void *)&trekstor_surftab_wintron70_data,
698 .matches = {
699 DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
700 DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
701 /* Exact match, different versions need different fw */
702 DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
703 },
704 },
705 {
706 /* Point of View mobii wintab p800w (v2.0) */
707 .driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
708 .matches = {
709 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
710 DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
711 DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1014"),
712 /* Above matches are too generic, add bios-date match */
713 DMI_MATCH(DMI_BIOS_DATE, "10/24/2014"),
714 },
715 },
716 {
717 /* Point of View mobii wintab p800w (v2.1) */
718 .driver_data = (void *)&pov_mobii_wintab_p800w_v21_data,
719 .matches = {
720 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
721 DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
722 DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"),
723 /* Above matches are too generic, add bios-date match */
724 DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
725 },
726 },
727 {
Hans de Goede8335ebc2018-12-20 22:21:50 +0100728 /* Point of View mobii wintab p1006w (v1.0) */
729 .driver_data = (void *)&pov_mobii_wintab_p1006w_v10_data,
730 .matches = {
731 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
732 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
733 /* Note 105b is Foxcon's USB/PCI vendor id */
734 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
735 DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
736 },
737 },
738 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200739 /* Teclast X3 Plus */
740 .driver_data = (void *)&teclast_x3_plus_data,
741 .matches = {
742 DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
743 DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"),
744 DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
745 },
746 },
747 {
748 /* Teclast X98 Plus II */
749 .driver_data = (void *)&teclast_x98plus2_data,
750 .matches = {
751 DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
752 DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
753 },
754 },
755 {
Hans de Goedecacad0b2018-10-04 14:34:45 +0200756 /* Trekstor Primebook C11 */
757 .driver_data = (void *)&trekstor_primebook_c11_data,
758 .matches = {
759 DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
760 DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C11"),
761 },
762 },
763 {
Hans de Goede6a655a02018-06-08 23:45:56 +0200764 /* Trekstor Primebook C13 */
765 .driver_data = (void *)&trekstor_primebook_c13_data,
766 .matches = {
767 DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
768 DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
Hans de Goede6b8e7d82017-03-22 16:55:54 +0100769 },
770 },
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200771 {
Marian Cepok30394a82018-10-08 09:25:05 +0200772 /* Trekstor Primetab T13B */
773 .driver_data = (void *)&trekstor_primetab_t13b_data,
774 .matches = {
775 DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
776 DMI_MATCH(DMI_PRODUCT_NAME, "Primetab T13B"),
777 },
778 },
779 {
Bernhard Übelackerf4c12d42017-11-26 19:32:58 +0100780 /* TrekStor SurfTab twin 10.1 ST10432-8 */
Hans de Goeded6b0d7d2018-06-08 23:45:55 +0200781 .driver_data = (void *)&trekstor_surftab_twin_10_1_data,
Bernhard Übelackerf4c12d42017-11-26 19:32:58 +0100782 .matches = {
783 DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
784 DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"),
785 },
786 },
787 {
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200788 /* Trekstor Surftab Wintron 7.0 ST70416-6 */
Hans de Goeded6b0d7d2018-06-08 23:45:55 +0200789 .driver_data = (void *)&trekstor_surftab_wintron70_data,
Hans de Goede5b7bb3a2017-04-09 11:07:44 +0200790 .matches = {
791 DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
792 DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"),
793 /* Exact match, different versions need different fw */
794 DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
795 },
796 },
Hans de Goeded9ca30b2017-05-07 14:35:15 +0200797 {
Hans de Goede4245c152018-01-16 20:24:15 +0100798 /* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */
Hans de Goeded6b0d7d2018-06-08 23:45:55 +0200799 .driver_data = (void *)&trekstor_surftab_wintron70_data,
Hans de Goede4245c152018-01-16 20:24:15 +0100800 .matches = {
801 DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
802 DMI_MATCH(DMI_PRODUCT_NAME,
803 "SurfTab wintron 7.0 ST70416-6"),
804 /* Exact match, different versions need different fw */
805 DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"),
806 },
807 },
808 {
Hans de Goede24e2bb32018-03-09 15:03:58 +0100809 /* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
810 .driver_data = (void *)&chuwi_vi8_data,
811 .matches = {
812 DMI_MATCH(DMI_SYS_VENDOR, "YOURS"),
813 DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"),
814 },
815 },
Hans de Goedecef9dd82017-01-23 18:35:30 +0100816 { },
817};
818
Hans de Goede74421782018-06-08 23:45:58 +0200819static const struct ts_dmi_data *ts_data;
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700820
Hans de Goede74421782018-06-08 23:45:58 +0200821static void ts_dmi_add_props(struct i2c_client *client)
Hans de Goedecef9dd82017-01-23 18:35:30 +0100822{
Dmitry Torokhove1053962017-04-03 20:25:13 -0700823 struct device *dev = &client->dev;
Hans de Goedecef9dd82017-01-23 18:35:30 +0100824 int error;
825
Hans de Goedecef9dd82017-01-23 18:35:30 +0100826 if (has_acpi_companion(dev) &&
Hans de Goede74421782018-06-08 23:45:58 +0200827 !strncmp(ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
828 error = device_add_properties(dev, ts_data->properties);
Hans de Goedecef9dd82017-01-23 18:35:30 +0100829 if (error)
830 dev_err(dev, "failed to add properties: %d\n", error);
831 }
832}
833
Hans de Goede74421782018-06-08 23:45:58 +0200834static int ts_dmi_notifier_call(struct notifier_block *nb,
Hans de Goedecef9dd82017-01-23 18:35:30 +0100835 unsigned long action, void *data)
836{
837 struct device *dev = data;
Dmitry Torokhove1053962017-04-03 20:25:13 -0700838 struct i2c_client *client;
Hans de Goedecef9dd82017-01-23 18:35:30 +0100839
840 switch (action) {
841 case BUS_NOTIFY_ADD_DEVICE:
Dmitry Torokhove1053962017-04-03 20:25:13 -0700842 client = i2c_verify_client(dev);
843 if (client)
Hans de Goede74421782018-06-08 23:45:58 +0200844 ts_dmi_add_props(client);
Hans de Goedecef9dd82017-01-23 18:35:30 +0100845 break;
846
847 default:
848 break;
849 }
850
851 return 0;
852}
853
Hans de Goede74421782018-06-08 23:45:58 +0200854static struct notifier_block ts_dmi_notifier = {
855 .notifier_call = ts_dmi_notifier_call,
Hans de Goedecef9dd82017-01-23 18:35:30 +0100856};
857
Hans de Goede74421782018-06-08 23:45:58 +0200858static int __init ts_dmi_init(void)
Hans de Goedecef9dd82017-01-23 18:35:30 +0100859{
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700860 const struct dmi_system_id *dmi_id;
Hans de Goedecef9dd82017-01-23 18:35:30 +0100861 int error;
862
Hans de Goede74421782018-06-08 23:45:58 +0200863 dmi_id = dmi_first_match(touchscreen_dmi_table);
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700864 if (!dmi_id)
865 return 0; /* Not an error */
866
Hans de Goede74421782018-06-08 23:45:58 +0200867 ts_data = dmi_id->driver_data;
Dmitry Torokhovf22265b2017-04-03 20:25:14 -0700868
Hans de Goede74421782018-06-08 23:45:58 +0200869 error = bus_register_notifier(&i2c_bus_type, &ts_dmi_notifier);
Hans de Goedecef9dd82017-01-23 18:35:30 +0100870 if (error)
871 pr_err("%s: failed to register i2c bus notifier: %d\n",
872 __func__, error);
873
874 return error;
875}
876
877/*
878 * We are registering out notifier after i2c core is initialized and i2c bus
879 * itself is ready (which happens at postcore initcall level), but before
880 * ACPI starts enumerating devices (at subsys initcall level).
881 */
Hans de Goede74421782018-06-08 23:45:58 +0200882arch_initcall(ts_dmi_init);