summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2015-12-09 22:56:10 -0500
committerGuenter Roeck <linux@roeck-us.net>2015-12-18 11:20:59 -0500
commiteff2a94598ee0c0c7f293a1d3d1999a5e887797a (patch)
treea887df3f4f9c9c02c61f09d39cbaa8e846f66f06 /drivers/hwmon
parent8d28cd1b1f56f765dc691eeedf853d41f7aaafd3 (diff)
hwmon: (fam15h_power) Add support for AMD new 15h processors
AMD Family 15h Models 70h-7fh processors also support TDP power reporting interface. Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/fam15h_power.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index 5f7067d7b625..f77eb971ce95 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -47,6 +47,8 @@ MODULE_LICENSE("GPL");
47 47
48#define MSR_F15H_CU_MAX_PWR_ACCUMULATOR 0xc001007b 48#define MSR_F15H_CU_MAX_PWR_ACCUMULATOR 0xc001007b
49 49
50#define PCI_DEVICE_ID_AMD_15H_M70H_NB_F4 0x15b4
51
50struct fam15h_power_data { 52struct fam15h_power_data {
51 struct pci_dev *pdev; 53 struct pci_dev *pdev;
52 unsigned int tdp_to_watts; 54 unsigned int tdp_to_watts;
@@ -124,7 +126,7 @@ static int fam15h_power_init_attrs(struct pci_dev *pdev,
124 126
125 if (c->x86 == 0x15 && 127 if (c->x86 == 0x15 &&
126 (c->x86_model <= 0xf || 128 (c->x86_model <= 0xf ||
127 (c->x86_model >= 0x60 && c->x86_model <= 0x6f))) 129 (c->x86_model >= 0x60 && c->x86_model <= 0x7f)))
128 n += 1; 130 n += 1;
129 131
130 fam15h_power_attrs = devm_kcalloc(&pdev->dev, n, 132 fam15h_power_attrs = devm_kcalloc(&pdev->dev, n,
@@ -138,7 +140,7 @@ static int fam15h_power_init_attrs(struct pci_dev *pdev,
138 fam15h_power_attrs[n++] = &dev_attr_power1_crit.attr; 140 fam15h_power_attrs[n++] = &dev_attr_power1_crit.attr;
139 if (c->x86 == 0x15 && 141 if (c->x86 == 0x15 &&
140 (c->x86_model <= 0xf || 142 (c->x86_model <= 0xf ||
141 (c->x86_model >= 0x60 && c->x86_model <= 0x6f))) 143 (c->x86_model >= 0x60 && c->x86_model <= 0x7f)))
142 fam15h_power_attrs[n++] = &dev_attr_power1_input.attr; 144 fam15h_power_attrs[n++] = &dev_attr_power1_input.attr;
143 145
144 data->group.attrs = fam15h_power_attrs; 146 data->group.attrs = fam15h_power_attrs;
@@ -296,6 +298,7 @@ static const struct pci_device_id fam15h_power_id_table[] = {
296 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, 298 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
297 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) }, 299 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) },
298 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M60H_NB_F4) }, 300 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M60H_NB_F4) },
301 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M70H_NB_F4) },
299 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, 302 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
300 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) }, 303 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) },
301 {} 304 {}