This source file includes following definitions.
- intel_pmc_core_release
- pmc_core_platform_init
- pmc_core_platform_exit
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
21 static void intel_pmc_core_release(struct device *dev)
22 {
23
24 }
25
26 static struct platform_device pmc_core_device = {
27 .name = "intel_pmc_core",
28 .dev = {
29 .release = intel_pmc_core_release,
30 },
31 };
32
33
34
35
36
37
38
39
40 static const struct x86_cpu_id intel_pmc_core_platform_ids[] = {
41 INTEL_CPU_FAM6(SKYLAKE_L, pmc_core_device),
42 INTEL_CPU_FAM6(SKYLAKE, pmc_core_device),
43 INTEL_CPU_FAM6(KABYLAKE_L, pmc_core_device),
44 INTEL_CPU_FAM6(KABYLAKE, pmc_core_device),
45 INTEL_CPU_FAM6(CANNONLAKE_L, pmc_core_device),
46 INTEL_CPU_FAM6(ICELAKE_L, pmc_core_device),
47 INTEL_CPU_FAM6(COMETLAKE, pmc_core_device),
48 INTEL_CPU_FAM6(COMETLAKE_L, pmc_core_device),
49 {}
50 };
51 MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);
52
53 static int __init pmc_core_platform_init(void)
54 {
55
56 if (acpi_dev_present("INT33A1", NULL, -1))
57 return -ENODEV;
58
59 if (!x86_match_cpu(intel_pmc_core_platform_ids))
60 return -ENODEV;
61
62 return platform_device_register(&pmc_core_device);
63 }
64
65 static void __exit pmc_core_platform_exit(void)
66 {
67 platform_device_unregister(&pmc_core_device);
68 }
69
70 module_init(pmc_core_platform_init);
71 module_exit(pmc_core_platform_exit);
72 MODULE_LICENSE("GPL v2");