1
2
3
4
5
6
7
8
9
10
11
12
13
14#include <linux/acpi.h>
15#include <linux/module.h>
16#include <linux/platform_device.h>
17
18#include <asm/cpu_device_id.h>
19#include <asm/intel-family.h>
20
21static struct platform_device pmc_core_device = {
22 .name = "intel_pmc_core",
23};
24
25
26
27
28
29
30
31
32static const struct x86_cpu_id intel_pmc_core_platform_ids[] = {
33 INTEL_CPU_FAM6(SKYLAKE_MOBILE, pmc_core_device),
34 INTEL_CPU_FAM6(SKYLAKE_DESKTOP, pmc_core_device),
35 INTEL_CPU_FAM6(KABYLAKE_MOBILE, pmc_core_device),
36 INTEL_CPU_FAM6(KABYLAKE_DESKTOP, pmc_core_device),
37 INTEL_CPU_FAM6(CANNONLAKE_MOBILE, pmc_core_device),
38 INTEL_CPU_FAM6(ICELAKE_MOBILE, pmc_core_device),
39 {}
40};
41MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);
42
43static int __init pmc_core_platform_init(void)
44{
45
46 if (acpi_dev_present("INT33A1", NULL, -1))
47 return -ENODEV;
48
49 if (!x86_match_cpu(intel_pmc_core_platform_ids))
50 return -ENODEV;
51
52 return platform_device_register(&pmc_core_device);
53}
54
55static void __exit pmc_core_platform_exit(void)
56{
57 platform_device_unregister(&pmc_core_device);
58}
59
60module_init(pmc_core_platform_init);
61module_exit(pmc_core_platform_exit);
62MODULE_LICENSE("GPL v2");
63