Merge branches 'thermal-core', 'thermal-tool', 'thermal-intel' and 'thermal-soc'...
authorZhang Rui <rui.zhang@intel.com>
Thu, 2 Nov 2017 08:32:25 +0000 (16:32 +0800)
committerZhang Rui <rui.zhang@intel.com>
Thu, 2 Nov 2017 08:32:25 +0000 (16:32 +0800)
drivers/thermal/int340x_thermal/processor_thermal_device.c
drivers/thermal/intel_bxt_pmic_thermal.c
drivers/thermal/intel_pch_thermal.c
drivers/thermal/intel_powerclamp.c
include/linux/thermal.h
tools/thermal/tmon/Makefile

index f02341f7134d4e69314ebb4ae3419b75d8b4f839..80bbf9ce2fb66f7d2a3c49566bcc94f7bd29ff8c 100644 (file)
 /* Skylake thermal reporting device */
 #define PCI_DEVICE_ID_PROC_SKL_THERMAL 0x1903
 
+/* CannonLake thermal reporting device */
+#define PCI_DEVICE_ID_PROC_CNL_THERMAL 0x5a03
+#define PCI_DEVICE_ID_PROC_CFL_THERMAL 0x3E83
+
 /* Braswell thermal reporting device */
 #define PCI_DEVICE_ID_PROC_BSW_THERMAL 0x22DC
 
@@ -461,6 +465,8 @@ static const struct pci_device_id proc_thermal_pci_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_BXT1_THERMAL)},
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_BXTX_THERMAL)},
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_BXTP_THERMAL)},
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_CNL_THERMAL)},
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_CFL_THERMAL)},
        { 0, },
 };
 
index ef6b32242ccbce8c7258a7531d3d82d637a48f8a..94cfd0064c43bbbc1896ed2000e2d408655cdd29 100644 (file)
@@ -166,7 +166,7 @@ static irqreturn_t pmic_thermal_irq_handler(int irq, void *data)
        struct pmic_thermal_data *td;
        struct intel_soc_pmic *pmic;
        struct regmap *regmap;
-       u8 reg_val, mask, irq_stat, trip;
+       u8 reg_val, mask, irq_stat;
        u16 reg, evt_stat_reg;
        int i, j, ret;
 
@@ -201,7 +201,6 @@ static irqreturn_t pmic_thermal_irq_handler(int irq, void *data)
                        if (regmap_read(regmap, evt_stat_reg, &ret))
                                return IRQ_HANDLED;
 
-                       trip = td->maps[i].trip_config[j].trip_num;
                        tzd = thermal_zone_get_zone_by_name(td->maps[i].handle);
                        if (!IS_ERR(tzd))
                                thermal_zone_device_update(tzd,
index c60b1cfcc64e84651dba55f7595ab1cdc960d720..8a7f69b4b02205de15cff28eb667288d98107da3 100644 (file)
@@ -30,6 +30,8 @@
 #define PCH_THERMAL_DID_WPT    0x9CA4 /* Wildcat Point */
 #define PCH_THERMAL_DID_SKL    0x9D31 /* Skylake PCH */
 #define PCH_THERMAL_DID_SKL_H  0xA131 /* Skylake PCH 100 series */
+#define PCH_THERMAL_DID_CNL    0x9Df9 /* CNL PCH */
+#define PCH_THERMAL_DID_CNL_H  0xA379 /* CNL-H PCH */
 
 /* Wildcat Point-LP  PCH Thermal registers */
 #define WPT_TEMP       0x0000  /* Temperature */
@@ -278,6 +280,7 @@ enum board_ids {
        board_hsw,
        board_wpt,
        board_skl,
+       board_cnl,
 };
 
 static const struct board_info {
@@ -296,6 +299,10 @@ static const struct board_info {
                .name = "pch_skylake",
                .ops = &pch_dev_ops_wpt,
        },
+       [board_cnl] = {
+               .name = "pch_cannonlake",
+               .ops = &pch_dev_ops_wpt,
+       },
 };
 
 static int intel_pch_thermal_probe(struct pci_dev *pdev,
@@ -398,6 +405,10 @@ static const struct pci_device_id intel_pch_thermal_id[] = {
                .driver_data = board_skl, },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCH_THERMAL_DID_SKL_H),
                .driver_data = board_skl, },
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCH_THERMAL_DID_CNL),
+               .driver_data = board_cnl, },
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCH_THERMAL_DID_CNL_H),
+               .driver_data = board_cnl, },
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, intel_pch_thermal_id);
index d718cd179ddbb29277d05bf3cb308ebd17abc901..4540e892b61d300d9d735c862d8528f258ae81c4 100644 (file)
@@ -675,13 +675,13 @@ static int __init powerclamp_probe(void)
 {
 
        if (!x86_match_cpu(intel_powerclamp_ids)) {
-               pr_err("CPU does not support MWAIT");
+               pr_err("CPU does not support MWAIT\n");
                return -ENODEV;
        }
 
        /* The goal for idle time alignment is to achieve package cstate. */
        if (!has_pkg_state_counter()) {
-               pr_info("No package C-state available");
+               pr_info("No package C-state available\n");
                return -ENODEV;
        }
 
index fd5b959c753c5340f3eaa58da5b752fea2908e84..8c5302374eaab43a070cc431a4aefea2b465d2d2 100644 (file)
@@ -488,7 +488,7 @@ static inline int power_actor_set_power(struct thermal_cooling_device *cdev,
 static inline struct thermal_zone_device *thermal_zone_device_register(
        const char *type, int trips, int mask, void *devdata,
        struct thermal_zone_device_ops *ops,
-       const struct thermal_zone_params *tzp,
+       struct thermal_zone_params *tzp,
        int passive_delay, int polling_delay)
 { return ERR_PTR(-ENODEV); }
 static inline void thermal_zone_device_unregister(
index 3a961e998281b776a9e2e13e8995d99bd738217c..1e11bd38a6b4404c374655bac2b8c2906b20a929 100644 (file)
@@ -1,9 +1,15 @@
+# We need this for the "cc-option" macro.
+include ../../../scripts/Kbuild.include
+
 VERSION = 1.0
 
 BINDIR=usr/bin
 WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
-CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector
-CC=$(CROSS_COMPILE)gcc
+CFLAGS+= -O1 ${WARNFLAGS}
+# Add "-fstack-protector" only if toolchain supports it.
+CFLAGS+= $(call cc-option,-fstack-protector)
+CC?= $(CROSS_COMPILE)gcc
+PKG_CONFIG?= pkg-config
 
 CFLAGS+=-D VERSION=\"$(VERSION)\"
 LDFLAGS+=
@@ -18,12 +24,12 @@ STATIC := --static
 endif
 
 TMON_LIBS=-lm -lpthread
-TMON_LIBS += $(shell pkg-config --libs $(STATIC) panelw ncursesw 2> /dev/null || \
-                    pkg-config --libs $(STATIC) panel ncurses 2> /dev/null || \
+TMON_LIBS += $(shell $(PKG_CONFIG) --libs $(STATIC) panelw ncursesw 2> /dev/null || \
+                    $(PKG_CONFIG) --libs $(STATIC) panel ncurses 2> /dev/null || \
                     echo -lpanel -lncurses)
 
-CFLAGS    += $(shell pkg-config --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
-                    pkg-config --cflags $(STATIC) panel ncurses 2> /dev/null)
+CFLAGS    += $(shell $(PKG_CONFIG) --cflags $(STATIC) panelw ncursesw 2> /dev/null || \
+                    $(PKG_CONFIG) --cflags $(STATIC) panel ncurses 2> /dev/null)
 
 OBJS = tmon.o tui.o sysfs.o pid.o
 OBJS +=