xref: /linux/drivers/platform/x86/x86-android-tablets/dmi.c (revision cbae17630954cb89f2bdf5bbadfd3aa81ea67283)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * DMI based code to deal with broken DSDTs on X86 tablets which ship with
4  * Android as (part of) the factory image. The factory kernels shipped on these
5  * devices typically have a bunch of things hardcoded, rather than specified
6  * in their DSDT.
7  *
8  * Copyright (C) 2021-2023 Hans de Goede <hansg@kernel.org>
9  */
10 
11 #include <linux/dmi.h>
12 #include <linux/init.h>
13 #include <linux/module.h>
14 
15 #include "x86-android-tablets.h"
16 
17 const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
18 	{
19 		/* Acer Iconia One 8 A1-840 (non FHD version) */
20 		.matches = {
21 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
22 			DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
23 			/* Above strings are too generic also match BIOS date */
24 			DMI_MATCH(DMI_BIOS_DATE, "04/01/2014"),
25 		},
26 		.driver_data = (void *)&acer_a1_840_info,
27 	},
28 	{
29 		/* Acer Iconia One 7 B1-750 */
30 		.matches = {
31 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
32 			DMI_MATCH(DMI_PRODUCT_NAME, "VESPA2"),
33 		},
34 		.driver_data = (void *)&acer_b1_750_info,
35 	},
36 	{
37 		/* Advantech MICA-071 */
38 		.matches = {
39 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Advantech"),
40 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MICA-071"),
41 		},
42 		.driver_data = (void *)&advantech_mica_071_info,
43 	},
44 	{
45 		/* Asus MeMO Pad 7 ME176C */
46 		.matches = {
47 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
48 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ME176C"),
49 		},
50 		.driver_data = (void *)&asus_me176c_info,
51 	},
52 	{
53 		/* Asus TF103C */
54 		.matches = {
55 			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
56 			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
57 		},
58 		.driver_data = (void *)&asus_tf103c_info,
59 	},
60 	{
61 		/* Chuwi Hi8 (CWI509) */
62 		.matches = {
63 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
64 			DMI_MATCH(DMI_BOARD_NAME, "BYT-PA03C"),
65 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
66 			DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
67 		},
68 		.driver_data = (void *)&chuwi_hi8_info,
69 	},
70 	{
71 		/* Cyberbook T116 Android version */
72 		.matches = {
73 			DMI_MATCH(DMI_BOARD_VENDOR, "Default string"),
74 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
75 			/* Above strings are much too generic, also match on SKU + BIOS date */
76 			DMI_MATCH(DMI_PRODUCT_SKU, "20170531"),
77 			DMI_MATCH(DMI_BIOS_DATE, "07/12/2017"),
78 		},
79 		.driver_data = (void *)&cyberbook_t116_info,
80 	},
81 	{
82 		/* CZC P10T */
83 		.ident = "CZC ODEON TPC-10 (\"P10T\")",
84 		.matches = {
85 			DMI_MATCH(DMI_SYS_VENDOR, "CZC"),
86 			DMI_MATCH(DMI_PRODUCT_NAME, "ODEON*TPC-10"),
87 		},
88 		.driver_data = (void *)&czc_p10t,
89 	},
90 	{
91 		/* CZC P10T variant */
92 		.ident = "ViewSonic ViewPad 10",
93 		.matches = {
94 			DMI_MATCH(DMI_SYS_VENDOR, "ViewSonic"),
95 			DMI_MATCH(DMI_PRODUCT_NAME, "VPAD10"),
96 		},
97 		.driver_data = (void *)&czc_p10t,
98 	},
99 	{
100 		/* Lenovo Yoga Book X90F / X90L */
101 		.matches = {
102 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
103 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
104 			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
105 		},
106 		.driver_data = (void *)&lenovo_yogabook_x90_info,
107 	},
108 	{
109 		/* Lenovo Yoga Book X91F / X91L */
110 		.matches = {
111 			/* Inexact match to match F + L versions */
112 			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"),
113 		},
114 		.driver_data = (void *)&lenovo_yogabook_x91_info,
115 	},
116 	{
117 		/*
118 		 * Lenovo Yoga Tablet 2 Pro 1380F/L (13")
119 		 * This has more or less the same BIOS as the 830F/L or 1050F/L
120 		 * (8" and 10") below, but unlike the 8"/10" models which share
121 		 * the same mainboard this model has a different mainboard.
122 		 * This match for the 13" model MUST come before the 8" + 10"
123 		 * match since that one will also match the 13" model!
124 		 */
125 		.matches = {
126 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
127 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
128 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
129 			/* Full match so as to NOT match the 830/1050 BIOS */
130 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21.X64.0005.R00.1504101516"),
131 		},
132 		.driver_data = (void *)&lenovo_yoga_tab2_1380_info,
133 	},
134 	{
135 		/*
136 		 * Lenovo Yoga Tablet 2 830F/L or 1050F/L
137 		 * The 8" and 10" Lenovo Yoga Tablet 2 use the same mainboard.
138 		 */
139 		.matches = {
140 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
141 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
142 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
143 			/* Partial match on beginning of BIOS version */
144 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
145 		},
146 		.driver_data = (void *)&lenovo_yoga_tab2_830_1050_info,
147 	},
148 	{
149 		/* Lenovo Yoga Tab 3 Pro YT3-X90F */
150 		.matches = {
151 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
152 			DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
153 		},
154 		.driver_data = (void *)&lenovo_yt3_info,
155 	},
156 	{
157 		/* Medion Lifetab S10346 */
158 		.matches = {
159 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
160 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
161 			/* Above strings are much too generic, also match on BIOS date */
162 			DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
163 		},
164 		.driver_data = (void *)&medion_lifetab_s10346_info,
165 	},
166 	{
167 		/* Nextbook Ares 8 (BYT version) */
168 		.matches = {
169 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
170 			DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
171 		},
172 		.driver_data = (void *)&nextbook_ares8_info,
173 	},
174 	{
175 		/* Nextbook Ares 8A (CHT version) */
176 		.matches = {
177 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
178 			DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
179 			DMI_MATCH(DMI_BIOS_VERSION, "M882"),
180 		},
181 		.driver_data = (void *)&nextbook_ares8a_info,
182 	},
183 	{
184 		/* Peaq C1010 */
185 		.matches = {
186 			DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"),
187 			DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"),
188 		},
189 		.driver_data = (void *)&peaq_c1010_info,
190 	},
191 	{
192 		/* Vexia Edu Atla 10 tablet 5V version */
193 		.matches = {
194 			/* Having all 3 of these not set is somewhat unique */
195 			DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
196 			DMI_MATCH(DMI_PRODUCT_NAME, "To be filled by O.E.M."),
197 			DMI_MATCH(DMI_BOARD_NAME, "To be filled by O.E.M."),
198 			/* Above strings are too generic, also match on BIOS date */
199 			DMI_MATCH(DMI_BIOS_DATE, "05/14/2015"),
200 		},
201 		.driver_data = (void *)&vexia_edu_atla10_5v_info,
202 	},
203 	{
204 		/* Vexia Edu Atla 10 tablet 9V version */
205 		.matches = {
206 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
207 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
208 			/* Above strings are too generic, also match on BIOS date */
209 			DMI_MATCH(DMI_BIOS_DATE, "08/25/2014"),
210 		},
211 		.driver_data = (void *)&vexia_edu_atla10_9v_info,
212 	},
213 	{
214 		/* Whitelabel (sold as various brands) TM800A550L */
215 		.matches = {
216 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
217 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
218 			/* Above strings are too generic, also match on BIOS version */
219 			DMI_MATCH(DMI_BIOS_VERSION, "ZY-8-BI-PX4S70VTR400-X423B-005-D"),
220 		},
221 		.driver_data = (void *)&whitelabel_tm800a550l_info,
222 	},
223 	{
224 		/* Xiaomi Mi Pad 2 */
225 		.matches = {
226 			DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
227 			DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
228 		},
229 		.driver_data = (void *)&xiaomi_mipad2_info,
230 	},
231 	{ }
232 };
233 MODULE_DEVICE_TABLE(dmi, x86_android_tablet_ids);
234