12
12
*/
13
13
14
14
#include <linux/acpi.h>
15
+ #include <linux/dmi.h>
15
16
#include <asm/cpu_device_id.h>
16
17
#include <asm/intel-family.h>
17
18
#include "../internal.h"
20
21
* Some ACPI devices are hidden (status == 0x0) in recent BIOS-es because
21
22
* some recent Windows drivers bind to one device but poke at multiple
22
23
* devices at the same time, so the others get hidden.
24
+ *
25
+ * Some BIOS-es (temporarily) hide specific APCI devices to work around Windows
26
+ * driver bugs. We use DMI matching to match known cases of this.
27
+ *
23
28
* We work around this by always reporting ACPI_STA_DEFAULT for these
24
29
* devices. Note this MUST only be done for devices where this is safe.
25
30
*
31
36
struct always_present_id {
32
37
struct acpi_device_id hid [2 ];
33
38
struct x86_cpu_id cpu_ids [2 ];
39
+ struct dmi_system_id dmi_ids [2 ]; /* Optional */
34
40
const char * uid ;
35
41
};
36
42
37
43
#define ICPU (model ) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
38
44
39
- #define ENTRY (hid , uid , cpu_models ) { \
45
+ #define ENTRY (hid , uid , cpu_models , dmi ... ) { \
40
46
{ { hid, }, {} }, \
41
47
{ cpu_models, {} }, \
48
+ { { .matches = dmi }, {} }, \
42
49
uid, \
43
50
}
44
51
@@ -47,13 +54,35 @@ static const struct always_present_id always_present_ids[] = {
47
54
* Bay / Cherry Trail PWM directly poked by GPU driver in win10,
48
55
* but Linux uses a separate PWM driver, harmless if not used.
49
56
*/
50
- ENTRY ("80860F09" , "1" , ICPU (INTEL_FAM6_ATOM_SILVERMONT1 )),
51
- ENTRY ("80862288" , "1" , ICPU (INTEL_FAM6_ATOM_AIRMONT )),
57
+ ENTRY ("80860F09" , "1" , ICPU (INTEL_FAM6_ATOM_SILVERMONT1 ), {} ),
58
+ ENTRY ("80862288" , "1" , ICPU (INTEL_FAM6_ATOM_AIRMONT ), {} ),
52
59
/*
53
60
* The INT0002 device is necessary to clear wakeup interrupt sources
54
61
* on Cherry Trail devices, without it we get nobody cared IRQ msgs.
55
62
*/
56
- ENTRY ("INT0002" , "1" , ICPU (INTEL_FAM6_ATOM_AIRMONT )),
63
+ ENTRY ("INT0002" , "1" , ICPU (INTEL_FAM6_ATOM_AIRMONT ), {}),
64
+ /*
65
+ * On the Dell Venue 11 Pro 7130 the DSDT hides the touchscreen ACPI
66
+ * device until a certain time after _SB.PCI0.GFX0.LCD.LCD1._ON gets
67
+ * called has passed *and* _STA has been called at least 3 times since.
68
+ */
69
+ ENTRY ("SYNA7500" , "1" , ICPU (INTEL_FAM6_HASWELL_ULT ), {
70
+ DMI_MATCH (DMI_SYS_VENDOR , "Dell Inc." ),
71
+ DMI_MATCH (DMI_PRODUCT_NAME , "Venue 11 Pro 7130" ),
72
+ }),
73
+ /*
74
+ * The GPD win BIOS dated 20170320 has disabled the accelerometer, the
75
+ * drivers sometimes cause crashes under Windows and this is how the
76
+ * manufacturer has solved this :| Note that the the DMI data is less
77
+ * generic then it seems, a board_vendor of "AMI Corporation" is quite
78
+ * rare and a board_name of "Default String" also is rare.
79
+ */
80
+ ENTRY ("KIOX000A" , "1" , ICPU (INTEL_FAM6_ATOM_AIRMONT ), {
81
+ DMI_MATCH (DMI_BOARD_VENDOR , "AMI Corporation" ),
82
+ DMI_MATCH (DMI_BOARD_NAME , "Default string" ),
83
+ DMI_MATCH (DMI_PRODUCT_NAME , "Default string" ),
84
+ DMI_MATCH (DMI_BIOS_DATE , "03/20/2017" )
85
+ }),
57
86
};
58
87
59
88
bool acpi_device_always_present (struct acpi_device * adev )
@@ -76,6 +105,10 @@ bool acpi_device_always_present(struct acpi_device *adev)
76
105
if (!x86_match_cpu (always_present_ids [i ].cpu_ids ))
77
106
continue ;
78
107
108
+ if (always_present_ids [i ].dmi_ids [0 ].matches [0 ].slot &&
109
+ !dmi_check_system (always_present_ids [i ].dmi_ids ))
110
+ continue ;
111
+
79
112
if (old_status != ACPI_STA_DEFAULT ) /* Log only once */
80
113
dev_info (& adev -> dev ,
81
114
"Device [%s] is in always present list\n" ,
0 commit comments