2021-03-12 04:45:02

by Michael Kao

[permalink] [raw]
Subject: [v3,0/3] thermal: mediatek: Add LVTS architecture thermal controller

This patch move thermal files related to Mediatek to the mediatek folder.
And introduce the new architecture LVTS (low pressure thermal sensor) driver to report
the highest temperature in the SoC and record the highest temperature sensor,
each sensor as a hot zone.
The LVTS body is divided into two parts, the LVTS controller and the LVTS device.
The LVTS controller can connect up to 4 LVTS devices, and each LVTS device
can connect up to 7 TSMCUs.

The architecture will be the first to be used on mt6873 and mt8192.

Change in v3:
- [2/3]
- change the expression in the lvts_temp_to_raw to dev_s64.

Change in v2:
- Rebase to kernel-5.11-rc1.
- [2/3]
- sort headers
- remove initial value 0 of msr_raw in the lvts_temp_to_raw.
- disconstruct the api of lvts_read_tc_msr_raw.
- add the initial value max_temp = 0 and compare e.q.
in the lvts_read_all_tc_temperature.
- add the return with invalid number in the lvts_init.

This patch depends on [1].

[1]https://patchwork.kernel.org/project/linux-mediatek/cover/[email protected]/

Michael Kao (3):
thermal: mediatek: Relocate driver to mediatek folder
thermal: mediatek: Add LVTS drivers for SoC theraml zones
dt-bindings: thermal: Add binding document for mt6873 thermal
controller

.../thermal/mediatek-thermal-lvts.yaml | 81 ++
drivers/thermal/Kconfig | 14 +-
drivers/thermal/Makefile | 2 +-
drivers/thermal/mediatek/Kconfig | 33 +
drivers/thermal/mediatek/Makefile | 2 +
.../{mtk_thermal.c => mediatek/soc_temp.c} | 0
drivers/thermal/mediatek/soc_temp_lvts.c | 1287 +++++++++++++++++
drivers/thermal/mediatek/soc_temp_lvts.h | 312 ++++
8 files changed, 1720 insertions(+), 11 deletions(-)
create mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml
create mode 100644 drivers/thermal/mediatek/Kconfig
create mode 100644 drivers/thermal/mediatek/Makefile
rename drivers/thermal/{mtk_thermal.c => mediatek/soc_temp.c} (100%)
create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.c
create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.h

--
2.18.0


2021-03-12 04:45:33

by Michael Kao

[permalink] [raw]
Subject: [v3,3/3] dt-bindings: thermal: Add binding document for mt6873 thermal controller

This patch adds binding document for mt6873 thermal controller.

Signed-off-by: Michael Kao <[email protected]>
---
This patch depends on [1].

[1]https://patchwork.kernel.org/project/linux-mediatek/cover/[email protected]/
---
.../thermal/mediatek-thermal-lvts.yaml | 81 +++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml

diff --git a/Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml b/Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml
new file mode 100644
index 000000000000..0c6535abeb81
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/mediatek-thermal-lvts.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek SoC LVTS thermal controller (DTS) binding
+
+maintainers:
+ - Yu-Chia Chang <[email protected]>
+ - Michael Kao <[email protected]>
+
+properties:
+ compatible:
+ const: mediatek,mt6873-lvts
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ items:
+ - const: lvts_clk
+
+ "#thermal-sensor-cells":
+ const: 0
+
+required:
+ - "#thermal-sensor-cells"
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/thermal/thermal.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/mt8192-clk.h>
+ dts: lvts@1100b000 {
+ compatible = "mediatek,mt6873-lvts";
+ reg = <0x1100b000 0x1000>;
+ clocks = <&infracfg CLK_INFRA_THERM>;
+ clock-names = "lvts_clk";
+ #thermal-sensor-cells = <0>;
+ interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ thermal-zones {
+ cpu_thermal: cpu-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+
+ thermal-sensors = <&dts>;
+ trips {
+ cpu_alert1: cpu-alert1 {
+ temperature = <85000>;
+ hysteresis = <0>;
+ type = "passive";
+ };
+
+ cpu_crit: cpu-crit {
+ temperature = <120000>;
+ hysteresis = <0>;
+ type = "critical";
+ };
+ };
+
+ cooling-maps {
+ };
+ };
+ };
+...
--
2.18.0

2021-03-23 20:22:52

by Rob Herring

[permalink] [raw]
Subject: Re: [v3, 3/3] dt-bindings: thermal: Add binding document for mt6873 thermal controller

On Fri, 12 Mar 2021 11:40:18 +0800, Michael Kao wrote:
> This patch adds binding document for mt6873 thermal controller.
>
> Signed-off-by: Michael Kao <[email protected]>
> ---
> This patch depends on [1].
>
> [1]https://patchwork.kernel.org/project/linux-mediatek/cover/[email protected]/
> ---
> .../thermal/mediatek-thermal-lvts.yaml | 81 +++++++++++++++++++
> 1 file changed, 81 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml
>

Reviewed-by: Rob Herring <[email protected]>