xref: /linux/drivers/platform/x86/x86-android-tablets/dmi.c (revision 2f7eedca6cecbfad52d5b52c1550066d9252c947)
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 <hdegoede@redhat.com>
9  */
10 
11 #include <linux/dmi.h>
12 #include <linux/init.h>
13 #include <linux/mod_devicetable.h>
14 #include <linux/module.h>
15 
16 #include "x86-android-tablets.h"
17 
18 const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
19 	{
20 		/* Acer Iconia One 7 B1-750 */
21 		.matches = {
22 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
23 			DMI_MATCH(DMI_PRODUCT_NAME, "VESPA2"),
24 		},
25 		.driver_data = (void *)&acer_b1_750_info,
26 	},
27 	{
28 		/* Advantech MICA-071 */
29 		.matches = {
30 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Advantech"),
31 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MICA-071"),
32 		},
33 		.driver_data = (void *)&advantech_mica_071_info,
34 	},
35 	{
36 		/* Asus MeMO Pad 7 ME176C */
37 		.matches = {
38 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
39 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ME176C"),
40 		},
41 		.driver_data = (void *)&asus_me176c_info,
42 	},
43 	{
44 		/* Asus TF103C */
45 		.matches = {
46 			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
47 			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
48 		},
49 		.driver_data = (void *)&asus_tf103c_info,
50 	},
51 	{
52 		/* Chuwi Hi8 (CWI509) */
53 		.matches = {
54 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
55 			DMI_MATCH(DMI_BOARD_NAME, "BYT-PA03C"),
56 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
57 			DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
58 		},
59 		.driver_data = (void *)&chuwi_hi8_info,
60 	},
61 	{
62 		/* Cyberbook T116 Android version */
63 		.matches = {
64 			DMI_MATCH(DMI_BOARD_VENDOR, "Default string"),
65 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
66 			/* Above strings are much too generic, also match on SKU + BIOS date */
67 			DMI_MATCH(DMI_PRODUCT_SKU, "20170531"),
68 			DMI_MATCH(DMI_BIOS_DATE, "07/12/2017"),
69 		},
70 		.driver_data = (void *)&cyberbook_t116_info,
71 	},
72 	{
73 		/* CZC P10T */
74 		.ident = "CZC ODEON TPC-10 (\"P10T\")",
75 		.matches = {
76 			DMI_MATCH(DMI_SYS_VENDOR, "CZC"),
77 			DMI_MATCH(DMI_PRODUCT_NAME, "ODEON*TPC-10"),
78 		},
79 		.driver_data = (void *)&czc_p10t,
80 	},
81 	{
82 		/* CZC P10T variant */
83 		.ident = "ViewSonic ViewPad 10",
84 		.matches = {
85 			DMI_MATCH(DMI_SYS_VENDOR, "ViewSonic"),
86 			DMI_MATCH(DMI_PRODUCT_NAME, "VPAD10"),
87 		},
88 		.driver_data = (void *)&czc_p10t,
89 	},
90 	{
91 		/* Lenovo Yoga Book X90F / X90L */
92 		.matches = {
93 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
94 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
95 			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
96 		},
97 		.driver_data = (void *)&lenovo_yogabook_x90_info,
98 	},
99 	{
100 		/* Lenovo Yoga Book X91F / X91L */
101 		.matches = {
102 			/* Non exact match to match F + L versions */
103 			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"),
104 		},
105 		.driver_data = (void *)&lenovo_yogabook_x91_info,
106 	},
107 	{
108 		/*
109 		 * Lenovo Yoga Tablet 2 Pro 1380F/L (13") This has more or less
110 		 * the same BIOS as the 830F/L or 1050F/L (8" and 10") below,
111 		 * but unlike the 8" / 10" models which share the same mainboard
112 		 * this model has a different mainboard.
113 		 * This match for the 13" model MUST come before the 8" + 10"
114 		 * match since that one will also match the 13" model!
115 		 */
116 		.matches = {
117 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
118 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
119 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
120 			/* Full match so as to NOT match the 830/1050 BIOS */
121 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21.X64.0005.R00.1504101516"),
122 		},
123 		.driver_data = (void *)&lenovo_yoga_tab2_1380_info,
124 	},
125 	{
126 		/*
127 		 * Lenovo Yoga Tablet 2 830F/L or 1050F/L (The 8" and 10"
128 		 * Lenovo Yoga Tablet 2 use the same mainboard)
129 		 */
130 		.matches = {
131 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
132 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
133 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
134 			/* Partial match on beginning of BIOS version */
135 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
136 		},
137 		.driver_data = (void *)&lenovo_yoga_tab2_830_1050_info,
138 	},
139 	{
140 		/* Lenovo Yoga Tab 3 Pro YT3-X90F */
141 		.matches = {
142 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
143 			DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
144 		},
145 		.driver_data = (void *)&lenovo_yt3_info,
146 	},
147 	{
148 		/* Medion Lifetab S10346 */
149 		.matches = {
150 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
151 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
152 			/* Above strings are much too generic, also match on BIOS date */
153 			DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
154 		},
155 		.driver_data = (void *)&medion_lifetab_s10346_info,
156 	},
157 	{
158 		/* Nextbook Ares 8 (BYT version) */
159 		.matches = {
160 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
161 			DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
162 		},
163 		.driver_data = (void *)&nextbook_ares8_info,
164 	},
165 	{
166 		/* Nextbook Ares 8A (CHT version)*/
167 		.matches = {
168 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
169 			DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
170 			DMI_MATCH(DMI_BIOS_VERSION, "M882"),
171 		},
172 		.driver_data = (void *)&nextbook_ares8a_info,
173 	},
174 	{
175 		/* Peaq C1010 */
176 		.matches = {
177 			DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"),
178 			DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"),
179 		},
180 		.driver_data = (void *)&peaq_c1010_info,
181 	},
182 	{
183 		/* Whitelabel (sold as various brands) TM800A550L */
184 		.matches = {
185 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
186 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
187 			/* Above strings are too generic, also match on BIOS version */
188 			DMI_MATCH(DMI_BIOS_VERSION, "ZY-8-BI-PX4S70VTR400-X423B-005-D"),
189 		},
190 		.driver_data = (void *)&whitelabel_tm800a550l_info,
191 	},
192 	{
193 		/* Xiaomi Mi Pad 2 */
194 		.matches = {
195 			DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
196 			DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
197 		},
198 		.driver_data = (void *)&xiaomi_mipad2_info,
199 	},
200 	{ }
201 };
202 MODULE_DEVICE_TABLE(dmi, x86_android_tablet_ids);
203