Skip to content

Commit

Permalink
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/evalenti/linux-soc-thermal

Pull thermal SoC updates from Eduardo Valentin:
 "Several new things coming up. Specifics:

   - Rework of tsens and hisi thermal drivers

   - OF-thermal now allows sharing multiple cooling devices on maps

   - Added support for r8a7744 and R8A77970 on rcar thermal driver

   - Added support for r8a774a1 on rcar_gen3 thermal driver

   - New thermal driver stm32

   - Fixes on multiple thermal drivers: of-thermal, imx, qoriq, armada,
     qcom-spmi, rcar, da9062/61"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: (41 commits)
  thermal: da9062/61: Prevent hardware access during system suspend
  thermal: rcar_thermal: Prevent doing work after unbind
  thermal: rcar_thermal: Prevent hardware access during system suspend
  thermal: rcar_gen3_thermal: add R8A77980 support
  dt-bindings: thermal: rcar-gen3-thermal: document R8A77980 bindings
  thermal: add stm32 thermal driver
  dt-bindings: stm32-thermal: add binding documentation
  thermal: rcar_thermal: add R8A77970 support
  dt-bindings: thermal: rcar-thermal: document R8A77970 bindings
  thermal: rcar_thermal: fix duplicate IRQ request
  dt-bindings: thermal: rcar: Add device tree support for r8a7744
  thermal/drivers/hisi: Add the dual clusters sensors for hi3660
  thermal/drivers/hisi: Add more sensors channel
  thermal/drivers/hisi: Remove pointless irq field
  thermal/drivers/hisi: Use platform_get_irq_byname
  thermal/drivers/hisi: Replace macro name with relevant sensor location
  thermal/drivers/hisi: Add multiple sensors support
  thermal/drivers/hisi: Prepare to support multiple sensors
  thermal/drivers/hisi: Factor out the probe functions
  thermal/drivers/hisi: Set the thermal zone private data to the sensor pointer
  ...
  • Loading branch information
torvalds committed Oct 26, 2018
2 parents befa936 + 760eea4 commit 0ef7791
Show file tree
Hide file tree
Showing 27 changed files with 1,365 additions and 303 deletions.
16 changes: 5 additions & 11 deletions Documentation/devicetree/bindings/thermal/qcom-spmi-temp-alarm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ interrupt signal and status register to identify high PMIC die temperature.

Required properties:
- compatible: Should contain "qcom,spmi-temp-alarm".
- reg: Specifies the SPMI address and length of the controller's
registers.
- reg: Specifies the SPMI address.
- interrupts: PMIC temperature alarm interrupt.
- #thermal-sensor-cells: Should be 0. See thermal.txt for a description.

Expand All @@ -20,7 +19,7 @@ Example:

pm8941_temp: thermal-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400 0x100>;
reg = <0x2400>;
interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
#thermal-sensor-cells = <0>;

Expand All @@ -36,19 +35,14 @@ Example:
thermal-sensors = <&pm8941_temp>;

trips {
passive {
temperature = <1050000>;
stage1 {
temperature = <105000>;
hysteresis = <2000>;
type = "passive";
};
alert {
stage2 {
temperature = <125000>;
hysteresis = <2000>;
type = "hot";
};
crit {
temperature = <145000>;
hysteresis = <2000>;
type = "critical";
};
};
Expand Down
6 changes: 3 additions & 3 deletions Documentation/devicetree/bindings/thermal/qoriq-thermal.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
* Thermal Monitoring Unit (TMU) on Freescale QorIQ SoCs

Required properties:
- compatible : Must include "fsl,qoriq-tmu". The version of the device is
determined by the TMU IP Block Revision Register (IPBRR0) at
offset 0x0BF8.
- compatible : Must include "fsl,qoriq-tmu" or "fsl,imx8mq-tmu". The
version of the device is determined by the TMU IP Block Revision
Register (IPBRR0) at offset 0x0BF8.
Table of correspondences between IPBRR0 values and example chips:
Value Device
---------- -----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ inside the LSI.
Required properties:
- compatible : "renesas,<soctype>-thermal",
Examples with soctypes are:
- "renesas,r8a774a1-thermal" (RZ/G2M)
- "renesas,r8a7795-thermal" (R-Car H3)
- "renesas,r8a7796-thermal" (R-Car M3-W)
- "renesas,r8a77965-thermal" (R-Car M3-N)
- "renesas,r8a77980-thermal" (R-Car V3H)
- reg : Address ranges of the thermal registers. Each sensor
needs one address range. Sorting must be done in
increasing order according to datasheet, i.e.
Expand All @@ -19,7 +21,8 @@ Required properties:

Optional properties:

- interrupts : interrupts routed to the TSC (3 for H3, M3-W and M3-N)
- interrupts : interrupts routed to the TSC (3 for H3, M3-W, M3-N,
and V3H)
- power-domain : Must contain a reference to the power domain. This
property is mandatory if the thermal sensor instance
is part of a controllable power domain.
Expand Down
6 changes: 4 additions & 2 deletions Documentation/devicetree/bindings/thermal/rcar-thermal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ Required properties:
- compatible : "renesas,thermal-<soctype>",
"renesas,rcar-gen2-thermal" (with thermal-zone) or
"renesas,rcar-thermal" (without thermal-zone) as
fallback except R-Car D3.
fallback except R-Car V3M/D3.
Examples with soctypes are:
- "renesas,thermal-r8a73a4" (R-Mobile APE6)
- "renesas,thermal-r8a7743" (RZ/G1M)
- "renesas,thermal-r8a7744" (RZ/G1N)
- "renesas,thermal-r8a7779" (R-Car H1)
- "renesas,thermal-r8a7790" (R-Car H2)
- "renesas,thermal-r8a7791" (R-Car M2-W)
- "renesas,thermal-r8a7792" (R-Car V2H)
- "renesas,thermal-r8a7793" (R-Car M2-N)
- "renesas,thermal-r8a77970" (R-Car V3M)
- "renesas,thermal-r8a77995" (R-Car D3)
- reg : Address range of the thermal registers.
The 1st reg will be recognized as common register
Expand All @@ -21,7 +23,7 @@ Required properties:
Option properties:

- interrupts : If present should contain 3 interrupts for
R-Car D3 or 1 interrupt otherwise.
R-Car V3M/D3 or 1 interrupt otherwise.

Example (non interrupt support):

Expand Down
61 changes: 61 additions & 0 deletions Documentation/devicetree/bindings/thermal/stm32-thermal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Binding for Thermal Sensor for STMicroelectronics STM32 series of SoCs.

On STM32 SoCs, the Digital Temperature Sensor (DTS) is in charge of managing an
analog block which delivers a frequency depending on the internal SoC's
temperature. By using a reference frequency, DTS is able to provide a sample
number which can be translated into a temperature by the user.

DTS provides interrupt notification mechanism by threshold. This mechanism
offers two temperature trip points: passive and critical. The first is intended
for passive cooling notification while the second is used for over-temperature
reset.

Required parameters:
-------------------

compatible: Should be "st,stm32-thermal"
reg: This should be the physical base address and length of the
sensor's registers.
clocks: Phandle of the clock used by the thermal sensor.
See: Documentation/devicetree/bindings/clock/clock-bindings.txt
clock-names: Should be "pclk" for register access clock and reference clock.
See: Documentation/devicetree/bindings/resource-names.txt
#thermal-sensor-cells: Should be 0. See ./thermal.txt for a description.
interrupts: Standard way to define interrupt number.

Example:

thermal-zones {
cpu_thermal: cpu-thermal {
polling-delay-passive = <0>;
polling-delay = <0>;

thermal-sensors = <&thermal>;

trips {
cpu_alert1: cpu-alert1 {
temperature = <85000>;
hysteresis = <0>;
type = "passive";
};

cpu-crit: cpu-crit {
temperature = <120000>;
hysteresis = <0>;
type = "critical";
};
};

cooling-maps {
};
};
};

thermal: thermal@50028000 {
compatible = "st,stm32-thermal";
reg = <0x50028000 0x100>;
clocks = <&rcc TMPSENS>;
clock-names = "pclk";
#thermal-sensor-cells = <0>;
interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
};
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/thermal/thermal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Optional property:
Elem size: one cell the sensors listed in the thermal-sensors property.
Elem type: signed Coefficients defaults to 1, in case this property
is not specified. A simple linear polynomial is used:
Z = c0 * x0 + c1 + x1 + ... + c(n-1) * x(n-1) + cn.
Z = c0 * x0 + c1 * x1 + ... + c(n-1) * x(n-1) + cn.

The coefficients are ordered and they match with sensors
by means of sensor ID. Additional coefficients are
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ source "drivers/thermal/samsung/Kconfig"
endmenu

menu "STMicroelectronics thermal drivers"
depends on ARCH_STI && OF
depends on (ARCH_STI || ARCH_STM32) && OF
source "drivers/thermal/st/Kconfig"
endmenu

Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
obj-$(CONFIG_INT340X_THERMAL) += int340x_thermal/
obj-$(CONFIG_INTEL_BXT_PMIC_THERMAL) += intel_bxt_pmic_thermal.o
obj-$(CONFIG_INTEL_PCH_THERMAL) += intel_pch_thermal.o
obj-$(CONFIG_ST_THERMAL) += st/
obj-y += st/
obj-$(CONFIG_QCOM_TSENS) += qcom/
obj-y += tegra/
obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o
Expand Down
4 changes: 2 additions & 2 deletions drivers/thermal/armada_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,

/* First memory region points towards the status register */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (IS_ERR(res))
return PTR_ERR(res);
if (!res)
return -EIO;

/*
* Edit the resource start address and length to map over all the
Expand Down
4 changes: 2 additions & 2 deletions drivers/thermal/da9062-thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void da9062_thermal_poll_on(struct work_struct *work)
THERMAL_EVENT_UNSPECIFIED);

delay = msecs_to_jiffies(thermal->zone->passive_delay);
schedule_delayed_work(&thermal->work, delay);
queue_delayed_work(system_freezable_wq, &thermal->work, delay);
return;
}

Expand All @@ -125,7 +125,7 @@ static irqreturn_t da9062_thermal_irq_handler(int irq, void *data)
struct da9062_thermal *thermal = data;

disable_irq_nosync(thermal->irq);
schedule_delayed_work(&thermal->work, 0);
queue_delayed_work(system_freezable_wq, &thermal->work, 0);

return IRQ_HANDLED;
}
Expand Down
Loading

0 comments on commit 0ef7791

Please sign in to comment.