Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Silead touchscreen driver DMI based configuration code |
| 3 | * |
| 4 | * Copyright (c) 2017 Red Hat Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * Red Hat authors: |
| 12 | * Hans de Goede <hdegoede@redhat.com> |
| 13 | */ |
| 14 | |
| 15 | #include <linux/acpi.h> |
| 16 | #include <linux/device.h> |
| 17 | #include <linux/dmi.h> |
| 18 | #include <linux/i2c.h> |
| 19 | #include <linux/notifier.h> |
| 20 | #include <linux/property.h> |
| 21 | #include <linux/string.h> |
| 22 | |
| 23 | struct silead_ts_dmi_data { |
| 24 | const char *acpi_name; |
Hans de Goede | ae31115 | 2017-03-22 16:55:53 +0100 | [diff] [blame] | 25 | const struct property_entry *properties; |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 26 | }; |
| 27 | |
Hans de Goede | ae31115 | 2017-03-22 16:55:53 +0100 | [diff] [blame] | 28 | static const struct property_entry cube_iwork8_air_props[] = { |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 29 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1660), |
| 30 | PROPERTY_ENTRY_U32("touchscreen-size-y", 900), |
| 31 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 32 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"), |
| 33 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 34 | { } |
| 35 | }; |
| 36 | |
| 37 | static const struct silead_ts_dmi_data cube_iwork8_air_data = { |
| 38 | .acpi_name = "MSSL1680:00", |
| 39 | .properties = cube_iwork8_air_props, |
| 40 | }; |
| 41 | |
Hans de Goede | ae31115 | 2017-03-22 16:55:53 +0100 | [diff] [blame] | 42 | static const struct property_entry jumper_ezpad_mini3_props[] = { |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 43 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1700), |
| 44 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1150), |
| 45 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 46 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"), |
| 47 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 48 | { } |
| 49 | }; |
| 50 | |
| 51 | static const struct silead_ts_dmi_data jumper_ezpad_mini3_data = { |
| 52 | .acpi_name = "MSSL1680:00", |
| 53 | .properties = jumper_ezpad_mini3_props, |
| 54 | }; |
| 55 | |
Hans de Goede | 828615f | 2018-05-30 12:43:39 +0200 | [diff] [blame^] | 56 | static const struct property_entry jumper_ezpad_6_pro_props[] = { |
| 57 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1980), |
| 58 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1500), |
| 59 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro.fw"), |
| 60 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 61 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 62 | { } |
| 63 | }; |
| 64 | |
| 65 | static const struct silead_ts_dmi_data jumper_ezpad_6_pro_data = { |
| 66 | .acpi_name = "MSSL1680:00", |
| 67 | .properties = jumper_ezpad_6_pro_props, |
| 68 | }; |
| 69 | |
Hans de Goede | 6b8e7d8 | 2017-03-22 16:55:54 +0100 | [diff] [blame] | 70 | static const struct property_entry dexp_ursus_7w_props[] = { |
| 71 | PROPERTY_ENTRY_U32("touchscreen-size-x", 890), |
| 72 | PROPERTY_ENTRY_U32("touchscreen-size-y", 630), |
| 73 | PROPERTY_ENTRY_STRING("firmware-name", "gsl1686-dexp-ursus-7w.fw"), |
| 74 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
Hans de Goede | aaa4096 | 2017-10-19 09:17:28 +0200 | [diff] [blame] | 75 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
Hans de Goede | 6b8e7d8 | 2017-03-22 16:55:54 +0100 | [diff] [blame] | 76 | { } |
| 77 | }; |
| 78 | |
| 79 | static const struct silead_ts_dmi_data dexp_ursus_7w_data = { |
| 80 | .acpi_name = "MSSL1680:00", |
| 81 | .properties = dexp_ursus_7w_props, |
| 82 | }; |
| 83 | |
Bernhard Übelacker | f4c12d4 | 2017-11-26 19:32:58 +0100 | [diff] [blame] | 84 | static const struct property_entry surftab_twin_10_1_st10432_8_props[] = { |
| 85 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1900), |
| 86 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1280), |
| 87 | PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1), |
| 88 | PROPERTY_ENTRY_STRING("firmware-name", |
| 89 | "gsl3670-surftab-twin-10-1-st10432-8.fw"), |
| 90 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 91 | { } |
| 92 | }; |
| 93 | |
| 94 | static const struct silead_ts_dmi_data surftab_twin_10_1_st10432_8_data = { |
| 95 | .acpi_name = "MSSL1680:00", |
| 96 | .properties = surftab_twin_10_1_st10432_8_props, |
| 97 | }; |
| 98 | |
Hans de Goede | 5b7bb3a | 2017-04-09 11:07:44 +0200 | [diff] [blame] | 99 | static const struct property_entry surftab_wintron70_st70416_6_props[] = { |
| 100 | PROPERTY_ENTRY_U32("touchscreen-size-x", 884), |
| 101 | PROPERTY_ENTRY_U32("touchscreen-size-y", 632), |
| 102 | PROPERTY_ENTRY_STRING("firmware-name", |
| 103 | "gsl1686-surftab-wintron70-st70416-6.fw"), |
| 104 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
Hans de Goede | aaa4096 | 2017-10-19 09:17:28 +0200 | [diff] [blame] | 105 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
Hans de Goede | 5b7bb3a | 2017-04-09 11:07:44 +0200 | [diff] [blame] | 106 | { } |
| 107 | }; |
| 108 | |
| 109 | static const struct silead_ts_dmi_data surftab_wintron70_st70416_6_data = { |
| 110 | .acpi_name = "MSSL1680:00", |
| 111 | .properties = surftab_wintron70_st70416_6_props, |
| 112 | }; |
| 113 | |
Hans de Goede | d9ca30b | 2017-05-07 14:35:15 +0200 | [diff] [blame] | 114 | static const struct property_entry gp_electronic_t701_props[] = { |
| 115 | PROPERTY_ENTRY_U32("touchscreen-size-x", 960), |
| 116 | PROPERTY_ENTRY_U32("touchscreen-size-y", 640), |
Hans de Goede | 5c24c05 | 2017-10-19 09:44:14 +0200 | [diff] [blame] | 117 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"), |
| 118 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
Hans de Goede | d9ca30b | 2017-05-07 14:35:15 +0200 | [diff] [blame] | 119 | PROPERTY_ENTRY_STRING("firmware-name", |
| 120 | "gsl1680-gp-electronic-t701.fw"), |
| 121 | { } |
| 122 | }; |
| 123 | |
| 124 | static const struct silead_ts_dmi_data gp_electronic_t701_data = { |
| 125 | .acpi_name = "MSSL1680:00", |
| 126 | .properties = gp_electronic_t701_props, |
| 127 | }; |
| 128 | |
Hans de Goede | 13fadfa | 2017-06-15 08:48:32 +0200 | [diff] [blame] | 129 | static const struct property_entry pipo_w2s_props[] = { |
| 130 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1660), |
| 131 | PROPERTY_ENTRY_U32("touchscreen-size-y", 880), |
| 132 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"), |
| 133 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 134 | PROPERTY_ENTRY_STRING("firmware-name", |
| 135 | "gsl1680-pipo-w2s.fw"), |
| 136 | { } |
| 137 | }; |
| 138 | |
| 139 | static const struct silead_ts_dmi_data pipo_w2s_data = { |
| 140 | .acpi_name = "MSSL1680:00", |
| 141 | .properties = pipo_w2s_props, |
| 142 | }; |
| 143 | |
Hans de Goede | f4d342c | 2017-06-15 08:48:31 +0200 | [diff] [blame] | 144 | static const struct property_entry pov_mobii_wintab_p800w_props[] = { |
| 145 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1800), |
| 146 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1150), |
| 147 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 148 | PROPERTY_ENTRY_STRING("firmware-name", |
| 149 | "gsl3692-pov-mobii-wintab-p800w.fw"), |
Hans de Goede | aaa4096 | 2017-10-19 09:17:28 +0200 | [diff] [blame] | 150 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
Hans de Goede | f4d342c | 2017-06-15 08:48:31 +0200 | [diff] [blame] | 151 | { } |
| 152 | }; |
| 153 | |
| 154 | static const struct silead_ts_dmi_data pov_mobii_wintab_p800w_data = { |
| 155 | .acpi_name = "MSSL1680:00", |
| 156 | .properties = pov_mobii_wintab_p800w_props, |
| 157 | }; |
| 158 | |
Hans de Goede | 4edfc54 | 2017-07-01 12:15:22 +0200 | [diff] [blame] | 159 | static const struct property_entry itworks_tw891_props[] = { |
| 160 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1600), |
| 161 | PROPERTY_ENTRY_U32("touchscreen-size-y", 890), |
| 162 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
| 163 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 164 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"), |
| 165 | { } |
| 166 | }; |
| 167 | |
| 168 | static const struct silead_ts_dmi_data itworks_tw891_data = { |
| 169 | .acpi_name = "MSSL1680:00", |
| 170 | .properties = itworks_tw891_props, |
| 171 | }; |
| 172 | |
Hans de Goede | 485f2a5 | 2017-10-04 15:30:12 +0200 | [diff] [blame] | 173 | static const struct property_entry chuwi_hi8_pro_props[] = { |
| 174 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1728), |
| 175 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1148), |
| 176 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 177 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"), |
Hans de Goede | aaa4096 | 2017-10-19 09:17:28 +0200 | [diff] [blame] | 178 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
Hans de Goede | 485f2a5 | 2017-10-04 15:30:12 +0200 | [diff] [blame] | 179 | { } |
| 180 | }; |
| 181 | |
| 182 | static const struct silead_ts_dmi_data chuwi_hi8_pro_data = { |
| 183 | .acpi_name = "MSSL1680:00", |
| 184 | .properties = chuwi_hi8_pro_props, |
| 185 | }; |
| 186 | |
Sergey Tshovrebov | 3fcf2b2 | 2017-10-27 12:27:07 +0200 | [diff] [blame] | 187 | static const struct property_entry digma_citi_e200_props[] = { |
| 188 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1980), |
| 189 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1500), |
| 190 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
| 191 | PROPERTY_ENTRY_STRING("firmware-name", |
| 192 | "gsl1686-digma_citi_e200.fw"), |
| 193 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 194 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 195 | { } |
| 196 | }; |
| 197 | |
| 198 | static const struct silead_ts_dmi_data digma_citi_e200_data = { |
| 199 | .acpi_name = "MSSL1680:00", |
| 200 | .properties = digma_citi_e200_props, |
| 201 | }; |
| 202 | |
Nerijus Baliunas | 170e9a5 | 2017-12-11 00:02:13 +0200 | [diff] [blame] | 203 | static const struct property_entry onda_obook_20_plus_props[] = { |
| 204 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1728), |
| 205 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1148), |
| 206 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"), |
| 207 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
| 208 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 209 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"), |
| 210 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 211 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 212 | { } |
| 213 | }; |
| 214 | |
| 215 | static const struct silead_ts_dmi_data onda_obook_20_plus_data = { |
| 216 | .acpi_name = "MSSL1680:00", |
| 217 | .properties = onda_obook_20_plus_props, |
| 218 | }; |
| 219 | |
Maruyama Shohei | d2d541e | 2017-12-20 11:30:08 +0100 | [diff] [blame] | 220 | static const struct property_entry chuwi_hi8_props[] = { |
| 221 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1665), |
| 222 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1140), |
| 223 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 224 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 225 | PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"), |
| 226 | { } |
| 227 | }; |
| 228 | |
| 229 | static const struct silead_ts_dmi_data chuwi_hi8_data = { |
| 230 | .acpi_name = "MSSL0001:00", |
| 231 | .properties = chuwi_hi8_props, |
| 232 | }; |
| 233 | |
Hans de Goede | f1905b9 | 2017-12-20 11:30:09 +0100 | [diff] [blame] | 234 | static const struct property_entry chuwi_vi8_props[] = { |
| 235 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1724), |
| 236 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1140), |
| 237 | PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), |
| 238 | PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-vi8.fw"), |
| 239 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 240 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 241 | { } |
| 242 | }; |
| 243 | |
| 244 | static const struct silead_ts_dmi_data chuwi_vi8_data = { |
| 245 | .acpi_name = "MSSL1680:00", |
| 246 | .properties = chuwi_vi8_props, |
| 247 | }; |
| 248 | |
Hans de Goede | 2aeb2c3 | 2017-12-25 13:45:25 +0100 | [diff] [blame] | 249 | static const struct property_entry trekstor_primebook_c13_props[] = { |
| 250 | PROPERTY_ENTRY_U32("touchscreen-size-x", 2624), |
| 251 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1920), |
| 252 | PROPERTY_ENTRY_STRING("firmware-name", |
| 253 | "gsl1680-trekstor-primebook-c13.fw"), |
| 254 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 255 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 256 | { } |
| 257 | }; |
| 258 | |
| 259 | static const struct silead_ts_dmi_data trekstor_primebook_c13_data = { |
| 260 | .acpi_name = "MSSL1680:00", |
| 261 | .properties = trekstor_primebook_c13_props, |
| 262 | }; |
| 263 | |
Paul Cercueil | a346aa2 | 2018-01-02 19:39:27 +0100 | [diff] [blame] | 264 | static const struct property_entry teclast_x98plus2_props[] = { |
| 265 | PROPERTY_ENTRY_U32("touchscreen-size-x", 2048), |
| 266 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1280), |
| 267 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"), |
| 268 | PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), |
| 269 | PROPERTY_ENTRY_STRING("firmware-name", |
| 270 | "gsl1686-teclast_x98plus2.fw"), |
| 271 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 272 | { } |
| 273 | }; |
| 274 | |
| 275 | static const struct silead_ts_dmi_data teclast_x98plus2_data = { |
| 276 | .acpi_name = "MSSL1680:00", |
| 277 | .properties = teclast_x98plus2_props, |
| 278 | }; |
| 279 | |
Alberto Ponces | c58a4f2 | 2018-01-23 18:33:38 +0000 | [diff] [blame] | 280 | static const struct property_entry teclast_x3_plus_props[] = { |
| 281 | PROPERTY_ENTRY_U32("touchscreen-size-x", 1980), |
| 282 | PROPERTY_ENTRY_U32("touchscreen-size-y", 1500), |
| 283 | PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"), |
| 284 | PROPERTY_ENTRY_U32("silead,max-fingers", 10), |
| 285 | PROPERTY_ENTRY_BOOL("silead,home-button"), |
| 286 | { } |
| 287 | }; |
| 288 | |
| 289 | static const struct silead_ts_dmi_data teclast_x3_plus_data = { |
| 290 | .acpi_name = "MSSL1680:00", |
| 291 | .properties = teclast_x3_plus_props, |
| 292 | }; |
| 293 | |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 294 | static const struct dmi_system_id silead_ts_dmi_table[] = { |
| 295 | { |
| 296 | /* CUBE iwork8 Air */ |
| 297 | .driver_data = (void *)&cube_iwork8_air_data, |
| 298 | .matches = { |
| 299 | DMI_MATCH(DMI_SYS_VENDOR, "cube"), |
| 300 | DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"), |
| 301 | DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), |
| 302 | }, |
| 303 | }, |
| 304 | { |
| 305 | /* Jumper EZpad mini3 */ |
| 306 | .driver_data = (void *)&jumper_ezpad_mini3_data, |
| 307 | .matches = { |
| 308 | DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), |
| 309 | /* jumperx.T87.KFBNEEA02 with the version-nr dropped */ |
| 310 | DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"), |
| 311 | }, |
| 312 | }, |
Hans de Goede | 6b8e7d8 | 2017-03-22 16:55:54 +0100 | [diff] [blame] | 313 | { |
Hans de Goede | 828615f | 2018-05-30 12:43:39 +0200 | [diff] [blame^] | 314 | /* Jumper EZpad 6 Pro */ |
| 315 | .driver_data = (void *)&jumper_ezpad_6_pro_data, |
| 316 | .matches = { |
| 317 | DMI_MATCH(DMI_SYS_VENDOR, "Jumper"), |
| 318 | DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"), |
| 319 | DMI_MATCH(DMI_BIOS_VERSION, "5.12"), |
| 320 | /* Above matches are too generic, add bios-date match */ |
| 321 | DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"), |
| 322 | }, |
| 323 | }, |
| 324 | { |
Hans de Goede | 6b8e7d8 | 2017-03-22 16:55:54 +0100 | [diff] [blame] | 325 | /* DEXP Ursus 7W */ |
| 326 | .driver_data = (void *)&dexp_ursus_7w_data, |
| 327 | .matches = { |
| 328 | DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), |
| 329 | DMI_MATCH(DMI_PRODUCT_NAME, "7W"), |
| 330 | }, |
| 331 | }, |
Hans de Goede | 5b7bb3a | 2017-04-09 11:07:44 +0200 | [diff] [blame] | 332 | { |
Bernhard Übelacker | f4c12d4 | 2017-11-26 19:32:58 +0100 | [diff] [blame] | 333 | /* TrekStor SurfTab twin 10.1 ST10432-8 */ |
| 334 | .driver_data = (void *)&surftab_twin_10_1_st10432_8_data, |
| 335 | .matches = { |
| 336 | DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"), |
| 337 | DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"), |
| 338 | }, |
| 339 | }, |
| 340 | { |
Hans de Goede | 5b7bb3a | 2017-04-09 11:07:44 +0200 | [diff] [blame] | 341 | /* Trekstor Surftab Wintron 7.0 ST70416-6 */ |
| 342 | .driver_data = (void *)&surftab_wintron70_st70416_6_data, |
| 343 | .matches = { |
| 344 | DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), |
| 345 | DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"), |
| 346 | /* Exact match, different versions need different fw */ |
| 347 | DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"), |
| 348 | }, |
| 349 | }, |
Hans de Goede | d9ca30b | 2017-05-07 14:35:15 +0200 | [diff] [blame] | 350 | { |
Hans de Goede | 4245c15 | 2018-01-16 20:24:15 +0100 | [diff] [blame] | 351 | /* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */ |
| 352 | .driver_data = (void *)&surftab_wintron70_st70416_6_data, |
| 353 | .matches = { |
| 354 | DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"), |
| 355 | DMI_MATCH(DMI_PRODUCT_NAME, |
| 356 | "SurfTab wintron 7.0 ST70416-6"), |
| 357 | /* Exact match, different versions need different fw */ |
| 358 | DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"), |
| 359 | }, |
| 360 | }, |
| 361 | { |
Hans de Goede | c3a73ed | 2017-07-12 13:15:11 +0200 | [diff] [blame] | 362 | /* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */ |
| 363 | .driver_data = (void *)&surftab_wintron70_st70416_6_data, |
| 364 | .matches = { |
| 365 | DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"), |
| 366 | DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"), |
| 367 | /* Exact match, different versions need different fw */ |
| 368 | DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"), |
| 369 | }, |
| 370 | }, |
| 371 | { |
Hans de Goede | d9ca30b | 2017-05-07 14:35:15 +0200 | [diff] [blame] | 372 | /* GP-electronic T701 */ |
| 373 | .driver_data = (void *)&gp_electronic_t701_data, |
| 374 | .matches = { |
| 375 | DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), |
| 376 | DMI_MATCH(DMI_PRODUCT_NAME, "T701"), |
| 377 | DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"), |
| 378 | }, |
| 379 | }, |
Hans de Goede | 13fadfa | 2017-06-15 08:48:32 +0200 | [diff] [blame] | 380 | { |
| 381 | /* Pipo W2S */ |
| 382 | .driver_data = (void *)&pipo_w2s_data, |
| 383 | .matches = { |
| 384 | DMI_MATCH(DMI_SYS_VENDOR, "PIPO"), |
| 385 | DMI_MATCH(DMI_PRODUCT_NAME, "W2S"), |
| 386 | }, |
| 387 | }, |
Hans de Goede | f4d342c | 2017-06-15 08:48:31 +0200 | [diff] [blame] | 388 | { |
| 389 | /* Point of View mobii wintab p800w */ |
| 390 | .driver_data = (void *)&pov_mobii_wintab_p800w_data, |
| 391 | .matches = { |
| 392 | DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), |
| 393 | DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"), |
| 394 | DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"), |
| 395 | /* Above matches are too generic, add bios-date match */ |
| 396 | DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"), |
| 397 | }, |
| 398 | }, |
Hans de Goede | 4edfc54 | 2017-07-01 12:15:22 +0200 | [diff] [blame] | 399 | { |
| 400 | /* I.T.Works TW891 */ |
| 401 | .driver_data = (void *)&itworks_tw891_data, |
| 402 | .matches = { |
| 403 | DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."), |
| 404 | DMI_MATCH(DMI_PRODUCT_NAME, "TW891"), |
| 405 | }, |
| 406 | }, |
Hans de Goede | 485f2a5 | 2017-10-04 15:30:12 +0200 | [diff] [blame] | 407 | { |
| 408 | /* Chuwi Hi8 Pro */ |
| 409 | .driver_data = (void *)&chuwi_hi8_pro_data, |
| 410 | .matches = { |
| 411 | DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"), |
| 412 | DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"), |
| 413 | }, |
| 414 | }, |
Sergey Tshovrebov | 3fcf2b2 | 2017-10-27 12:27:07 +0200 | [diff] [blame] | 415 | { |
| 416 | /* Digma Citi E200 */ |
| 417 | .driver_data = (void *)&digma_citi_e200_data, |
| 418 | .matches = { |
| 419 | DMI_MATCH(DMI_SYS_VENDOR, "Digma"), |
| 420 | DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"), |
| 421 | DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), |
| 422 | }, |
| 423 | }, |
Nerijus Baliunas | 170e9a5 | 2017-12-11 00:02:13 +0200 | [diff] [blame] | 424 | { |
| 425 | /* Onda oBook 20 Plus */ |
| 426 | .driver_data = (void *)&onda_obook_20_plus_data, |
| 427 | .matches = { |
| 428 | DMI_MATCH(DMI_SYS_VENDOR, "ONDA"), |
| 429 | DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"), |
| 430 | }, |
| 431 | }, |
Maruyama Shohei | d2d541e | 2017-12-20 11:30:08 +0100 | [diff] [blame] | 432 | { |
| 433 | /* Chuwi Hi8 */ |
| 434 | .driver_data = (void *)&chuwi_hi8_data, |
| 435 | .matches = { |
| 436 | DMI_MATCH(DMI_SYS_VENDOR, "ilife"), |
| 437 | DMI_MATCH(DMI_PRODUCT_NAME, "S806"), |
| 438 | }, |
| 439 | }, |
Hans de Goede | f1905b9 | 2017-12-20 11:30:09 +0100 | [diff] [blame] | 440 | { |
| 441 | /* Chuwi Vi8 (CWI506) */ |
| 442 | .driver_data = (void *)&chuwi_vi8_data, |
| 443 | .matches = { |
| 444 | DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), |
| 445 | DMI_MATCH(DMI_PRODUCT_NAME, "i86"), |
| 446 | DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"), |
| 447 | }, |
| 448 | }, |
Hans de Goede | 2aeb2c3 | 2017-12-25 13:45:25 +0100 | [diff] [blame] | 449 | { |
| 450 | /* Trekstor Primebook C13 */ |
| 451 | .driver_data = (void *)&trekstor_primebook_c13_data, |
| 452 | .matches = { |
| 453 | DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"), |
| 454 | DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"), |
| 455 | }, |
| 456 | }, |
Paul Cercueil | a346aa2 | 2018-01-02 19:39:27 +0100 | [diff] [blame] | 457 | { |
| 458 | /* Teclast X98 Plus II */ |
| 459 | .driver_data = (void *)&teclast_x98plus2_data, |
| 460 | .matches = { |
| 461 | DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"), |
| 462 | DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"), |
| 463 | }, |
| 464 | }, |
Alberto Ponces | c58a4f2 | 2018-01-23 18:33:38 +0000 | [diff] [blame] | 465 | { |
| 466 | /* Teclast X3 Plus */ |
| 467 | .driver_data = (void *)&teclast_x3_plus_data, |
| 468 | .matches = { |
| 469 | DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"), |
| 470 | DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"), |
| 471 | DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"), |
| 472 | }, |
| 473 | }, |
Hans de Goede | 5488bfd | 2018-02-22 11:18:38 +0100 | [diff] [blame] | 474 | { |
| 475 | /* I.T.Works TW701 */ |
| 476 | .driver_data = (void *)&surftab_wintron70_st70416_6_data, |
| 477 | .matches = { |
| 478 | DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), |
| 479 | DMI_MATCH(DMI_PRODUCT_NAME, "i71c"), |
| 480 | DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"), |
| 481 | }, |
| 482 | }, |
Hans de Goede | 24e2bb3 | 2018-03-09 15:03:58 +0100 | [diff] [blame] | 483 | { |
| 484 | /* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */ |
| 485 | .driver_data = (void *)&chuwi_vi8_data, |
| 486 | .matches = { |
| 487 | DMI_MATCH(DMI_SYS_VENDOR, "YOURS"), |
| 488 | DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"), |
| 489 | }, |
| 490 | }, |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 491 | { }, |
| 492 | }; |
| 493 | |
Dmitry Torokhov | f22265b | 2017-04-03 20:25:14 -0700 | [diff] [blame] | 494 | static const struct silead_ts_dmi_data *silead_ts_data; |
| 495 | |
Dmitry Torokhov | e105396 | 2017-04-03 20:25:13 -0700 | [diff] [blame] | 496 | static void silead_ts_dmi_add_props(struct i2c_client *client) |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 497 | { |
Dmitry Torokhov | e105396 | 2017-04-03 20:25:13 -0700 | [diff] [blame] | 498 | struct device *dev = &client->dev; |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 499 | int error; |
| 500 | |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 501 | if (has_acpi_companion(dev) && |
Dmitry Torokhov | f22265b | 2017-04-03 20:25:14 -0700 | [diff] [blame] | 502 | !strncmp(silead_ts_data->acpi_name, client->name, I2C_NAME_SIZE)) { |
| 503 | error = device_add_properties(dev, silead_ts_data->properties); |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 504 | if (error) |
| 505 | dev_err(dev, "failed to add properties: %d\n", error); |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | static int silead_ts_dmi_notifier_call(struct notifier_block *nb, |
| 510 | unsigned long action, void *data) |
| 511 | { |
| 512 | struct device *dev = data; |
Dmitry Torokhov | e105396 | 2017-04-03 20:25:13 -0700 | [diff] [blame] | 513 | struct i2c_client *client; |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 514 | |
| 515 | switch (action) { |
| 516 | case BUS_NOTIFY_ADD_DEVICE: |
Dmitry Torokhov | e105396 | 2017-04-03 20:25:13 -0700 | [diff] [blame] | 517 | client = i2c_verify_client(dev); |
| 518 | if (client) |
| 519 | silead_ts_dmi_add_props(client); |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 520 | break; |
| 521 | |
| 522 | default: |
| 523 | break; |
| 524 | } |
| 525 | |
| 526 | return 0; |
| 527 | } |
| 528 | |
| 529 | static struct notifier_block silead_ts_dmi_notifier = { |
| 530 | .notifier_call = silead_ts_dmi_notifier_call, |
| 531 | }; |
| 532 | |
| 533 | static int __init silead_ts_dmi_init(void) |
| 534 | { |
Dmitry Torokhov | f22265b | 2017-04-03 20:25:14 -0700 | [diff] [blame] | 535 | const struct dmi_system_id *dmi_id; |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 536 | int error; |
| 537 | |
Dmitry Torokhov | f22265b | 2017-04-03 20:25:14 -0700 | [diff] [blame] | 538 | dmi_id = dmi_first_match(silead_ts_dmi_table); |
| 539 | if (!dmi_id) |
| 540 | return 0; /* Not an error */ |
| 541 | |
| 542 | silead_ts_data = dmi_id->driver_data; |
| 543 | |
Hans de Goede | cef9dd8 | 2017-01-23 18:35:30 +0100 | [diff] [blame] | 544 | error = bus_register_notifier(&i2c_bus_type, &silead_ts_dmi_notifier); |
| 545 | if (error) |
| 546 | pr_err("%s: failed to register i2c bus notifier: %d\n", |
| 547 | __func__, error); |
| 548 | |
| 549 | return error; |
| 550 | } |
| 551 | |
| 552 | /* |
| 553 | * We are registering out notifier after i2c core is initialized and i2c bus |
| 554 | * itself is ready (which happens at postcore initcall level), but before |
| 555 | * ACPI starts enumerating devices (at subsys initcall level). |
| 556 | */ |
| 557 | arch_initcall(silead_ts_dmi_init); |