.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * amd_freq_sensitivity.c: AMD frequency sensitivity feedback powersave bias |
---|
3 | 4 | * for the ondemand governor. |
---|
.. | .. |
---|
5 | 6 | * Copyright (C) 2013 Advanced Micro Devices, Inc. |
---|
6 | 7 | * |
---|
7 | 8 | * Author: Jacob Shin <jacob.shin@amd.com> |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License version 2 as |
---|
11 | | - * published by the Free Software Foundation. |
---|
12 | 9 | */ |
---|
13 | 10 | |
---|
14 | 11 | #include <linux/kernel.h> |
---|
.. | .. |
---|
21 | 18 | |
---|
22 | 19 | #include <asm/msr.h> |
---|
23 | 20 | #include <asm/cpufeature.h> |
---|
| 21 | +#include <asm/cpu_device_id.h> |
---|
24 | 22 | |
---|
25 | 23 | #include "cpufreq_ondemand.h" |
---|
26 | 24 | |
---|
.. | .. |
---|
111 | 109 | { |
---|
112 | 110 | u64 val; |
---|
113 | 111 | struct pci_dev *pcidev; |
---|
| 112 | + unsigned int pci_vendor; |
---|
114 | 113 | |
---|
115 | | - if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) |
---|
| 114 | + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) |
---|
| 115 | + pci_vendor = PCI_VENDOR_ID_AMD; |
---|
| 116 | + else if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) |
---|
| 117 | + pci_vendor = PCI_VENDOR_ID_HYGON; |
---|
| 118 | + else |
---|
116 | 119 | return -ENODEV; |
---|
117 | 120 | |
---|
118 | | - pcidev = pci_get_device(PCI_VENDOR_ID_AMD, |
---|
| 121 | + pcidev = pci_get_device(pci_vendor, |
---|
119 | 122 | PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, NULL); |
---|
120 | 123 | |
---|
121 | 124 | if (!pcidev) { |
---|
122 | | - if (!static_cpu_has(X86_FEATURE_PROC_FEEDBACK)) |
---|
| 125 | + if (!boot_cpu_has(X86_FEATURE_PROC_FEEDBACK)) |
---|
123 | 126 | return -ENODEV; |
---|
124 | 127 | } |
---|
125 | 128 | |
---|
.. | .. |
---|
141 | 144 | } |
---|
142 | 145 | module_exit(amd_freq_sensitivity_exit); |
---|
143 | 146 | |
---|
144 | | -static const struct x86_cpu_id amd_freq_sensitivity_ids[] = { |
---|
145 | | - X86_FEATURE_MATCH(X86_FEATURE_PROC_FEEDBACK), |
---|
| 147 | +static const struct x86_cpu_id __maybe_unused amd_freq_sensitivity_ids[] = { |
---|
| 148 | + X86_MATCH_FEATURE(X86_FEATURE_PROC_FEEDBACK, NULL), |
---|
146 | 149 | {} |
---|
147 | 150 | }; |
---|
148 | 151 | MODULE_DEVICE_TABLE(x86cpu, amd_freq_sensitivity_ids); |
---|