summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/intel_pch_thermal.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-11 22:26:20 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-11 22:26:20 -0700
commitc971aa3693e1b68086e62645c54a087616217b6f (patch)
tree8ec6d0a1afdf5c2071840e96ab948fa6bb20b17e /drivers/thermal/intel_pch_thermal.c
parent8e7757d83d07cc77ee2661e9615a2f9f4ce540cd (diff)
parentb32b5e14b4e0d40e06f094d2593b447e00acdf37 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal updates from Zhang Rui: - fix resources release in error paths when registering thermal zone. (Christophe Jaillet) - introduce a new thermal driver for on-chip PVT (Process, Voltage and Temperature) monitoring unit implemented on UniPhier SoCs. This driver supports temperature monitoring and alert function. (Kunihiko Hayashi) - Add support for mt2712 chip in the mtk_thermal driver. (Louis Yu) - Add support for RK3328 SOC in rockchip_thermal driver. (Rocky Hao) - cleanup a couple of platform thermal drivers to constify thermal_zone_of_device_ops structures. (Julia Lawall) - a couple of fixes in int340x and intel_pch_thermal thermal driver. (Arvind Yadav, Sumeet Pawnikar, Brian Bian, Ed Swierk, Zhang Rui) * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (27 commits) Thermal: int3406_thermal: fix thermal sysfs I/F thermal: mediatek: minor mtk_thermal.c cleanups thermal: mediatek: extend calibration data for mt2712 chip thermal: mediatek: add Mediatek thermal driver for mt2712 dt-bindings: thermal: Add binding document for Mediatek thermal controller thermal: intel_pch_thermal: Fix enable check on Broadwell-DE thermal: rockchip: Support the RK3328 SOC in thermal driver dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible thermal: bcm2835: constify thermal_zone_of_device_ops structures thermal: exynos: constify thermal_zone_of_device_ops structures thermal: zx2967: constify thermal_zone_of_device_ops structures thermal: rcar_gen3_thermal: constify thermal_zone_of_device_ops structures thermal: qoriq: constify thermal_zone_of_device_ops structures thermal: hisilicon: constify thermal_zone_of_device_ops structures thermal: core: Fix resources release in error paths in thermal_zone_device_register() thermal: core: Use the new 'thermal_zone_destroy_device_groups()' helper function thermal: core: Add some new helper functions to free resources thermal: int3400_thermal: process "thermal table changed" event thermal: uniphier: add UniPhier thermal driver dt-bindings: thermal: add binding documentation for UniPhier thermal monitor ...
Diffstat (limited to 'drivers/thermal/intel_pch_thermal.c')
-rw-r--r--drivers/thermal/intel_pch_thermal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/thermal/intel_pch_thermal.c b/drivers/thermal/intel_pch_thermal.c
index 2b49e8d0fe9e..c60b1cfcc64e 100644
--- a/drivers/thermal/intel_pch_thermal.c
+++ b/drivers/thermal/intel_pch_thermal.c
@@ -49,7 +49,7 @@
#define WPT_TSGPEN 0x84 /* General Purpose Event Enables */
/* Wildcat Point-LP PCH Thermal Register bit definitions */
-#define WPT_TEMP_TSR 0x00ff /* Temp TS Reading */
+#define WPT_TEMP_TSR 0x01ff /* Temp TS Reading */
#define WPT_TSC_CPDE 0x01 /* Catastrophic Power-Down Enable */
#define WPT_TSS_TSDSS 0x10 /* Thermal Sensor Dynamic Shutdown Status */
#define WPT_TSS_GPES 0x08 /* GPE status */
@@ -125,7 +125,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
*nr_trips = 0;
/* Check if BIOS has already enabled thermal sensor */
- if (WPT_TSS_TSDSS & readb(ptd->hw_base + WPT_TSS)) {
+ if (WPT_TSEL_ETS & readb(ptd->hw_base + WPT_TSEL)) {
ptd->bios_enabled = true;
goto read_trips;
}
@@ -141,7 +141,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
}
writeb(tsel|WPT_TSEL_ETS, ptd->hw_base + WPT_TSEL);
- if (!(WPT_TSS_TSDSS & readb(ptd->hw_base + WPT_TSS))) {
+ if (!(WPT_TSEL_ETS & readb(ptd->hw_base + WPT_TSEL))) {
dev_err(&ptd->pdev->dev, "Sensor can't be enabled\n");
return -ENODEV;
}
@@ -174,9 +174,9 @@ read_trips:
static int pch_wpt_get_temp(struct pch_thermal_device *ptd, int *temp)
{
- u8 wpt_temp;
+ u16 wpt_temp;
- wpt_temp = WPT_TEMP_TSR & readl(ptd->hw_base + WPT_TEMP);
+ wpt_temp = WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TEMP);
/* Resolution of 1/2 degree C and an offset of -50C */
*temp = (wpt_temp * 1000 / 2 - 50000);
@@ -387,7 +387,7 @@ static int intel_pch_thermal_resume(struct device *device)
return ptd->ops->resume(ptd);
}
-static struct pci_device_id intel_pch_thermal_id[] = {
+static const struct pci_device_id intel_pch_thermal_id[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCH_THERMAL_DID_HSW_1),
.driver_data = board_hsw, },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCH_THERMAL_DID_HSW_2),