thermal: sun8i: fix r40 ths number
Yangtao Li
maintainerPATCH 1/2 thermal: sun8i: fix r40 ths number
According to the spec, r40 has 2 thermal sensors.
Sensor0 located in the CPU, another in the GPU.
Tested-on: sun8i-r40-bananapi-m2-ultra
--- drivers/thermal/sun8i_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/sun8i_thermal.c +1 -1
@@ -565,7 +565,7 @@ static const struct ths_thermal_chip sun8i_h3_ths = { };static const struct ths_thermal_chip sun8i_r40_ths = { - .sensor_num =3 , + .sensor_num =2 , .offset =251086 , .scale =1130 , .has_mod_clk = true,
Signature · 1 line
2.17.1
Yangtao Li
maintainerPATCH 2/2 ARM: dts: sun8i-r40: Add thermal sensor and thermal zones
There are two sensors, sensor0 for CPU, sensor1 for GPU.
Tested-on: sun8i-r40-bananapi-m2-ultra
--- arch/arm/boot/dts/sun8i-r40.dtsi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm/boot/dts/sun8i-r40.dtsi +28 -0
@@ -46,6 +46,7 @@ #include <dt-bindings/clock/sun8i-r40-ccu.h> #include <dt-bindings/reset/sun8i-r40-ccu.h> #include <dt-bindings/reset/sun8i-de2.h> +#include <dt-bindings/thermal/thermal.h> / { #address-cells = <1>;
@@ -109,6 +110,22 @@ status = "disabled"; }; + thermal-zones { + cpu_thermal: cpu0-thermal { + /* milliseconds */ + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 0>; + }; + + gpu_thermal: gpu-thermal { + /* milliseconds */ + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 1>; + }; + }; + soc { compatible = "simple-bus"; #address-cells = <1>;
@@ -421,6 +438,17 @@ clocks = <&osc24M>; }; + ths: thermal-sensor@1c24c00 { + compatible = "allwinner,sun8i-r40-ths"; + reg = <0x01c24c00 0x100>; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "bus", "mod"; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + resets = <&ccu RST_BUS_THS>; + /* TODO: add nvmem-cells for calibration */ + #thermal-sensor-cells = <1>; + }; + uart0: serial@1c28000 { compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>;
Signature · 1 line
2.17.1
Vasily Khoruzhick
maintainerQuoted 5 lines · Yangtao Li
According to the spec, r40 has 2 thermal sensors.
Sensor0 located in the CPU, another in the GPU.Signed-off-by Yangtao Li <[email protected]>
You should also add "Fixes" tag here.
Quoted 22 lines
Tested-by Corentin Labbe <[email protected]>Tested-on: sun8i-r40-bananapi-m2-ultra
--- drivers/thermal/sun8i_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/sun8i_thermal.c +1
-2@@ -565,7 +565,7 @@ static const struct ths_thermal_chip sun8i_h3_ths = { };static const struct ths_thermal_chip sun8i_r40_ths = { - .sensor_num =3 , + .sensor_num =2 , .offset =251086 , .scale =1130 , .has_mod_clk = true, --2.17.1
Frank Lee
maintainerQuoted 9 lines · Vasily Khoruzhick
Quoted 5 lines · Yangtao Li
According to the spec, r40 has 2 thermal sensors.
Sensor0 located in the CPU, another in the GPU.Signed-off-by Yangtao Li <[email protected]>You should also add "Fixes" tag here.
Since the driver has not yet entered the merge window...... Thanks for reminding, :D
Yangtao
Quoted 23 lines
Quoted 23 lines
Tested-by Corentin Labbe <[email protected]>Tested-on: sun8i-r40-bananapi-m2-ultra
--- drivers/thermal/sun8i_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/sun8i_thermal.c +1
-2@@ -565,7 +565,7 @@ static const struct ths_thermal_chip sun8i_h3_ths = { };static const struct ths_thermal_chip sun8i_r40_ths = { - .sensor_num =3 , + .sensor_num =2 , .offset =251086 , .scale =1130 , .has_mod_clk = true, --2.17.1