Commit 3fdd8ea3 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge tag 'thermal-v6.11-rc1' of...

Merge tag 'thermal-v6.11-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal

Merge thermal drivers updates for 6.11-rc1 from Daniel Lezcano:

"- Group all Renesas drivers inside a dedicated sub directory and add
   the missing dependency to OF (Niklas Söderlund)

 - Add suspend/resume support on k3_j72xx_bandgap and take the
   opportunity to remove a unneeded delay in the init time code path
   (Théo Lebrun)

 - Fix thermal zone definition for MT8186 and MT8188 (Julien Panis)

 - Convert hisilicon-thermal.txt to dt-schema (Abdulrasaq Lawani)

 - Add the DT bindings for the X1E80100 temperature sensor (Abel Vesa)

 - Fix the thermal zone node name regular expression in the DT schema
   (Krzysztof Kozlowski)

 - Take into account some production platforms may not have calibration
   data. Deal with it with a default value instead of failing the
   initialization (Chen-Yu Tsai)

 - Fix the sensor cell size on the Exynos platform (Krzysztof Kozlowski)

 - Bring the common definition of '#thermal-sensor-cells' property in
   order to simplify the bindings on all the platforms where this
   change makes sense and do some minor cleanups (Krzysztof Kozlowski)

 - Fix a race between removal and clock disable on the broadcom driver
   (Krzysztof Kozlowski)

 - Drop 'trips' node as required from the thermal zone bindings in
   order to fix the remaining warnings appearing with thermal zone
   whithout trip points defined (Rob Herring)

 - Simplify all the drivers where dev_err_probe() can apply (Krzysztof
   Kozlowski)

 - Cleanup code related to stih416 as this platform is not described
   anywhere (Raphael Gallais-Pou)"

* tag 'thermal-v6.11-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (45 commits)
  thermal/drivers/sti: Cleanup code related to stih416
  thermal/drivers/generic-adc: Simplify with dev_err_probe()
  thermal/drivers/generic-adc: Simplify probe() with local dev variable
  thermal/drivers/qcom-tsens: Simplify with dev_err_probe()
  thermal/drivers/qcom-spmi-adc-tm5: Simplify with dev_err_probe()
  thermal/drivers/imx: Simplify with dev_err_probe()
  thermal/drivers/imx: Simplify probe() with local dev variable
  thermal/drivers/hisi: Simplify with dev_err_probe()
  thermal/drivers/exynos: Simplify with dev_err_probe()
  thermal/drivers/exynos: Simplify probe() with local dev variable
  thermal/drivers/broadcom: Simplify with dev_err_probe()
  thermal/drivers/broadcom: Simplify probe() with local dev variable
  thermal/drivers/broadcom: Fix race between removal and clock disable
  dt-bindings: thermal: Drop 'trips' node as required
  dt-bindings: thermal: qoriq: reference thermal-sensor schema
  dt-bindings: thermal: cleanup examples indentation
  dt-bindings: thermal: simplify few bindings
  dt-bindings: thermal: ti,j72xx: reference thermal-sensor schema
  dt-bindings: thermal: ti,am654: reference thermal-sensor schema
  dt-bindings: thermal: st,stm32: reference thermal-sensor schema
  ...
parents 462be1c3 e61cc85e
...@@ -10,6 +10,8 @@ maintainers: ...@@ -10,6 +10,8 @@ maintainers:
- Vasily Khoruzhick <anarsoul@gmail.com> - Vasily Khoruzhick <anarsoul@gmail.com>
- Yangtao Li <tiny.windzz@gmail.com> - Yangtao Li <tiny.windzz@gmail.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -55,7 +57,6 @@ properties: ...@@ -55,7 +57,6 @@ properties:
maxItems: 1 maxItems: 1
description: phandle to device controlling temperate offset SYS_CFG register description: phandle to device controlling temperate offset SYS_CFG register
# See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for details
"#thermal-sensor-cells": "#thermal-sensor-cells":
enum: enum:
- 0 - 0
...@@ -135,9 +136,8 @@ required: ...@@ -135,9 +136,8 @@ required:
- compatible - compatible
- reg - reg
- interrupts - interrupts
- '#thermal-sensor-cells'
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -11,6 +11,8 @@ maintainers: ...@@ -11,6 +11,8 @@ maintainers:
description: Binding for Amlogic Thermal description: Binding for Amlogic Thermal
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
oneOf: oneOf:
...@@ -44,17 +46,17 @@ required: ...@@ -44,17 +46,17 @@ required:
- clocks - clocks
- amlogic,ao-secure - amlogic,ao-secure
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
cpu_temp: temperature-sensor@ff634800 { temperature-sensor@ff634800 {
compatible = "amlogic,g12a-cpu-thermal", compatible = "amlogic,g12a-cpu-thermal",
"amlogic,g12a-thermal"; "amlogic,g12a-thermal";
reg = <0xff634800 0x50>; reg = <0xff634800 0x50>;
interrupts = <0x0 0x24 0x0>; interrupts = <0x0 0x24 0x0>;
clocks = <&clk 164>; clocks = <&clk 164>;
#thermal-sensor-cells = <0>; #thermal-sensor-cells = <0>;
amlogic,ao-secure = <&sec_AO>; amlogic,ao-secure = <&sec_AO>;
}; };
... ...
...@@ -19,30 +19,30 @@ description: |+ ...@@ -19,30 +19,30 @@ description: |+
Refer to the bindings described in Refer to the bindings described in
Documentation/devicetree/bindings/mfd/syscon.yaml Documentation/devicetree/bindings/mfd/syscon.yaml
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: brcm,bcm2711-thermal const: brcm,bcm2711-thermal
# See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for details
"#thermal-sensor-cells": "#thermal-sensor-cells":
const: 0 const: 0
required: required:
- compatible - compatible
- '#thermal-sensor-cells'
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
avs-monitor@7d5d2000 { avs-monitor@7d5d2000 {
compatible = "brcm,bcm2711-avs-monitor", compatible = "brcm,bcm2711-avs-monitor",
"syscon", "simple-mfd"; "syscon", "simple-mfd";
reg = <0x7d5d2000 0xf00>; reg = <0x7d5d2000 0xf00>;
thermal: thermal { thermal: thermal {
compatible = "brcm,bcm2711-thermal"; compatible = "brcm,bcm2711-thermal";
#thermal-sensor-cells = <0>; #thermal-sensor-cells = <0>;
};
}; };
};
... ...
...@@ -42,15 +42,14 @@ additionalProperties: false ...@@ -42,15 +42,14 @@ additionalProperties: false
required: required:
- compatible - compatible
- reg - reg
- "#thermal-sensor-cells"
examples: examples:
- | - |
thermal@f04d1500 { thermal@f04d1500 {
compatible = "brcm,avs-tmon-bcm7445", "brcm,avs-tmon"; compatible = "brcm,avs-tmon-bcm7445", "brcm,avs-tmon";
reg = <0xf04d1500 0x28>; reg = <0xf04d1500 0x28>;
interrupts = <0x6>; interrupts = <0x6>;
interrupt-names = "tmon"; interrupt-names = "tmon";
interrupt-parent = <&avs_host_l2_intc>; interrupt-parent = <&avs_host_l2_intc>;
#thermal-sensor-cells = <0>; #thermal-sensor-cells = <0>;
}; };
...@@ -34,7 +34,6 @@ required: ...@@ -34,7 +34,6 @@ required:
- compatible - compatible
- reg - reg
- clocks - clocks
- '#thermal-sensor-cells'
examples: examples:
- | - |
......
...@@ -28,7 +28,6 @@ properties: ...@@ -28,7 +28,6 @@ properties:
required: required:
- compatible - compatible
- '#thermal-sensor-cells'
additionalProperties: false additionalProperties: false
......
...@@ -15,6 +15,8 @@ description: ...@@ -15,6 +15,8 @@ description:
sensor resistor. The voltage read across the sensor is mapped to sensor resistor. The voltage read across the sensor is mapped to
temperature using voltage-temperature lookup table. temperature using voltage-temperature lookup table.
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: generic-adc-thermal const: generic-adc-thermal
...@@ -44,11 +46,10 @@ properties: ...@@ -44,11 +46,10 @@ properties:
required: required:
- compatible - compatible
- '#thermal-sensor-cells'
- io-channels - io-channels
- io-channel-names - io-channel-names
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/hisilicon,tsensor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Temperature Sensor on HiSilicon SoCs
maintainers:
- Abdulrasaq Lawani <abdulrasaqolawani@gmail.com>
allOf:
- $ref: thermal-sensor.yaml
properties:
compatible:
enum:
- hisilicon,tsensor
- hisilicon,hi3660-tsensor
reg:
maxItems: 1
clocks:
maxItems: 1
clock-names:
items:
- const: thermal_clk
interrupts:
maxItems: 1
'#thermal-sensor-cells':
const: 1
required:
- compatible
- reg
- interrupts
- '#thermal-sensor-cells'
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/hi6220-clock.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
temperature-sensor@f7030700 {
compatible = "hisilicon,tsensor";
reg = <0xf7030700 0x1000>;
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&sys_ctrl HI6220_TSENSOR_CLK>;
clock-names = "thermal_clk";
#thermal-sensor-cells = <1>;
};
* Temperature Sensor on hisilicon SoCs
** Required properties :
- compatible: "hisilicon,tsensor".
- reg: physical base address of thermal sensor and length of memory mapped
region.
- interrupt: The interrupt number to the cpu. Defines the interrupt used
by /SOCTHERM/tsensor.
- clock-names: Input clock name, should be 'thermal_clk'.
- clocks: phandles for clock specified in "clock-names" property.
- #thermal-sensor-cells: Should be 1. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description.
Example :
for Hi6220:
tsensor: tsensor@0,f7030700 {
compatible = "hisilicon,tsensor";
reg = <0x0 0xf7030700 0x0 0x1000>;
interrupts = <0 7 0x4>;
clocks = <&sys_ctrl HI6220_TSENSOR_CLK>;
clock-names = "thermal_clk";
#thermal-sensor-cells = <1>;
}
for Hi3660:
tsensor: tsensor@fff30000 {
compatible = "hisilicon,hi3660-tsensor";
reg = <0x0 0xfff30000 0x0 0x1000>;
interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
#thermal-sensor-cells = <1>;
};
...@@ -16,6 +16,8 @@ description: | ...@@ -16,6 +16,8 @@ description: |
for i.MX8MM which has ONLY 1 sensor, v2 is for i.MX8MP which has for i.MX8MM which has ONLY 1 sensor, v2 is for i.MX8MP which has
2 sensors. 2 sensors.
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
oneOf: oneOf:
...@@ -51,9 +53,8 @@ required: ...@@ -51,9 +53,8 @@ required:
- compatible - compatible
- reg - reg
- clocks - clocks
- '#thermal-sensor-cells'
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -38,7 +38,6 @@ required: ...@@ -38,7 +38,6 @@ required:
- compatible - compatible
- reg - reg
- interrupts - interrupts
- '#thermal-sensor-cells'
if: if:
properties: properties:
......
...@@ -99,7 +99,6 @@ required: ...@@ -99,7 +99,6 @@ required:
- resets - resets
- nvmem-cells - nvmem-cells
- nvmem-cell-names - nvmem-cell-names
- "#thermal-sensor-cells"
additionalProperties: false additionalProperties: false
......
...@@ -197,7 +197,6 @@ required: ...@@ -197,7 +197,6 @@ required:
- clock-names - clock-names
- resets - resets
- reset-names - reset-names
- "#thermal-sensor-cells"
allOf: allOf:
- $ref: thermal-sensor.yaml - $ref: thermal-sensor.yaml
......
...@@ -20,11 +20,7 @@ description: | ...@@ -20,11 +20,7 @@ description: |
node. See ../firmware/nvidia,tegra186-bpmp.yaml for details of the node. See ../firmware/nvidia,tegra186-bpmp.yaml for details of the
BPMP binding. BPMP binding.
This node represents a thermal sensor. See $ref: thermal-sensor.yaml#
Documentation/devicetree/bindings/thermal/thermal-sensor.yaml
for details of the core thermal binding.
properties: properties:
compatible: compatible:
...@@ -33,10 +29,6 @@ properties: ...@@ -33,10 +29,6 @@ properties:
- nvidia,tegra194-bpmp-thermal - nvidia,tegra194-bpmp-thermal
'#thermal-sensor-cells': '#thermal-sensor-cells':
$ref: /schemas/types.yaml#/definitions/uint32
description: Number of cells needed in the phandle specifier to
identify a given sensor. Must be 1 and the single cell specifies
the sensor index.
const: 1 const: 1
additionalProperties: false unevaluatedProperties: false
...@@ -27,6 +27,8 @@ description: | ...@@ -27,6 +27,8 @@ description: |
TSENSOR has two channels which monitor two different spots of the SoC. TSENSOR has two channels which monitor two different spots of the SoC.
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: nvidia,tegra30-tsensor const: nvidia,tegra30-tsensor
...@@ -46,19 +48,14 @@ properties: ...@@ -46,19 +48,14 @@ properties:
"#thermal-sensor-cells": "#thermal-sensor-cells":
const: 1 const: 1
assigned-clock-parents: true
assigned-clock-rates: true
assigned-clocks: true
required: required:
- compatible - compatible
- reg - reg
- clocks - clocks
- resets - resets
- interrupts - interrupts
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -42,7 +42,6 @@ required: ...@@ -42,7 +42,6 @@ required:
- compatible - compatible
- reg - reg
- interrupts - interrupts
- '#thermal-sensor-cells'
additionalProperties: false additionalProperties: false
......
...@@ -8,6 +8,8 @@ title: Qualcomm's SPMI PMIC ADC HC Thermal Monitoring ...@@ -8,6 +8,8 @@ title: Qualcomm's SPMI PMIC ADC HC Thermal Monitoring
maintainers: maintainers:
- Dmitry Baryshkov <dmitry.baryshkov@linaro.org> - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: qcom,spmi-adc-tm-hc const: qcom,spmi-adc-tm-hc
...@@ -20,9 +22,6 @@ properties: ...@@ -20,9 +22,6 @@ properties:
"#thermal-sensor-cells": "#thermal-sensor-cells":
const: 1 const: 1
description:
Number of cells required to uniquely identify the thermal sensors. Since
we have multiple sensors this is set to 1
"#address-cells": "#address-cells":
const: 1 const: 1
...@@ -106,9 +105,8 @@ required: ...@@ -106,9 +105,8 @@ required:
- interrupts - interrupts
- "#address-cells" - "#address-cells"
- "#size-cells" - "#size-cells"
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -8,6 +8,8 @@ title: Qualcomm's SPMI PMIC ADC Thermal Monitoring ...@@ -8,6 +8,8 @@ title: Qualcomm's SPMI PMIC ADC Thermal Monitoring
maintainers: maintainers:
- Dmitry Baryshkov <dmitry.baryshkov@linaro.org> - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -23,9 +25,6 @@ properties: ...@@ -23,9 +25,6 @@ properties:
"#thermal-sensor-cells": "#thermal-sensor-cells":
const: 1 const: 1
description:
Number of cells required to uniquely identify the thermal sensors. Since
we have multiple sensors this is set to 1
"#address-cells": "#address-cells":
const: 1 const: 1
...@@ -159,9 +158,8 @@ required: ...@@ -159,9 +158,8 @@ required:
- interrupts - interrupts
- "#address-cells" - "#address-cells"
- "#size-cells" - "#size-cells"
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -67,6 +67,7 @@ properties: ...@@ -67,6 +67,7 @@ properties:
- qcom,sm8450-tsens - qcom,sm8450-tsens
- qcom,sm8550-tsens - qcom,sm8550-tsens
- qcom,sm8650-tsens - qcom,sm8650-tsens
- qcom,x1e80100-tsens
- const: qcom,tsens-v2 - const: qcom,tsens-v2
- description: v2 of TSENS with combined interrupt - description: v2 of TSENS with combined interrupt
...@@ -217,18 +218,16 @@ properties: ...@@ -217,18 +218,16 @@ properties:
"#thermal-sensor-cells": "#thermal-sensor-cells":
const: 1 const: 1
description:
Number of cells required to uniquely identify the thermal sensors. Since
we have multiple sensors this is set to 1
required: required:
- compatible - compatible
- interrupts - interrupts
- interrupt-names - interrupt-names
- "#thermal-sensor-cells"
- "#qcom,sensors" - "#qcom,sensors"
allOf: allOf:
- $ref: thermal-sensor.yaml#
- if: - if:
properties: properties:
compatible: compatible:
...@@ -292,27 +291,21 @@ allOf: ...@@ -292,27 +291,21 @@ allOf:
required: required:
- reg - reg
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
// Example msm9860 based SoC (ipq8064): thermal-sensor {
gcc: clock-controller { compatible = "qcom,ipq8064-tsens";
/* ... */
tsens: thermal-sensor { nvmem-cells = <&tsens_calib>, <&tsens_calib_backup>;
compatible = "qcom,ipq8064-tsens"; nvmem-cell-names = "calib", "calib_backup";
interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
nvmem-cells = <&tsens_calib>, <&tsens_calib_backup>; interrupt-names = "uplow";
nvmem-cell-names = "calib", "calib_backup";
interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow";
#qcom,sensors = <11>; #qcom,sensors = <11>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
};
}; };
- | - |
...@@ -349,66 +342,66 @@ examples: ...@@ -349,66 +342,66 @@ examples:
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 1 (legacy: for pre v1 IP): // Example 1 (legacy: for pre v1 IP):
tsens1: thermal-sensor@4a9000 { tsens1: thermal-sensor@4a9000 {
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1"; compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
reg = <0x4a9000 0x1000>, /* TM */ reg = <0x4a9000 0x1000>, /* TM */
<0x4a8000 0x1000>; /* SROT */ <0x4a8000 0x1000>; /* SROT */
nvmem-cells = <&tsens_caldata>, <&tsens_calsel>; nvmem-cells = <&tsens_caldata>, <&tsens_calsel>;
nvmem-cell-names = "calib", "calib_sel"; nvmem-cell-names = "calib", "calib_sel";
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow"; interrupt-names = "uplow";
#qcom,sensors = <5>; #qcom,sensors = <5>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
- | - |
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 2 (for any platform containing v1 of the TSENS IP): // Example 2 (for any platform containing v1 of the TSENS IP):
tsens2: thermal-sensor@4a9000 { tsens2: thermal-sensor@4a9000 {
compatible = "qcom,qcs404-tsens", "qcom,tsens-v1"; compatible = "qcom,qcs404-tsens", "qcom,tsens-v1";
reg = <0x004a9000 0x1000>, /* TM */ reg = <0x004a9000 0x1000>, /* TM */
<0x004a8000 0x1000>; /* SROT */ <0x004a8000 0x1000>; /* SROT */
nvmem-cells = <&tsens_caldata>; nvmem-cells = <&tsens_caldata>;
nvmem-cell-names = "calib"; nvmem-cell-names = "calib";
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow"; interrupt-names = "uplow";
#qcom,sensors = <10>; #qcom,sensors = <10>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
- | - |
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 3 (for any platform containing v2 of the TSENS IP): // Example 3 (for any platform containing v2 of the TSENS IP):
tsens3: thermal-sensor@c263000 { tsens3: thermal-sensor@c263000 {
compatible = "qcom,sdm845-tsens", "qcom,tsens-v2"; compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
reg = <0xc263000 0x1ff>, reg = <0xc263000 0x1ff>,
<0xc222000 0x1ff>; <0xc222000 0x1ff>;
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>; <GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uplow", "critical"; interrupt-names = "uplow", "critical";
#qcom,sensors = <13>; #qcom,sensors = <13>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
- | - |
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
// Example 4 (for any IPQ8074 based SoC-s): // Example 4 (for any IPQ8074 based SoC-s):
tsens4: thermal-sensor@4a9000 { tsens4: thermal-sensor@4a9000 {
compatible = "qcom,ipq8074-tsens"; compatible = "qcom,ipq8074-tsens";
reg = <0x4a9000 0x1000>, reg = <0x4a9000 0x1000>,
<0x4a8000 0x1000>; <0x4a8000 0x1000>;
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "combined"; interrupt-names = "combined";
#qcom,sensors = <16>; #qcom,sensors = <16>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
... ...
...@@ -9,6 +9,8 @@ title: Thermal Monitoring Unit (TMU) on Freescale QorIQ SoCs ...@@ -9,6 +9,8 @@ title: Thermal Monitoring Unit (TMU) on Freescale QorIQ SoCs
maintainers: maintainers:
- Anson Huang <Anson.Huang@nxp.com> - Anson Huang <Anson.Huang@nxp.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
description: | description: |
...@@ -68,9 +70,8 @@ required: ...@@ -68,9 +70,8 @@ required:
- interrupts - interrupts
- fsl,tmu-range - fsl,tmu-range
- fsl,tmu-calibration - fsl,tmu-calibration
- '#thermal-sensor-cells'
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -15,6 +15,8 @@ description: ...@@ -15,6 +15,8 @@ description:
maintainers: maintainers:
- Niklas Söderlund <niklas.soderlund@ragnatech.se> - Niklas Söderlund <niklas.soderlund@ragnatech.se>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -57,7 +59,6 @@ required: ...@@ -57,7 +59,6 @@ required:
- clocks - clocks
- power-domains - power-domains
- resets - resets
- "#thermal-sensor-cells"
if: if:
properties: properties:
...@@ -96,7 +97,7 @@ else: ...@@ -96,7 +97,7 @@ else:
required: required:
- interrupts - interrupts
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
...@@ -105,33 +106,33 @@ examples: ...@@ -105,33 +106,33 @@ examples:
#include <dt-bindings/power/r8a7795-sysc.h> #include <dt-bindings/power/r8a7795-sysc.h>
tsc: thermal@e6198000 { tsc: thermal@e6198000 {
compatible = "renesas,r8a7795-thermal"; compatible = "renesas,r8a7795-thermal";
reg = <0xe6198000 0x100>, reg = <0xe6198000 0x100>,
<0xe61a0000 0x100>, <0xe61a0000 0x100>,
<0xe61a8000 0x100>; <0xe61a8000 0x100>;
interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 522>; clocks = <&cpg CPG_MOD 522>;
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
resets = <&cpg 522>; resets = <&cpg 522>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
thermal-zones { thermal-zones {
sensor_thermal: sensor-thermal { sensor_thermal: sensor-thermal {
polling-delay-passive = <250>; polling-delay-passive = <250>;
polling-delay = <1000>; polling-delay = <1000>;
thermal-sensors = <&tsc 0>; thermal-sensors = <&tsc 0>;
trips { trips {
sensor1_crit: sensor1-crit { sensor1_crit: sensor1-crit {
temperature = <90000>; temperature = <90000>;
hysteresis = <2000>; hysteresis = <2000>;
type = "critical"; type = "critical";
}; };
};
}; };
};
}; };
- | - |
#include <dt-bindings/clock/r8a779a0-cpg-mssr.h> #include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
...@@ -139,14 +140,14 @@ examples: ...@@ -139,14 +140,14 @@ examples:
#include <dt-bindings/power/r8a779a0-sysc.h> #include <dt-bindings/power/r8a779a0-sysc.h>
tsc_r8a779a0: thermal@e6190000 { tsc_r8a779a0: thermal@e6190000 {
compatible = "renesas,r8a779a0-thermal"; compatible = "renesas,r8a779a0-thermal";
reg = <0xe6190000 0x200>, reg = <0xe6190000 0x200>,
<0xe6198000 0x200>, <0xe6198000 0x200>,
<0xe61a0000 0x200>, <0xe61a0000 0x200>,
<0xe61a8000 0x200>, <0xe61a8000 0x200>,
<0xe61b0000 0x200>; <0xe61b0000 0x200>;
clocks = <&cpg CPG_MOD 919>; clocks = <&cpg CPG_MOD 919>;
power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>; power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
resets = <&cpg 919>; resets = <&cpg 919>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
...@@ -98,8 +98,8 @@ examples: ...@@ -98,8 +98,8 @@ examples:
# Example (non interrupt support) # Example (non interrupt support)
- | - |
thermal@ffc48000 { thermal@ffc48000 {
compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal"; compatible = "renesas,thermal-r8a7779", "renesas,rcar-thermal";
reg = <0xffc48000 0x38>; reg = <0xffc48000 0x38>;
}; };
# Example (interrupt support) # Example (interrupt support)
...@@ -109,12 +109,12 @@ examples: ...@@ -109,12 +109,12 @@ examples:
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/irq.h>
thermal@e61f0000 { thermal@e61f0000 {
compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal"; compatible = "renesas,thermal-r8a73a4", "renesas,rcar-thermal";
reg = <0xe61f0000 0x14>, <0xe61f0100 0x38>, reg = <0xe61f0000 0x14>, <0xe61f0100 0x38>,
<0xe61f0200 0x38>, <0xe61f0300 0x38>; <0xe61f0200 0x38>, <0xe61f0300 0x38>;
interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp5_clks R8A73A4_CLK_THERMAL>; clocks = <&mstp5_clks R8A73A4_CLK_THERMAL>;
power-domains = <&pd_c5>; power-domains = <&pd_c5>;
}; };
# Example (with thermal-zone) # Example (with thermal-zone)
...@@ -124,32 +124,32 @@ examples: ...@@ -124,32 +124,32 @@ examples:
#include <dt-bindings/power/r8a7790-sysc.h> #include <dt-bindings/power/r8a7790-sysc.h>
thermal: thermal@e61f0000 { thermal: thermal@e61f0000 {
compatible = "renesas,thermal-r8a7790", compatible = "renesas,thermal-r8a7790",
"renesas,rcar-gen2-thermal", "renesas,rcar-gen2-thermal",
"renesas,rcar-thermal"; "renesas,rcar-thermal";
reg = <0xe61f0000 0x10>, <0xe61f0100 0x38>; reg = <0xe61f0000 0x10>, <0xe61f0100 0x38>;
interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 522>; clocks = <&cpg CPG_MOD 522>;
power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
resets = <&cpg 522>; resets = <&cpg 522>;
#thermal-sensor-cells = <0>; #thermal-sensor-cells = <0>;
}; };
thermal-zones { thermal-zones {
cpu_thermal: cpu-thermal { cpu_thermal: cpu-thermal {
polling-delay-passive = <1000>; polling-delay-passive = <1000>;
polling-delay = <5000>; polling-delay = <5000>;
thermal-sensors = <&thermal>; thermal-sensors = <&thermal>;
trips { trips {
cpu-crit { cpu-crit {
temperature = <115000>; temperature = <115000>;
hysteresis = <0>; hysteresis = <0>;
type = "critical"; type = "critical";
}; };
};
cooling-maps {
};
}; };
cooling-maps {
};
};
}; };
...@@ -9,6 +9,8 @@ title: Temperature Sensor ADC (TSADC) on Rockchip SoCs ...@@ -9,6 +9,8 @@ title: Temperature Sensor ADC (TSADC) on Rockchip SoCs
maintainers: maintainers:
- Heiko Stuebner <heiko@sntech.de> - Heiko Stuebner <heiko@sntech.de>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -76,9 +78,8 @@ required: ...@@ -76,9 +78,8 @@ required:
- clocks - clocks
- clock-names - clock-names
- resets - resets
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -13,6 +13,8 @@ description: ...@@ -13,6 +13,8 @@ description:
maintainers: maintainers:
- Biju Das <biju.das.jz@bp.renesas.com> - Biju Das <biju.das.jz@bp.renesas.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
items: items:
...@@ -43,36 +45,35 @@ required: ...@@ -43,36 +45,35 @@ required:
- clocks - clocks
- power-domains - power-domains
- resets - resets
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
#include <dt-bindings/clock/r9a07g044-cpg.h> #include <dt-bindings/clock/r9a07g044-cpg.h>
tsu: thermal@10059400 { tsu: thermal@10059400 {
compatible = "renesas,r9a07g044-tsu", compatible = "renesas,r9a07g044-tsu",
"renesas,rzg2l-tsu"; "renesas,rzg2l-tsu";
reg = <0x10059400 0x400>; reg = <0x10059400 0x400>;
clocks = <&cpg CPG_MOD R9A07G044_TSU_PCLK>; clocks = <&cpg CPG_MOD R9A07G044_TSU_PCLK>;
resets = <&cpg R9A07G044_TSU_PRESETN>; resets = <&cpg R9A07G044_TSU_PRESETN>;
power-domains = <&cpg>; power-domains = <&cpg>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
}; };
thermal-zones { thermal-zones {
cpu-thermal { cpu-thermal {
polling-delay-passive = <250>; polling-delay-passive = <250>;
polling-delay = <1000>; polling-delay = <1000>;
thermal-sensors = <&tsu 0>; thermal-sensors = <&tsu 0>;
trips { trips {
sensor_crit: sensor-crit { sensor_crit: sensor-crit {
temperature = <125000>; temperature = <125000>;
hysteresis = <1000>; hysteresis = <1000>;
type = "critical"; type = "critical";
}; };
};
}; };
};
}; };
...@@ -61,7 +61,8 @@ properties: ...@@ -61,7 +61,8 @@ properties:
TRIMINFO at 0x10068000 contains data for TMU channel 2 TRIMINFO at 0x10068000 contains data for TMU channel 2
minItems: 1 minItems: 1
'#thermal-sensor-cells': true '#thermal-sensor-cells':
const: 0
vtmu-supply: vtmu-supply:
description: The regulator node supplying voltage to TMU. description: The regulator node supplying voltage to TMU.
......
...@@ -14,6 +14,8 @@ description: | ...@@ -14,6 +14,8 @@ description: |
maintainers: maintainers:
- Kunihiko Hayashi <hayashi.kunihiko@socionext.com> - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -38,9 +40,8 @@ properties: ...@@ -38,9 +40,8 @@ properties:
required: required:
- compatible - compatible
- interrupts - interrupts
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -11,6 +11,8 @@ maintainers: ...@@ -11,6 +11,8 @@ maintainers:
- Baolin Wang <baolin.wang7@gmail.com> - Baolin Wang <baolin.wang7@gmail.com>
- Chunyan Zhang <zhang.lyra@gmail.com> - Chunyan Zhang <zhang.lyra@gmail.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: sprd,ums512-thermal const: sprd,ums512-thermal
...@@ -77,35 +79,34 @@ required: ...@@ -77,35 +79,34 @@ required:
- clock-names - clock-names
- nvmem-cells - nvmem-cells
- nvmem-cell-names - nvmem-cell-names
- "#thermal-sensor-cells"
- "#address-cells" - "#address-cells"
- "#size-cells" - "#size-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
ap_thm0: thermal@32200000 { thermal@32200000 {
compatible = "sprd,ums512-thermal"; compatible = "sprd,ums512-thermal";
reg = <0x32200000 0x10000>; reg = <0x32200000 0x10000>;
clock-names = "enable"; clock-names = "enable";
clocks = <&aonapb_gate 32>; clocks = <&aonapb_gate 32>;
#thermal-sensor-cells = <1>; #thermal-sensor-cells = <1>;
nvmem-cells = <&thm0_sign>, <&thm0_ratio>; nvmem-cells = <&thm0_sign>, <&thm0_ratio>;
nvmem-cell-names = "thm_sign_cal", "thm_ratio_cal"; nvmem-cell-names = "thm_sign_cal", "thm_ratio_cal";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
prometheus-sensor@0 { prometheus-sensor@0 {
reg = <0>; reg = <0>;
nvmem-cells = <&thm0_sen0>; nvmem-cells = <&thm0_sen0>;
nvmem-cell-names = "sen_delta_cal"; nvmem-cell-names = "sen_delta_cal";
}; };
ank-sensor@1 { ank-sensor@1 {
reg = <1>; reg = <1>;
nvmem-cells = <&thm0_sen1>; nvmem-cells = <&thm0_sen1>;
nvmem-cell-names = "sen_delta_cal"; nvmem-cell-names = "sen_delta_cal";
};
}; };
};
... ...
...@@ -9,6 +9,8 @@ title: STMicroelectronics STM32 digital thermal sensor (DTS) ...@@ -9,6 +9,8 @@ title: STMicroelectronics STM32 digital thermal sensor (DTS)
maintainers: maintainers:
- Pascal Paillet <p.paillet@foss.st.com> - Pascal Paillet <p.paillet@foss.st.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: st,stm32-thermal const: st,stm32-thermal
...@@ -30,14 +32,13 @@ properties: ...@@ -30,14 +32,13 @@ properties:
const: 0 const: 0
required: required:
- "#thermal-sensor-cells"
- compatible - compatible
- reg - reg
- interrupts - interrupts
- clocks - clocks
- clock-names - clock-names
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -49,7 +49,10 @@ properties: ...@@ -49,7 +49,10 @@ properties:
to take when the temperature crosses those thresholds. to take when the temperature crosses those thresholds.
patternProperties: patternProperties:
"^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$": # Node name is limited in size due to Linux kernel requirements - 19
# characters in total (see THERMAL_NAME_LENGTH, including terminating NUL
# byte):
"^[a-zA-Z][a-zA-Z0-9\\-]{1,10}-thermal$":
type: object type: object
description: description:
Each thermal zone node contains information about how frequently it Each thermal zone node contains information about how frequently it
...@@ -229,7 +232,6 @@ patternProperties: ...@@ -229,7 +232,6 @@ patternProperties:
required: required:
- thermal-sensors - thermal-sensors
- trips
additionalProperties: false additionalProperties: false
......
...@@ -9,6 +9,8 @@ title: Texas Instruments AM654 VTM (DTS) ...@@ -9,6 +9,8 @@ title: Texas Instruments AM654 VTM (DTS)
maintainers: maintainers:
- Keerthy <j-keerthy@ti.com> - Keerthy <j-keerthy@ti.com>
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
const: ti,am654-vtm const: ti,am654-vtm
...@@ -26,9 +28,8 @@ required: ...@@ -26,9 +28,8 @@ required:
- compatible - compatible
- reg - reg
- power-domains - power-domains
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
...@@ -46,11 +47,11 @@ examples: ...@@ -46,11 +47,11 @@ examples:
thermal-sensors = <&vtm0 0>; thermal-sensors = <&vtm0 0>;
trips { trips {
mpu0_crit: mpu0_crit { mpu0_crit: mpu0_crit {
temperature = <125000>; /* milliCelsius */ temperature = <125000>; /* milliCelsius */
hysteresis = <2000>; /* milliCelsius */ hysteresis = <2000>; /* milliCelsius */
type = "critical"; type = "critical";
}; };
}; };
}; };
... ...
...@@ -22,6 +22,8 @@ description: | ...@@ -22,6 +22,8 @@ description: |
Temp(C) = (-9.2627e-12) * x^4 + (6.0373e-08) * x^3 + \ Temp(C) = (-9.2627e-12) * x^4 + (6.0373e-08) * x^3 + \
(-1.7058e-04) * x^2 + (3.2512e-01) * x + (-4.9003e+01) (-1.7058e-04) * x^2 + (3.2512e-01) * x + (-4.9003e+01)
$ref: thermal-sensor.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -64,9 +66,8 @@ required: ...@@ -64,9 +66,8 @@ required:
- compatible - compatible
- reg - reg
- power-domains - power-domains
- "#thermal-sensor-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -19076,8 +19076,8 @@ L: linux-renesas-soc@vger.kernel.org ...@@ -19076,8 +19076,8 @@ L: linux-renesas-soc@vger.kernel.org
S: Supported S: Supported
F: Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml F: Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.yaml
F: Documentation/devicetree/bindings/thermal/rcar-thermal.yaml F: Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
F: drivers/thermal/rcar_gen3_thermal.c F: drivers/thermal/renesas/rcar_gen3_thermal.c
F: drivers/thermal/rcar_thermal.c F: drivers/thermal/renesas/rcar_thermal.c
RENESAS RIIC DRIVER RENESAS RIIC DRIVER
M: Chris Brandt <chris.brandt@renesas.com> M: Chris Brandt <chris.brandt@renesas.com>
......
...@@ -343,32 +343,6 @@ config ROCKCHIP_THERMAL ...@@ -343,32 +343,6 @@ config ROCKCHIP_THERMAL
trip point. Cpufreq is used as the cooling device and will throttle trip point. Cpufreq is used as the cooling device and will throttle
CPUs when the Temperature crosses the passive trip point. CPUs when the Temperature crosses the passive trip point.
config RCAR_THERMAL
tristate "Renesas R-Car thermal driver"
depends on ARCH_RENESAS || COMPILE_TEST
depends on HAS_IOMEM
help
Enable this to plug the R-Car thermal sensor driver into the Linux
thermal framework.
config RCAR_GEN3_THERMAL
tristate "Renesas R-Car Gen3 and RZ/G2 thermal driver"
depends on ARCH_RENESAS || COMPILE_TEST
depends on HAS_IOMEM
depends on OF
help
Enable this to plug the R-Car Gen3 or RZ/G2 thermal sensor driver into
the Linux thermal framework.
config RZG2L_THERMAL
tristate "Renesas RZ/G2L thermal driver"
depends on ARCH_RENESAS || COMPILE_TEST
depends on HAS_IOMEM
depends on OF
help
Enable this to plug the RZ/G2L thermal sensor driver into the Linux
thermal framework.
config KIRKWOOD_THERMAL config KIRKWOOD_THERMAL
tristate "Temperature sensor on Marvell Kirkwood SoCs" tristate "Temperature sensor on Marvell Kirkwood SoCs"
depends on MACH_KIRKWOOD || COMPILE_TEST depends on MACH_KIRKWOOD || COMPILE_TEST
...@@ -459,6 +433,8 @@ depends on (ARCH_STI || ARCH_STM32) && OF ...@@ -459,6 +433,8 @@ depends on (ARCH_STI || ARCH_STM32) && OF
source "drivers/thermal/st/Kconfig" source "drivers/thermal/st/Kconfig"
endmenu endmenu
source "drivers/thermal/renesas/Kconfig"
source "drivers/thermal/tegra/Kconfig" source "drivers/thermal/tegra/Kconfig"
config GENERIC_ADC_THERMAL config GENERIC_ADC_THERMAL
......
...@@ -38,9 +38,7 @@ obj-$(CONFIG_THERMAL_MMIO) += thermal_mmio.o ...@@ -38,9 +38,7 @@ obj-$(CONFIG_THERMAL_MMIO) += thermal_mmio.o
obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o
obj-$(CONFIG_SUN8I_THERMAL) += sun8i_thermal.o obj-$(CONFIG_SUN8I_THERMAL) += sun8i_thermal.o
obj-$(CONFIG_ROCKCHIP_THERMAL) += rockchip_thermal.o obj-$(CONFIG_ROCKCHIP_THERMAL) += rockchip_thermal.o
obj-$(CONFIG_RCAR_THERMAL) += rcar_thermal.o obj-y += renesas/
obj-$(CONFIG_RCAR_GEN3_THERMAL) += rcar_gen3_thermal.o
obj-$(CONFIG_RZG2L_THERMAL) += rzg2l_thermal.o
obj-$(CONFIG_KIRKWOOD_THERMAL) += kirkwood_thermal.o obj-$(CONFIG_KIRKWOOD_THERMAL) += kirkwood_thermal.o
obj-y += samsung/ obj-y += samsung/
obj-$(CONFIG_DOVE_THERMAL) += dove_thermal.o obj-$(CONFIG_DOVE_THERMAL) += dove_thermal.o
......
...@@ -163,6 +163,7 @@ MODULE_DEVICE_TABLE(of, bcm2835_thermal_of_match_table); ...@@ -163,6 +163,7 @@ MODULE_DEVICE_TABLE(of, bcm2835_thermal_of_match_table);
static int bcm2835_thermal_probe(struct platform_device *pdev) static int bcm2835_thermal_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
const struct of_device_id *match; const struct of_device_id *match;
struct thermal_zone_device *tz; struct thermal_zone_device *tz;
struct bcm2835_thermal_data *data; struct bcm2835_thermal_data *data;
...@@ -170,12 +171,11 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) ...@@ -170,12 +171,11 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
u32 val; u32 val;
unsigned long rate; unsigned long rate;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
match = of_match_device(bcm2835_thermal_of_match_table, match = of_match_device(bcm2835_thermal_of_match_table, dev);
&pdev->dev);
if (!match) if (!match)
return -EINVAL; return -EINVAL;
...@@ -185,34 +185,20 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) ...@@ -185,34 +185,20 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
return err; return err;
} }
data->clk = devm_clk_get(&pdev->dev, NULL); data->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(data->clk)) { if (IS_ERR(data->clk))
err = PTR_ERR(data->clk); return dev_err_probe(dev, PTR_ERR(data->clk), "Could not get clk\n");
if (err != -EPROBE_DEFER)
dev_err(&pdev->dev, "Could not get clk: %d\n", err);
return err;
}
err = clk_prepare_enable(data->clk);
if (err)
return err;
rate = clk_get_rate(data->clk); rate = clk_get_rate(data->clk);
if ((rate < 1920000) || (rate > 5000000)) if ((rate < 1920000) || (rate > 5000000))
dev_warn(&pdev->dev, dev_warn(dev,
"Clock %pCn running at %lu Hz is outside of the recommended range: 1.92 to 5MHz\n", "Clock %pCn running at %lu Hz is outside of the recommended range: 1.92 to 5MHz\n",
data->clk, rate); data->clk, rate);
/* register of thermal sensor and get info from DT */ /* register of thermal sensor and get info from DT */
tz = devm_thermal_of_zone_register(&pdev->dev, 0, data, tz = devm_thermal_of_zone_register(dev, 0, data, &bcm2835_thermal_ops);
&bcm2835_thermal_ops); if (IS_ERR(tz))
if (IS_ERR(tz)) { return dev_err_probe(dev, PTR_ERR(tz), "Failed to register the thermal device\n");
err = PTR_ERR(tz);
dev_err(&pdev->dev,
"Failed to register the thermal device: %d\n",
err);
goto err_clk;
}
/* /*
* right now the FW does set up the HW-block, so we are not * right now the FW does set up the HW-block, so we are not
...@@ -233,10 +219,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) ...@@ -233,10 +219,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
*/ */
err = thermal_zone_get_trip(tz, 0, &trip); err = thermal_zone_get_trip(tz, 0, &trip);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, dev_err(dev, "Not able to read trip_temp: %d\n", err);
"Not able to read trip_temp: %d\n", return err;
err);
goto err_tz;
} }
/* set bandgap reference voltage and enable voltage regulator */ /* set bandgap reference voltage and enable voltage regulator */
...@@ -269,17 +253,11 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) ...@@ -269,17 +253,11 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
*/ */
err = thermal_add_hwmon_sysfs(tz); err = thermal_add_hwmon_sysfs(tz);
if (err) if (err)
goto err_tz; return err;
bcm2835_thermal_debugfs(pdev); bcm2835_thermal_debugfs(pdev);
return 0; return 0;
err_tz:
devm_thermal_of_zone_unregister(&pdev->dev, tz);
err_clk:
clk_disable_unprepare(data->clk);
return err;
} }
static void bcm2835_thermal_remove(struct platform_device *pdev) static void bcm2835_thermal_remove(struct platform_device *pdev)
...@@ -287,7 +265,6 @@ static void bcm2835_thermal_remove(struct platform_device *pdev) ...@@ -287,7 +265,6 @@ static void bcm2835_thermal_remove(struct platform_device *pdev)
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev); struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
debugfs_remove_recursive(data->debugfsdir); debugfs_remove_recursive(data->debugfsdir);
clk_disable_unprepare(data->clk);
} }
static struct platform_driver bcm2835_thermal_driver = { static struct platform_driver bcm2835_thermal_driver = {
......
...@@ -388,15 +388,10 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data) ...@@ -388,15 +388,10 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data)
{ {
struct platform_device *pdev = data->pdev; struct platform_device *pdev = data->pdev;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int ret;
data->clk = devm_clk_get(dev, "thermal_clk"); data->clk = devm_clk_get(dev, "thermal_clk");
if (IS_ERR(data->clk)) { if (IS_ERR(data->clk))
ret = PTR_ERR(data->clk); return dev_err_probe(dev, PTR_ERR(data->clk), "failed to get thermal clk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get thermal clk: %d\n", ret);
return ret;
}
data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL); data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL);
if (!data->sensor) if (!data->sensor)
......
...@@ -601,28 +601,29 @@ static inline void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data ...@@ -601,28 +601,29 @@ static inline void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data
static int imx_thermal_probe(struct platform_device *pdev) static int imx_thermal_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct imx_thermal_data *data; struct imx_thermal_data *data;
struct regmap *map; struct regmap *map;
int measure_freq; int measure_freq;
int ret; int ret;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
data->dev = &pdev->dev; data->dev = dev;
map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "fsl,tempmon"); map = syscon_regmap_lookup_by_phandle(dev->of_node, "fsl,tempmon");
if (IS_ERR(map)) { if (IS_ERR(map)) {
ret = PTR_ERR(map); ret = PTR_ERR(map);
dev_err(&pdev->dev, "failed to get tempmon regmap: %d\n", ret); dev_err(dev, "failed to get tempmon regmap: %d\n", ret);
return ret; return ret;
} }
data->tempmon = map; data->tempmon = map;
data->socdata = of_device_get_match_data(&pdev->dev); data->socdata = of_device_get_match_data(dev);
if (!data->socdata) { if (!data->socdata) {
dev_err(&pdev->dev, "no device match found\n"); dev_err(dev, "no device match found\n");
return -ENODEV; return -ENODEV;
} }
...@@ -645,15 +646,15 @@ static int imx_thermal_probe(struct platform_device *pdev) ...@@ -645,15 +646,15 @@ static int imx_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
if (of_property_present(pdev->dev.of_node, "nvmem-cells")) { if (of_property_present(dev->of_node, "nvmem-cells")) {
ret = imx_init_from_nvmem_cells(pdev); ret = imx_init_from_nvmem_cells(pdev);
if (ret) if (ret)
return dev_err_probe(&pdev->dev, ret, return dev_err_probe(dev, ret,
"failed to init from nvmem\n"); "failed to init from nvmem\n");
} else { } else {
ret = imx_init_from_tempmon_data(pdev); ret = imx_init_from_tempmon_data(pdev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to init from fsl,tempmon-data\n"); dev_err(dev, "failed to init from fsl,tempmon-data\n");
return ret; return ret;
} }
} }
...@@ -673,15 +674,12 @@ static int imx_thermal_probe(struct platform_device *pdev) ...@@ -673,15 +674,12 @@ static int imx_thermal_probe(struct platform_device *pdev)
ret = imx_thermal_register_legacy_cooling(data); ret = imx_thermal_register_legacy_cooling(data);
if (ret) if (ret)
return dev_err_probe(&pdev->dev, ret, return dev_err_probe(dev, ret,
"failed to register cpufreq cooling device\n"); "failed to register cpufreq cooling device\n");
data->thermal_clk = devm_clk_get(&pdev->dev, NULL); data->thermal_clk = devm_clk_get(dev, NULL);
if (IS_ERR(data->thermal_clk)) { if (IS_ERR(data->thermal_clk)) {
ret = PTR_ERR(data->thermal_clk); ret = dev_err_probe(dev, PTR_ERR(data->thermal_clk), "failed to get thermal clk\n");
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to get thermal clk: %d\n", ret);
goto legacy_cleanup; goto legacy_cleanup;
} }
...@@ -694,7 +692,7 @@ static int imx_thermal_probe(struct platform_device *pdev) ...@@ -694,7 +692,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
*/ */
ret = clk_prepare_enable(data->thermal_clk); ret = clk_prepare_enable(data->thermal_clk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to enable thermal clk: %d\n", ret); dev_err(dev, "failed to enable thermal clk: %d\n", ret);
goto legacy_cleanup; goto legacy_cleanup;
} }
...@@ -707,12 +705,12 @@ static int imx_thermal_probe(struct platform_device *pdev) ...@@ -707,12 +705,12 @@ static int imx_thermal_probe(struct platform_device *pdev)
IMX_POLLING_DELAY); IMX_POLLING_DELAY);
if (IS_ERR(data->tz)) { if (IS_ERR(data->tz)) {
ret = PTR_ERR(data->tz); ret = PTR_ERR(data->tz);
dev_err(&pdev->dev, dev_err(dev, "failed to register thermal zone device %d\n",
"failed to register thermal zone device %d\n", ret); ret);
goto clk_disable; goto clk_disable;
} }
dev_info(&pdev->dev, "%s CPU temperature grade - max:%dC" dev_info(dev, "%s CPU temperature grade - max:%dC"
" critical:%dC passive:%dC\n", data->temp_grade, " critical:%dC passive:%dC\n", data->temp_grade,
data->temp_max / 1000, trips[IMX_TRIP_CRITICAL].temperature / 1000, data->temp_max / 1000, trips[IMX_TRIP_CRITICAL].temperature / 1000,
trips[IMX_TRIP_PASSIVE].temperature / 1000); trips[IMX_TRIP_PASSIVE].temperature / 1000);
...@@ -736,7 +734,7 @@ static int imx_thermal_probe(struct platform_device *pdev) ...@@ -736,7 +734,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
usleep_range(20, 50); usleep_range(20, 50);
/* the core was configured and enabled just before */ /* the core was configured and enabled just before */
pm_runtime_set_active(&pdev->dev); pm_runtime_set_active(dev);
pm_runtime_enable(data->dev); pm_runtime_enable(data->dev);
ret = pm_runtime_resume_and_get(data->dev); ret = pm_runtime_resume_and_get(data->dev);
...@@ -748,11 +746,11 @@ static int imx_thermal_probe(struct platform_device *pdev) ...@@ -748,11 +746,11 @@ static int imx_thermal_probe(struct platform_device *pdev)
if (ret) if (ret)
goto thermal_zone_unregister; goto thermal_zone_unregister;
ret = devm_request_threaded_irq(&pdev->dev, data->irq, ret = devm_request_threaded_irq(dev, data->irq,
imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread, imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread,
0, "imx_thermal", data); 0, "imx_thermal", data);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "failed to request alarm irq: %d\n", ret); dev_err(dev, "failed to request alarm irq: %d\n", ret);
goto thermal_zone_unregister; goto thermal_zone_unregister;
} }
......
...@@ -178,6 +178,7 @@ struct k3_j72xx_bandgap { ...@@ -178,6 +178,7 @@ struct k3_j72xx_bandgap {
void __iomem *base; void __iomem *base;
void __iomem *cfg2_base; void __iomem *cfg2_base;
struct k3_thermal_data *ts_data[K3_VTM_MAX_NUM_TS]; struct k3_thermal_data *ts_data[K3_VTM_MAX_NUM_TS];
int cnt;
}; };
/* common data structures */ /* common data structures */
...@@ -338,24 +339,52 @@ static void print_look_up_table(struct device *dev, int *ref_table) ...@@ -338,24 +339,52 @@ static void print_look_up_table(struct device *dev, int *ref_table)
dev_dbg(dev, "%d %d %d\n", i, derived_table[i], ref_table[i]); dev_dbg(dev, "%d %d %d\n", i, derived_table[i], ref_table[i]);
} }
static void k3_j72xx_bandgap_init_hw(struct k3_j72xx_bandgap *bgp)
{
struct k3_thermal_data *data;
int id, high_max, low_temp;
u32 val;
for (id = 0; id < bgp->cnt; id++) {
data = bgp->ts_data[id];
val = readl(bgp->cfg2_base + data->ctrl_offset);
val |= (K3_VTM_TMPSENS_CTRL_MAXT_OUTRG_EN |
K3_VTM_TMPSENS_CTRL_SOC |
K3_VTM_TMPSENS_CTRL_CLRZ | BIT(4));
writel(val, bgp->cfg2_base + data->ctrl_offset);
}
/*
* Program TSHUT thresholds
* Step 1: set the thresholds to ~123C and 105C WKUP_VTM_MISC_CTRL2
* Step 2: WKUP_VTM_TMPSENS_CTRL_j set the MAXT_OUTRG_EN bit
* This is already taken care as per of init
* Step 3: WKUP_VTM_MISC_CTRL set the ANYMAXT_OUTRG_ALERT_EN bit
*/
high_max = k3_j72xx_bandgap_temp_to_adc_code(MAX_TEMP);
low_temp = k3_j72xx_bandgap_temp_to_adc_code(COOL_DOWN_TEMP);
writel((low_temp << 16) | high_max, bgp->cfg2_base + K3_VTM_MISC_CTRL2_OFFSET);
writel(K3_VTM_ANYMAXT_OUTRG_ALERT_EN, bgp->cfg2_base + K3_VTM_MISC_CTRL_OFFSET);
}
struct k3_j72xx_bandgap_data { struct k3_j72xx_bandgap_data {
const bool has_errata_i2128; const bool has_errata_i2128;
}; };
static int k3_j72xx_bandgap_probe(struct platform_device *pdev) static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
{ {
int ret = 0, cnt, val, id; const struct k3_j72xx_bandgap_data *driver_data;
int high_max, low_temp; struct thermal_zone_device *ti_thermal;
struct resource *res;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
bool workaround_needed = false;
struct k3_j72xx_bandgap *bgp; struct k3_j72xx_bandgap *bgp;
struct k3_thermal_data *data; struct k3_thermal_data *data;
bool workaround_needed = false;
const struct k3_j72xx_bandgap_data *driver_data;
struct thermal_zone_device *ti_thermal;
int *ref_table;
struct err_values err_vals; struct err_values err_vals;
void __iomem *fuse_base; void __iomem *fuse_base;
int ret = 0, val, id;
struct resource *res;
int *ref_table;
const s64 golden_factors[] = { const s64 golden_factors[] = {
-490019999999999936, -490019999999999936,
...@@ -422,10 +451,10 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) ...@@ -422,10 +451,10 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
/* Get the sensor count in the VTM */ /* Get the sensor count in the VTM */
val = readl(bgp->base + K3_VTM_DEVINFO_PWR0_OFFSET); val = readl(bgp->base + K3_VTM_DEVINFO_PWR0_OFFSET);
cnt = val & K3_VTM_DEVINFO_PWR0_TEMPSENS_CT_MASK; bgp->cnt = val & K3_VTM_DEVINFO_PWR0_TEMPSENS_CT_MASK;
cnt >>= __ffs(K3_VTM_DEVINFO_PWR0_TEMPSENS_CT_MASK); bgp->cnt >>= __ffs(K3_VTM_DEVINFO_PWR0_TEMPSENS_CT_MASK);
data = devm_kcalloc(bgp->dev, cnt, sizeof(*data), GFP_KERNEL); data = devm_kcalloc(bgp->dev, bgp->cnt, sizeof(*data), GFP_KERNEL);
if (!data) { if (!data) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_alloc; goto err_alloc;
...@@ -449,8 +478,8 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) ...@@ -449,8 +478,8 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
else else
init_table(3, ref_table, pvt_wa_factors); init_table(3, ref_table, pvt_wa_factors);
/* Register the thermal sensors */ /* Precompute the derived table & fill each thermal sensor struct */
for (id = 0; id < cnt; id++) { for (id = 0; id < bgp->cnt; id++) {
data[id].bgp = bgp; data[id].bgp = bgp;
data[id].ctrl_offset = K3_VTM_TMPSENS0_CTRL_OFFSET + id * 0x20; data[id].ctrl_offset = K3_VTM_TMPSENS0_CTRL_OFFSET + id * 0x20;
data[id].stat_offset = data[id].ctrl_offset + data[id].stat_offset = data[id].ctrl_offset +
...@@ -470,13 +499,13 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) ...@@ -470,13 +499,13 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
else if (id == 0 && !workaround_needed) else if (id == 0 && !workaround_needed)
memcpy(derived_table, ref_table, TABLE_SIZE * 4); memcpy(derived_table, ref_table, TABLE_SIZE * 4);
val = readl(data[id].bgp->cfg2_base + data[id].ctrl_offset);
val |= (K3_VTM_TMPSENS_CTRL_MAXT_OUTRG_EN |
K3_VTM_TMPSENS_CTRL_SOC |
K3_VTM_TMPSENS_CTRL_CLRZ | BIT(4));
writel(val, data[id].bgp->cfg2_base + data[id].ctrl_offset);
bgp->ts_data[id] = &data[id]; bgp->ts_data[id] = &data[id];
}
k3_j72xx_bandgap_init_hw(bgp);
/* Register the thermal sensors */
for (id = 0; id < bgp->cnt; id++) {
ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, &data[id], ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, &data[id],
&k3_of_thermal_ops); &k3_of_thermal_ops);
if (IS_ERR(ti_thermal)) { if (IS_ERR(ti_thermal)) {
...@@ -486,21 +515,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) ...@@ -486,21 +515,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
} }
} }
/* platform_set_drvdata(pdev, bgp);
* Program TSHUT thresholds
* Step 1: set the thresholds to ~123C and 105C WKUP_VTM_MISC_CTRL2
* Step 2: WKUP_VTM_TMPSENS_CTRL_j set the MAXT_OUTRG_EN bit
* This is already taken care as per of init
* Step 3: WKUP_VTM_MISC_CTRL set the ANYMAXT_OUTRG_ALERT_EN bit
*/
high_max = k3_j72xx_bandgap_temp_to_adc_code(MAX_TEMP);
low_temp = k3_j72xx_bandgap_temp_to_adc_code(COOL_DOWN_TEMP);
writel((low_temp << 16) | high_max, data[0].bgp->cfg2_base +
K3_VTM_MISC_CTRL2_OFFSET);
mdelay(100);
writel(K3_VTM_ANYMAXT_OUTRG_ALERT_EN, data[0].bgp->cfg2_base +
K3_VTM_MISC_CTRL_OFFSET);
print_look_up_table(dev, ref_table); print_look_up_table(dev, ref_table);
/* /*
...@@ -527,6 +542,35 @@ static void k3_j72xx_bandgap_remove(struct platform_device *pdev) ...@@ -527,6 +542,35 @@ static void k3_j72xx_bandgap_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
} }
static int k3_j72xx_bandgap_suspend(struct device *dev)
{
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
return 0;
}
static int k3_j72xx_bandgap_resume(struct device *dev)
{
struct k3_j72xx_bandgap *bgp = dev_get_drvdata(dev);
int ret;
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
pm_runtime_put_noidle(dev);
pm_runtime_disable(dev);
return ret;
}
k3_j72xx_bandgap_init_hw(bgp);
return 0;
}
static DEFINE_SIMPLE_DEV_PM_OPS(k3_j72xx_bandgap_pm_ops,
k3_j72xx_bandgap_suspend,
k3_j72xx_bandgap_resume);
static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j721e_data = { static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j721e_data = {
.has_errata_i2128 = true, .has_errata_i2128 = true,
}; };
...@@ -554,6 +598,7 @@ static struct platform_driver k3_j72xx_bandgap_sensor_driver = { ...@@ -554,6 +598,7 @@ static struct platform_driver k3_j72xx_bandgap_sensor_driver = {
.driver = { .driver = {
.name = "k3-j72xx-soc-thermal", .name = "k3-j72xx-soc-thermal",
.of_match_table = of_k3_j72xx_bandgap_match, .of_match_table = of_k3_j72xx_bandgap_match,
.pm = pm_sleep_ptr(&k3_j72xx_bandgap_pm_ops),
}, },
}; };
......
...@@ -128,6 +128,7 @@ struct lvts_data { ...@@ -128,6 +128,7 @@ struct lvts_data {
int temp_factor; int temp_factor;
int temp_offset; int temp_offset;
int gt_calib_bit_offset; int gt_calib_bit_offset;
unsigned int def_calibration;
}; };
struct lvts_sensor { struct lvts_sensor {
...@@ -689,6 +690,10 @@ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl ...@@ -689,6 +690,10 @@ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl
size_t calib_len) size_t calib_len)
{ {
int i; int i;
u32 gt;
/* A zero value for gt means that device has invalid efuse data */
gt = (((u32 *)efuse_calibration)[0] >> lvts_ctrl->lvts_data->gt_calib_bit_offset) & 0xff;
lvts_for_each_valid_sensor(i, lvts_ctrl_data) { lvts_for_each_valid_sensor(i, lvts_ctrl_data) {
const struct lvts_sensor_data *sensor = const struct lvts_sensor_data *sensor =
...@@ -699,10 +704,17 @@ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl ...@@ -699,10 +704,17 @@ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl
sensor->cal_offsets[2] >= calib_len) sensor->cal_offsets[2] >= calib_len)
return -EINVAL; return -EINVAL;
lvts_ctrl->calibration[i] = if (gt) {
(efuse_calibration[sensor->cal_offsets[0]] << 0) + lvts_ctrl->calibration[i] =
(efuse_calibration[sensor->cal_offsets[1]] << 8) + (efuse_calibration[sensor->cal_offsets[0]] << 0) +
(efuse_calibration[sensor->cal_offsets[2]] << 16); (efuse_calibration[sensor->cal_offsets[1]] << 8) +
(efuse_calibration[sensor->cal_offsets[2]] << 16);
} else if (lvts_ctrl->lvts_data->def_calibration) {
lvts_ctrl->calibration[i] = lvts_ctrl->lvts_data->def_calibration;
} else {
dev_err(dev, "efuse contains invalid calibration data and no default given.\n");
return -ENODATA;
}
} }
return 0; return 0;
...@@ -770,14 +782,13 @@ static int lvts_golden_temp_init(struct device *dev, u8 *calib, ...@@ -770,14 +782,13 @@ static int lvts_golden_temp_init(struct device *dev, u8 *calib,
gt = (((u32 *)calib)[0] >> lvts_data->gt_calib_bit_offset) & 0xff; gt = (((u32 *)calib)[0] >> lvts_data->gt_calib_bit_offset) & 0xff;
/* A zero value for gt means that device has invalid efuse data */ /* A zero value for gt means that device has invalid efuse data */
if (!gt) if (gt && gt < LVTS_GOLDEN_TEMP_MAX)
return -ENODATA;
if (gt < LVTS_GOLDEN_TEMP_MAX)
golden_temp = gt; golden_temp = gt;
golden_temp_offset = golden_temp * 500 + lvts_data->temp_offset; golden_temp_offset = golden_temp * 500 + lvts_data->temp_offset;
dev_info(dev, "%sgolden temp=%d\n", gt ? "" : "fake ", golden_temp);
return 0; return 0;
} }
...@@ -1440,7 +1451,7 @@ static const struct lvts_ctrl_data mt8186_lvts_data_ctrl[] = { ...@@ -1440,7 +1451,7 @@ static const struct lvts_ctrl_data mt8186_lvts_data_ctrl[] = {
.cal_offsets = { 29, 30, 31 } }, .cal_offsets = { 29, 30, 31 } },
{ .dt_id = MT8186_ADSP, { .dt_id = MT8186_ADSP,
.cal_offsets = { 34, 35, 28 } }, .cal_offsets = { 34, 35, 28 } },
{ .dt_id = MT8186_MFG, { .dt_id = MT8186_GPU,
.cal_offsets = { 39, 32, 33 } } .cal_offsets = { 39, 32, 33 } }
}, },
VALID_SENSOR_MAP(1, 1, 1, 0), VALID_SENSOR_MAP(1, 1, 1, 0),
...@@ -1488,11 +1499,11 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = { ...@@ -1488,11 +1499,11 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = {
}, },
{ {
.lvts_sensor = { .lvts_sensor = {
{ .dt_id = MT8188_AP_GPU1, { .dt_id = MT8188_AP_GPU0,
.cal_offsets = { 43, 44, 45 } }, .cal_offsets = { 43, 44, 45 } },
{ .dt_id = MT8188_AP_GPU2, { .dt_id = MT8188_AP_GPU1,
.cal_offsets = { 46, 47, 48 } }, .cal_offsets = { 46, 47, 48 } },
{ .dt_id = MT8188_AP_SOC1, { .dt_id = MT8188_AP_ADSP,
.cal_offsets = { 49, 50, 51 } }, .cal_offsets = { 49, 50, 51 } },
}, },
VALID_SENSOR_MAP(1, 1, 1, 0), VALID_SENSOR_MAP(1, 1, 1, 0),
...@@ -1500,9 +1511,9 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = { ...@@ -1500,9 +1511,9 @@ static const struct lvts_ctrl_data mt8188_lvts_ap_data_ctrl[] = {
}, },
{ {
.lvts_sensor = { .lvts_sensor = {
{ .dt_id = MT8188_AP_SOC2, { .dt_id = MT8188_AP_VDO,
.cal_offsets = { 52, 53, 54 } }, .cal_offsets = { 52, 53, 54 } },
{ .dt_id = MT8188_AP_SOC3, { .dt_id = MT8188_AP_INFRA,
.cal_offsets = { 55, 56, 57 } }, .cal_offsets = { 55, 56, 57 } },
}, },
VALID_SENSOR_MAP(1, 1, 0, 0), VALID_SENSOR_MAP(1, 1, 0, 0),
...@@ -1701,6 +1712,7 @@ static const struct lvts_data mt8186_lvts_data = { ...@@ -1701,6 +1712,7 @@ static const struct lvts_data mt8186_lvts_data = {
.temp_factor = LVTS_COEFF_A_MT7988, .temp_factor = LVTS_COEFF_A_MT7988,
.temp_offset = LVTS_COEFF_B_MT7988, .temp_offset = LVTS_COEFF_B_MT7988,
.gt_calib_bit_offset = 24, .gt_calib_bit_offset = 24,
.def_calibration = 19000,
}; };
static const struct lvts_data mt8188_lvts_mcu_data = { static const struct lvts_data mt8188_lvts_mcu_data = {
...@@ -1709,6 +1721,7 @@ static const struct lvts_data mt8188_lvts_mcu_data = { ...@@ -1709,6 +1721,7 @@ static const struct lvts_data mt8188_lvts_mcu_data = {
.temp_factor = LVTS_COEFF_A_MT8195, .temp_factor = LVTS_COEFF_A_MT8195,
.temp_offset = LVTS_COEFF_B_MT8195, .temp_offset = LVTS_COEFF_B_MT8195,
.gt_calib_bit_offset = 20, .gt_calib_bit_offset = 20,
.def_calibration = 35000,
}; };
static const struct lvts_data mt8188_lvts_ap_data = { static const struct lvts_data mt8188_lvts_ap_data = {
...@@ -1717,6 +1730,7 @@ static const struct lvts_data mt8188_lvts_ap_data = { ...@@ -1717,6 +1730,7 @@ static const struct lvts_data mt8188_lvts_ap_data = {
.temp_factor = LVTS_COEFF_A_MT8195, .temp_factor = LVTS_COEFF_A_MT8195,
.temp_offset = LVTS_COEFF_B_MT8195, .temp_offset = LVTS_COEFF_B_MT8195,
.gt_calib_bit_offset = 20, .gt_calib_bit_offset = 20,
.def_calibration = 35000,
}; };
static const struct lvts_data mt8192_lvts_mcu_data = { static const struct lvts_data mt8192_lvts_mcu_data = {
...@@ -1725,6 +1739,7 @@ static const struct lvts_data mt8192_lvts_mcu_data = { ...@@ -1725,6 +1739,7 @@ static const struct lvts_data mt8192_lvts_mcu_data = {
.temp_factor = LVTS_COEFF_A_MT8195, .temp_factor = LVTS_COEFF_A_MT8195,
.temp_offset = LVTS_COEFF_B_MT8195, .temp_offset = LVTS_COEFF_B_MT8195,
.gt_calib_bit_offset = 24, .gt_calib_bit_offset = 24,
.def_calibration = 35000,
}; };
static const struct lvts_data mt8192_lvts_ap_data = { static const struct lvts_data mt8192_lvts_ap_data = {
...@@ -1733,6 +1748,7 @@ static const struct lvts_data mt8192_lvts_ap_data = { ...@@ -1733,6 +1748,7 @@ static const struct lvts_data mt8192_lvts_ap_data = {
.temp_factor = LVTS_COEFF_A_MT8195, .temp_factor = LVTS_COEFF_A_MT8195,
.temp_offset = LVTS_COEFF_B_MT8195, .temp_offset = LVTS_COEFF_B_MT8195,
.gt_calib_bit_offset = 24, .gt_calib_bit_offset = 24,
.def_calibration = 35000,
}; };
static const struct lvts_data mt8195_lvts_mcu_data = { static const struct lvts_data mt8195_lvts_mcu_data = {
...@@ -1741,6 +1757,7 @@ static const struct lvts_data mt8195_lvts_mcu_data = { ...@@ -1741,6 +1757,7 @@ static const struct lvts_data mt8195_lvts_mcu_data = {
.temp_factor = LVTS_COEFF_A_MT8195, .temp_factor = LVTS_COEFF_A_MT8195,
.temp_offset = LVTS_COEFF_B_MT8195, .temp_offset = LVTS_COEFF_B_MT8195,
.gt_calib_bit_offset = 24, .gt_calib_bit_offset = 24,
.def_calibration = 35000,
}; };
static const struct lvts_data mt8195_lvts_ap_data = { static const struct lvts_data mt8195_lvts_ap_data = {
...@@ -1749,6 +1766,7 @@ static const struct lvts_data mt8195_lvts_ap_data = { ...@@ -1749,6 +1766,7 @@ static const struct lvts_data mt8195_lvts_ap_data = {
.temp_factor = LVTS_COEFF_A_MT8195, .temp_factor = LVTS_COEFF_A_MT8195,
.temp_offset = LVTS_COEFF_B_MT8195, .temp_offset = LVTS_COEFF_B_MT8195,
.gt_calib_bit_offset = 24, .gt_calib_bit_offset = 24,
.def_calibration = 35000,
}; };
static const struct of_device_id lvts_of_match[] = { static const struct of_device_id lvts_of_match[] = {
......
...@@ -829,12 +829,9 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm, ...@@ -829,12 +829,9 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm,
channel->iio = devm_fwnode_iio_channel_get_by_name(adc_tm->dev, channel->iio = devm_fwnode_iio_channel_get_by_name(adc_tm->dev,
of_fwnode_handle(node), NULL); of_fwnode_handle(node), NULL);
if (IS_ERR(channel->iio)) { if (IS_ERR(channel->iio))
ret = PTR_ERR(channel->iio); return dev_err_probe(dev, PTR_ERR(channel->iio), "%s: error getting channel\n",
if (ret != -EPROBE_DEFER) name);
dev_err(dev, "%s: error getting channel: %d\n", name, ret);
return ret;
}
ret = of_property_read_u32_array(node, "qcom,pre-scaling", varr, 2); ret = of_property_read_u32_array(node, "qcom,pre-scaling", varr, 2);
if (!ret) { if (!ret) {
......
...@@ -1336,11 +1336,9 @@ static int tsens_probe(struct platform_device *pdev) ...@@ -1336,11 +1336,9 @@ static int tsens_probe(struct platform_device *pdev)
if (priv->ops->calibrate) { if (priv->ops->calibrate) {
ret = priv->ops->calibrate(priv); ret = priv->ops->calibrate(priv);
if (ret < 0) { if (ret < 0)
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "%s: calibration failed\n",
dev_err(dev, "%s: calibration failed\n", __func__); __func__);
return ret;
}
} }
ret = tsens_register(priv); ret = tsens_register(priv);
......
# SPDX-License-Identifier: GPL-2.0-only
config RCAR_THERMAL
tristate "Renesas R-Car thermal driver"
depends on ARCH_RENESAS || COMPILE_TEST
depends on HAS_IOMEM
depends on OF
help
Enable this to plug the R-Car thermal sensor driver into the Linux
thermal framework.
config RCAR_GEN3_THERMAL
tristate "Renesas R-Car Gen3 and RZ/G2 thermal driver"
depends on ARCH_RENESAS || COMPILE_TEST
depends on HAS_IOMEM
depends on OF
help
Enable this to plug the R-Car Gen3 or RZ/G2 thermal sensor driver into
the Linux thermal framework.
config RZG2L_THERMAL
tristate "Renesas RZ/G2L thermal driver"
depends on ARCH_RENESAS || COMPILE_TEST
depends on HAS_IOMEM
depends on OF
help
Enable this to plug the RZ/G2L thermal sensor driver into the Linux
thermal framework.
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_RCAR_GEN3_THERMAL) += rcar_gen3_thermal.o
obj-$(CONFIG_RCAR_THERMAL) += rcar_thermal.o
obj-$(CONFIG_RZG2L_THERMAL) += rzg2l_thermal.o
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/thermal.h> #include <linux/thermal.h>
#include "thermal_hwmon.h" #include "../thermal_hwmon.h"
/* Register offsets */ /* Register offsets */
#define REG_GEN3_IRQSTR 0x04 #define REG_GEN3_IRQSTR 0x04
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/thermal.h> #include <linux/thermal.h>
#include "thermal_hwmon.h" #include "../thermal_hwmon.h"
#define IDLE_INTERVAL 5000 #define IDLE_INTERVAL 5000
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <linux/thermal.h> #include <linux/thermal.h>
#include <linux/units.h> #include <linux/units.h>
#include "thermal_hwmon.h" #include "../thermal_hwmon.h"
#define CTEMP_MASK 0xFFF #define CTEMP_MASK 0xFFF
......
...@@ -1004,11 +1004,11 @@ static const struct thermal_zone_device_ops exynos_sensor_ops = { ...@@ -1004,11 +1004,11 @@ static const struct thermal_zone_device_ops exynos_sensor_ops = {
static int exynos_tmu_probe(struct platform_device *pdev) static int exynos_tmu_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct exynos_tmu_data *data; struct exynos_tmu_data *data;
int ret; int ret;
data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data), data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
...@@ -1020,7 +1020,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -1020,7 +1020,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
* TODO: Add regulator as an SOC feature, so that regulator enable * TODO: Add regulator as an SOC feature, so that regulator enable
* is a compulsory call. * is a compulsory call.
*/ */
ret = devm_regulator_get_enable_optional(&pdev->dev, "vtmu"); ret = devm_regulator_get_enable_optional(dev, "vtmu");
switch (ret) { switch (ret) {
case 0: case 0:
case -ENODEV: case -ENODEV:
...@@ -1028,8 +1028,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -1028,8 +1028,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
case -EPROBE_DEFER: case -EPROBE_DEFER:
return -EPROBE_DEFER; return -EPROBE_DEFER;
default: default:
dev_err(&pdev->dev, "Failed to get enabled regulator: %d\n", dev_err(dev, "Failed to get enabled regulator: %d\n", ret);
ret);
return ret; return ret;
} }
...@@ -1037,44 +1036,40 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -1037,44 +1036,40 @@ static int exynos_tmu_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
data->clk = devm_clk_get(&pdev->dev, "tmu_apbif"); data->clk = devm_clk_get(dev, "tmu_apbif");
if (IS_ERR(data->clk)) { if (IS_ERR(data->clk))
dev_err(&pdev->dev, "Failed to get clock\n"); return dev_err_probe(dev, PTR_ERR(data->clk), "Failed to get clock\n");
return PTR_ERR(data->clk);
}
data->clk_sec = devm_clk_get(&pdev->dev, "tmu_triminfo_apbif"); data->clk_sec = devm_clk_get(dev, "tmu_triminfo_apbif");
if (IS_ERR(data->clk_sec)) { if (IS_ERR(data->clk_sec)) {
if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO) { if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO)
dev_err(&pdev->dev, "Failed to get triminfo clock\n"); return dev_err_probe(dev, PTR_ERR(data->clk_sec),
return PTR_ERR(data->clk_sec); "Failed to get triminfo clock\n");
}
} else { } else {
ret = clk_prepare(data->clk_sec); ret = clk_prepare(data->clk_sec);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to get clock\n"); dev_err(dev, "Failed to get clock\n");
return ret; return ret;
} }
} }
ret = clk_prepare(data->clk); ret = clk_prepare(data->clk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to get clock\n"); dev_err(dev, "Failed to get clock\n");
goto err_clk_sec; goto err_clk_sec;
} }
switch (data->soc) { switch (data->soc) {
case SOC_ARCH_EXYNOS5433: case SOC_ARCH_EXYNOS5433:
case SOC_ARCH_EXYNOS7: case SOC_ARCH_EXYNOS7:
data->sclk = devm_clk_get(&pdev->dev, "tmu_sclk"); data->sclk = devm_clk_get(dev, "tmu_sclk");
if (IS_ERR(data->sclk)) { if (IS_ERR(data->sclk)) {
dev_err(&pdev->dev, "Failed to get sclk\n"); ret = dev_err_probe(dev, PTR_ERR(data->sclk), "Failed to get sclk\n");
ret = PTR_ERR(data->sclk);
goto err_clk; goto err_clk;
} else { } else {
ret = clk_prepare_enable(data->sclk); ret = clk_prepare_enable(data->sclk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to enable sclk\n"); dev_err(dev, "Failed to enable sclk\n");
goto err_clk; goto err_clk;
} }
} }
...@@ -1085,33 +1080,30 @@ static int exynos_tmu_probe(struct platform_device *pdev) ...@@ -1085,33 +1080,30 @@ static int exynos_tmu_probe(struct platform_device *pdev)
ret = exynos_tmu_initialize(pdev); ret = exynos_tmu_initialize(pdev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to initialize TMU\n"); dev_err(dev, "Failed to initialize TMU\n");
goto err_sclk; goto err_sclk;
} }
data->tzd = devm_thermal_of_zone_register(&pdev->dev, 0, data, data->tzd = devm_thermal_of_zone_register(dev, 0, data,
&exynos_sensor_ops); &exynos_sensor_ops);
if (IS_ERR(data->tzd)) { if (IS_ERR(data->tzd)) {
ret = PTR_ERR(data->tzd); ret = dev_err_probe(dev, PTR_ERR(data->tzd), "Failed to register sensor\n");
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "Failed to register sensor: %d\n",
ret);
goto err_sclk; goto err_sclk;
} }
ret = exynos_thermal_zone_configure(pdev); ret = exynos_thermal_zone_configure(pdev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to configure the thermal zone\n"); dev_err(dev, "Failed to configure the thermal zone\n");
goto err_sclk; goto err_sclk;
} }
ret = devm_request_threaded_irq(&pdev->dev, data->irq, NULL, ret = devm_request_threaded_irq(dev, data->irq, NULL,
exynos_tmu_threaded_irq, exynos_tmu_threaded_irq,
IRQF_TRIGGER_RISING IRQF_TRIGGER_RISING
| IRQF_SHARED | IRQF_ONESHOT, | IRQF_SHARED | IRQF_ONESHOT,
dev_name(&pdev->dev), data); dev_name(dev), data);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq); dev_err(dev, "Failed to request irq: %d\n", data->irq);
goto err_sclk; goto err_sclk;
} }
......
...@@ -142,15 +142,6 @@ static const struct st_thermal_sensor_ops st_mmap_sensor_ops = { ...@@ -142,15 +142,6 @@ static const struct st_thermal_sensor_ops st_mmap_sensor_ops = {
.enable_irq = st_mmap_enable_irq, .enable_irq = st_mmap_enable_irq,
}; };
/* Compatible device data stih416 mpe thermal sensor */
static const struct st_thermal_compat_data st_416mpe_cdata = {
.reg_fields = st_mmap_thermal_regfields,
.ops = &st_mmap_sensor_ops,
.calibration_val = 14,
.temp_adjust_val = -95,
.crit_temp = 120,
};
/* Compatible device data stih407 thermal sensor */ /* Compatible device data stih407 thermal sensor */
static const struct st_thermal_compat_data st_407_cdata = { static const struct st_thermal_compat_data st_407_cdata = {
.reg_fields = st_mmap_thermal_regfields, .reg_fields = st_mmap_thermal_regfields,
...@@ -161,7 +152,6 @@ static const struct st_thermal_compat_data st_407_cdata = { ...@@ -161,7 +152,6 @@ static const struct st_thermal_compat_data st_407_cdata = {
}; };
static const struct of_device_id st_mmap_thermal_of_match[] = { static const struct of_device_id st_mmap_thermal_of_match[] = {
{ .compatible = "st,stih416-mpe-thermal", .data = &st_416mpe_cdata },
{ .compatible = "st,stih407-thermal", .data = &st_407_cdata }, { .compatible = "st,stih407-thermal", .data = &st_407_cdata },
{ /* sentinel */ } { /* sentinel */ }
}; };
......
...@@ -117,44 +117,41 @@ static int gadc_thermal_read_linear_lookup_table(struct device *dev, ...@@ -117,44 +117,41 @@ static int gadc_thermal_read_linear_lookup_table(struct device *dev,
static int gadc_thermal_probe(struct platform_device *pdev) static int gadc_thermal_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct gadc_thermal_info *gti; struct gadc_thermal_info *gti;
int ret; int ret;
if (!pdev->dev.of_node) { if (!dev->of_node) {
dev_err(&pdev->dev, "Only DT based supported\n"); dev_err(dev, "Only DT based supported\n");
return -ENODEV; return -ENODEV;
} }
gti = devm_kzalloc(&pdev->dev, sizeof(*gti), GFP_KERNEL); gti = devm_kzalloc(dev, sizeof(*gti), GFP_KERNEL);
if (!gti) if (!gti)
return -ENOMEM; return -ENOMEM;
gti->channel = devm_iio_channel_get(&pdev->dev, "sensor-channel"); gti->channel = devm_iio_channel_get(dev, "sensor-channel");
if (IS_ERR(gti->channel)) { if (IS_ERR(gti->channel))
ret = PTR_ERR(gti->channel); return dev_err_probe(dev, PTR_ERR(gti->channel), "IIO channel not found\n");
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "IIO channel not found: %d\n", ret);
return ret;
}
ret = gadc_thermal_read_linear_lookup_table(&pdev->dev, gti); ret = gadc_thermal_read_linear_lookup_table(dev, gti);
if (ret < 0) if (ret < 0)
return ret; return ret;
gti->dev = &pdev->dev; gti->dev = dev;
gti->tz_dev = devm_thermal_of_zone_register(&pdev->dev, 0, gti, gti->tz_dev = devm_thermal_of_zone_register(dev, 0, gti,
&gadc_thermal_ops); &gadc_thermal_ops);
if (IS_ERR(gti->tz_dev)) { if (IS_ERR(gti->tz_dev)) {
ret = PTR_ERR(gti->tz_dev); ret = PTR_ERR(gti->tz_dev);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, dev_err(dev,
"Thermal zone sensor register failed: %d\n", "Thermal zone sensor register failed: %d\n",
ret); ret);
return ret; return ret;
} }
devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev); devm_thermal_add_hwmon_sysfs(dev, gti->tz_dev);
return 0; return 0;
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define MT8186_BIG_CPU1 5 #define MT8186_BIG_CPU1 5
#define MT8186_NNA 6 #define MT8186_NNA 6
#define MT8186_ADSP 7 #define MT8186_ADSP 7
#define MT8186_MFG 8 #define MT8186_GPU 8
#define MT8188_MCU_LITTLE_CPU0 0 #define MT8188_MCU_LITTLE_CPU0 0
#define MT8188_MCU_LITTLE_CPU1 1 #define MT8188_MCU_LITTLE_CPU1 1
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
#define MT8188_MCU_BIG_CPU1 5 #define MT8188_MCU_BIG_CPU1 5
#define MT8188_AP_APU 0 #define MT8188_AP_APU 0
#define MT8188_AP_GPU1 1 #define MT8188_AP_GPU0 1
#define MT8188_AP_GPU2 2 #define MT8188_AP_GPU1 2
#define MT8188_AP_SOC1 3 #define MT8188_AP_ADSP 3
#define MT8188_AP_SOC2 4 #define MT8188_AP_VDO 4
#define MT8188_AP_SOC3 5 #define MT8188_AP_INFRA 5
#define MT8188_AP_CAM1 6 #define MT8188_AP_CAM1 6
#define MT8188_AP_CAM2 7 #define MT8188_AP_CAM2 7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment