1
2
3
4
5
6
7
8
9
10
11#include <linux/acpi.h>
12#include <linux/dmi.h>
13#include <asm/cpu_device_id.h>
14#include <asm/intel-family.h>
15#include "../internal.h"
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33struct always_present_id {
34 struct acpi_device_id hid[2];
35 struct x86_cpu_id cpu_ids[2];
36 struct dmi_system_id dmi_ids[2];
37 const char *uid;
38};
39
40#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
41
42#define ENTRY(hid, uid, cpu_models, dmi...) { \
43 { { hid, }, {} }, \
44 { cpu_models, {} }, \
45 { { .matches = dmi }, {} }, \
46 uid, \
47}
48
49static const struct always_present_id always_present_ids[] = {
50
51
52
53
54 ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT), {}),
55 ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
56
57
58 ENTRY("80862289", "2", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
59 DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
60 }),
61
62
63
64
65 ENTRY("INT0002", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
66
67
68
69
70
71
72 ENTRY("SYNA7500", "1", ICPU(INTEL_FAM6_HASWELL_ULT), {
73 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
74 DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
75 }),
76 ENTRY("SYNA7500", "1", ICPU(INTEL_FAM6_HASWELL_ULT), {
77 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
78 DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7139"),
79 }),
80
81
82
83
84
85
86
87
88
89
90
91
92 ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
93 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
94 DMI_MATCH(DMI_BOARD_NAME, "Default string"),
95 DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
96 DMI_MATCH(DMI_BIOS_DATE, "02/21/2017")
97 }),
98 ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
99 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
100 DMI_MATCH(DMI_BOARD_NAME, "Default string"),
101 DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
102 DMI_MATCH(DMI_BIOS_DATE, "03/20/2017")
103 }),
104 ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
105 DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
106 DMI_MATCH(DMI_BOARD_NAME, "Default string"),
107 DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
108 DMI_MATCH(DMI_BIOS_DATE, "05/25/2017")
109 }),
110};
111
112bool acpi_device_always_present(struct acpi_device *adev)
113{
114 bool ret = false;
115 unsigned int i;
116
117 for (i = 0; i < ARRAY_SIZE(always_present_ids); i++) {
118 if (acpi_match_device_ids(adev, always_present_ids[i].hid))
119 continue;
120
121 if (!adev->pnp.unique_id ||
122 strcmp(adev->pnp.unique_id, always_present_ids[i].uid))
123 continue;
124
125 if (!x86_match_cpu(always_present_ids[i].cpu_ids))
126 continue;
127
128 if (always_present_ids[i].dmi_ids[0].matches[0].slot &&
129 !dmi_check_system(always_present_ids[i].dmi_ids))
130 continue;
131
132 ret = true;
133 break;
134 }
135
136 return ret;
137}
138