summaryrefslogtreecommitdiff
path: root/drivers/hwmon/fam15h_power.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 20:50:26 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 20:50:26 (GMT)
commit4cff7adbebf4d25f662b13c6582b945d9d549e25 (patch)
treecfb6bc0aaab6ad7fa7ca2bb07453ed2fd139138c /drivers/hwmon/fam15h_power.c
parent7e3933df9874b70745548ce9177295d11c58fc21 (diff)
parent36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff)
downloadlinux-4cff7adbebf4d25f662b13c6582b945d9d549e25.tar.xz
Merge 4.5-rc2 into staging-next
This fixes a merge issue with the panel driver, and picks up fixes in iio and other drivers that we want here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon/fam15h_power.c')
-rw-r--r--drivers/hwmon/fam15h_power.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index f77eb97..4f695d8 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -90,7 +90,15 @@ static ssize_t show_power(struct device *dev,
pci_bus_read_config_dword(f4->bus, PCI_DEVFN(PCI_SLOT(f4->devfn), 5),
REG_TDP_LIMIT3, &val);
- tdp_limit = val >> 16;
+ /*
+ * On Carrizo and later platforms, ApmTdpLimit bit field
+ * is extended to 16:31 from 16:28.
+ */
+ if (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model >= 0x60)
+ tdp_limit = val >> 16;
+ else
+ tdp_limit = (val >> 16) & 0x1fff;
+
curr_pwr_watts = ((u64)(tdp_limit +
data->base_tdp)) << running_avg_range;
curr_pwr_watts -= running_avg_capture;