Skip to content

Commit

Permalink
Merge tag 'thermal-6.2-rc1-2' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/rafael/linux-pm

Pull more thermal control updates from Rafael Wysocki:
 "These are updates of assorted thermal drivers, mostly for ARM
  platforms, generally isolated and fairly straightforward, and the
  recent Intel HFI driver fix for systems without HFI support.

  Specifics:

   - Avoid clearing the HFI status bit on systems without HFI support
     which triggers unchecked MSR access errors (Srinivas Pandruvada)

   - Add sm8450 and sm8550 QCom compatible string to DT bindings (Luca
     Weiss, Neil Armstrong)

   - Use devm_platform_get_and_ioremap_resource on the ST platform to
     group two calls into a single one (Minghao Chi)

   - Use GENMASK instead of bitmaps and validate the temperature after
     reading it in the imx8mm_thermal driver (Marcus Folkesson)

   - Convert generic-adc-thermal to DT schema (Rob Herring)

   - Fix debug print message with inverted logic in the k3_j72xx_bandgap
     driver (Keerthy)

   - Fix memory leak on thermal_of_zone_register() failure (Ido
     Schimmel)

   - Add support for IPQ8074 in the tsens thermal driver along with the
     DT bindings (Robert Marko)

   - Fix and rework the debugfs code in the tsens driver (Christian
     Marangi)

   - Add calibration and DT documentation for the imx8mm driver (Marek
     Vasut)

   - Add DT bindings and compatible for the Mediatek SoCs mt7981 and
     mt7983 (Daniel Golle)

   - Don't show an error message if it happens at probe time while it
     will be deferred on the QCom SPMI ADC driver (Johan Hovold)

   - Add HWMon support for the imx8mm board (Alexander Stein)

   - Remove pointless include from the power allocator governor
     (Christophe JAILLET)

   - Add interrupt DT bindings for QCom SoCs SC8280XP, SM6350 and SM8450
     (Krzysztof Kozlowski)

   - Fix inaccurate warning message for the QCom tsens gen2 (Luca Weiss)

   - Demote error log of thermal zone register to debug in the tsens
     QCom driver (Manivannan Sadhasivam)

   - Consolidate the the efuse values and the errata handling in the TI
     Bandgap driver (Bryan Brattlof)

   - Document Renesas RZ/Five as compatible with RZ/G2UL in the DT
     bindings (Lad Prabhakar)

   - Fix the irq handler return value in the LMh driver (Bjorn
     Andersson)

   - Delete empty platform remove callback from imx_sc_thermal (Uwe
     Kleine-König)"

* tag 'thermal-6.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (35 commits)
  thermal/drivers/imx_sc_thermal: Drop empty platform remove function
  thermal/drivers/qcom/lmh: Fix irq handler return value
  dt-bindings: thermal: qcom-tsens: Add compatible for sm8550
  thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()
  dt-bindings: thermal: rzg2l-thermal: Document RZ/Five SoC
  dt-bindings: thermal: k3-j72xx: conditionally require efuse reg range
  dt-bindings: thermal: k3-j72xx: elaborate on binding description
  thermal/drivers/k3_j72xx_bandgap: Map fuse_base only for erratum workaround
  thermal/drivers/k3_j72xx_bandgap: Remove fuse_base from structure
  thermal/drivers/k3_j72xx_bandgap: Use bool for i2128 erratum flag
  thermal/drivers/k3_j72xx_bandgap: Simplify k3_thermal_get_temp() function
  thermal/drivers/qcom: Demote error log of thermal zone register to debug
  thermal/drivers/qcom/temp-alarm: Fix inaccurate warning for gen2
  dt-bindings: thermal: qcom-tsens: narrow interrupts for SC8280XP, SM6350 and SM8450
  thermal/core/power allocator: Remove a useless include
  thermal/drivers/imx8mm: Add hwmon support
  thermal: qcom-spmi-adc-tm5: suppress probe-deferral error message
  dt-bindings: thermal: mediatek: add compatible string for MT7986 and MT7981 SoC
  thermal: ti-soc-thermal: Drop comma after SoC match table sentinel
  thermal/drivers/imx: Add support for loading calibration data from OCOTP
  ...
  • Loading branch information
Linus Torvalds committed Dec 15, 2022
2 parents c0f234f + bd7bcc4 commit 601c1aa
Show file tree
Hide file tree
Showing 24 changed files with 510 additions and 187 deletions.
84 changes: 84 additions & 0 deletions Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: General Purpose Analog To Digital Converter (ADC) based thermal sensor

maintainers:
- Laxman Dewangan <ldewangan@nvidia.com>

description:
On some of platforms, thermal sensor like thermistors are connected to
one of ADC channel and sensor resistance is read via voltage across the
sensor resistor. The voltage read across the sensor is mapped to
temperature using voltage-temperature lookup table.

properties:
compatible:
const: generic-adc-thermal

'#thermal-sensor-cells':
const: 0

io-channels:
maxItems: 1

io-channel-names:
const: sensor-channel

temperature-lookup-table:
description: |
Lookup table to map the relation between ADC value and temperature.
When ADC is read, the value is looked up on the table to get the
equivalent temperature.
If not specified, driver assumes the ADC channel gives milliCelsius
directly.
$ref: /schemas/types.yaml#/definitions/int32-matrix
items:
items:
- description: Temperature in milliCelsius
- description: ADC read value

required:
- compatible
- '#thermal-sensor-cells'
- io-channels
- io-channel-names

additionalProperties: false

examples:
- |
#include <dt-bindings/thermal/thermal.h>
thermal-sensor {
compatible = "generic-adc-thermal";
#thermal-sensor-cells = <0>;
io-channels = <&ads1015 1>;
io-channel-names = "sensor-channel";
temperature-lookup-table = <
(-40000) 2578
(-39000) 2577
(-38000) 2576
(-37000) 2575
(-36000) 2574
(-35000) 2573
(-34000) 2572
(-33000) 2571
(-32000) 2569
(-31000) 2568
(-30000) 2567
/* skip */
118000 254
119000 247
120000 240
121000 233
122000 226
123000 220
124000 214
125000 208>;
};
...
7 changes: 7 additions & 0 deletions Documentation/devicetree/bindings/thermal/imx8mm-thermal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ properties:
clocks:
maxItems: 1

nvmem-cells:
maxItems: 1
description: Phandle to the calibration data provided by ocotp

nvmem-cell-names:
const: calib

"#thermal-sensor-cells":
description: |
Number of cells required to uniquely identify the thermal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Required properties:
- "mediatek,mt2701-thermal" : For MT2701 family of SoCs
- "mediatek,mt2712-thermal" : For MT2712 family of SoCs
- "mediatek,mt7622-thermal" : For MT7622 SoC
- "mediatek,mt7981-thermal", "mediatek,mt7986-thermal" : For MT7981 SoC
- "mediatek,mt7986-thermal" : For MT7986 SoC
- "mediatek,mt8183-thermal" : For MT8183 family of SoCs
- "mediatek,mt8516-thermal", "mediatek,mt2701-thermal : For MT8516 family of SoCs
- reg: Address range of the thermal controller
Expand Down
81 changes: 70 additions & 11 deletions Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,26 @@ properties:
- qcom,sm8150-tsens
- qcom,sm8250-tsens
- qcom,sm8350-tsens
- qcom,sm8450-tsens
- qcom,sm8550-tsens
- const: qcom,tsens-v2

- description: v2 of TSENS with combined interrupt
enum:
- qcom,ipq8074-tsens

reg:
items:
- description: TM registers
- description: SROT registers

interrupts:
minItems: 1
items:
- description: Combined interrupt if upper or lower threshold crossed
- description: Interrupt if critical threshold crossed
maxItems: 2

interrupt-names:
minItems: 1
items:
- const: uplow
- const: critical
maxItems: 2

nvmem-cells:
minItems: 1
Expand Down Expand Up @@ -129,22 +131,64 @@ allOf:
then:
properties:
interrupts:
maxItems: 1
items:
- description: Combined interrupt if upper or lower threshold crossed
interrupt-names:
maxItems: 1
items:
- const: uplow

else:
- if:
properties:
compatible:
contains:
enum:
- qcom,msm8953-tsens
- qcom,msm8996-tsens
- qcom,msm8998-tsens
- qcom,sc7180-tsens
- qcom,sc7280-tsens
- qcom,sc8180x-tsens
- qcom,sc8280xp-tsens
- qcom,sdm630-tsens
- qcom,sdm845-tsens
- qcom,sm6350-tsens
- qcom,sm8150-tsens
- qcom,sm8250-tsens
- qcom,sm8350-tsens
- qcom,sm8450-tsens
- qcom,tsens-v2
then:
properties:
interrupts:
minItems: 2
items:
- description: Combined interrupt if upper or lower threshold crossed
- description: Interrupt if critical threshold crossed
interrupt-names:
minItems: 2
items:
- const: uplow
- const: critical

- if:
properties:
compatible:
contains:
enum:
- qcom,ipq8074-tsens
then:
properties:
interrupts:
items:
- description: Combined interrupt if upper, lower or critical thresholds crossed
interrupt-names:
items:
- const: combined

- if:
properties:
compatible:
contains:
enum:
- qcom,ipq8074-tsens
- qcom,tsens-v0_1
- qcom,tsens-v1
- qcom,tsens-v2
Expand Down Expand Up @@ -227,4 +271,19 @@ examples:
#qcom,sensors = <13>;
#thermal-sensor-cells = <1>;
};
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 4 (for any IPQ8074 based SoC-s):
tsens4: thermal-sensor@4a9000 {
compatible = "qcom,ipq8074-tsens";
reg = <0x4a9000 0x1000>,
<0x4a8000 0x1000>;
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "combined";
#qcom,sensors = <16>;
#thermal-sensor-cells = <1>;
};
...
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ properties:
compatible:
items:
- enum:
- renesas,r9a07g043-tsu # RZ/G2UL
- renesas,r9a07g043-tsu # RZ/G2UL and RZ/Five
- renesas,r9a07g044-tsu # RZ/G2{L,LC}
- renesas,r9a07g054-tsu # RZ/V2L
- const: renesas,rzg2l-tsu
Expand Down
95 changes: 0 additions & 95 deletions Documentation/devicetree/bindings/thermal/thermal-generic-adc.txt

This file was deleted.

35 changes: 34 additions & 1 deletion Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ title: Texas Instruments J72XX VTM (DTS) binding
maintainers:
- Keerthy <j-keerthy@ti.com>

description: |
The TI K3 family of SoCs typically have a Voltage & Thermal
Management (VTM) device to control up to 8 temperature diode
sensors to measure silicon junction temperatures from different
hotspots of the chip as well as provide temperature, interrupt
and alerting information.
The following polynomial equation can then be used to convert
value returned by this device into a temperature in Celsius
Temp(C) = (-9.2627e-12) * x^4 + (6.0373e-08) * x^3 + \
(-1.7058e-04) * x^2 + (3.2512e-01) * x + (-4.9003e+01)
properties:
compatible:
enum:
Expand All @@ -19,14 +32,34 @@ properties:
items:
- description: VTM cfg1 register space
- description: VTM cfg2 register space
- description: VTM efuse register space
- description: |
A software trimming method must be applied to some Jacinto
devices to function properly. This eFuse region provides
the information needed for these SoCs to report
temperatures accurately.
minItems: 2

power-domains:
maxItems: 1

"#thermal-sensor-cells":
const: 1

allOf:
- if:
properties:
compatible:
contains:
const: ti,j721e-vtm
then:
properties:
reg:
minItems: 3
else:
properties:
reg:
maxItems: 2

required:
- compatible
- reg
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/gov_power_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#define pr_fmt(fmt) "Power allocator: " fmt

#include <linux/rculist.h>
#include <linux/slab.h>
#include <linux/thermal.h>

Expand Down
Loading

0 comments on commit 601c1aa

Please sign in to comment.