2021-04-09 07:13:52

by Michael Kao

[permalink] [raw]
Subject: [PATCH 1/1] arm64: dts: mt8183-kukui: Enable thermal Tboard

Add Tboard thermal sensor settings.

pull-up voltage: 1800 mv
pull-up resistor: 75K

Vsense = pull-up voltage * Rntc / ( pull-up resistor + Rntc )
AuxIn = Vsense * 4096 / 1500

TEST=boot kukui
check /sys/class/thermal/thermal_zone*/type
check /sys/class/thermal/thermal_zone*/temp

Signed-off-by: Michael Kao <[email protected]>
Signed-off-by: Nicolas Boichat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 14 ++++++++++++++
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 2 +-
2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index bf2ad1294dd3..202acb542b12 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -801,6 +801,20 @@
status = "okay";
};

+&thermal_zones {
+ Tboard1 {
+ polling-delay = <1000>; /* milliseconds */
+ polling-delay-passive = <0>; /* milliseconds */
+ thermal-sensors = <&tboard_thermistor1>;
+ };
+
+ Tboard2 {
+ polling-delay = <1000>; /* milliseconds */
+ polling-delay-passive = <0>; /* milliseconds */
+ thermal-sensors = <&tboard_thermistor2>;
+ };
+};
+
&u3phy {
status = "okay";
};
diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index 1ad0a1d55d53..f0719dbef249 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -673,7 +673,7 @@
nvmem-cell-names = "calibration-data";
};

- thermal-zones {
+ thermal_zones: thermal-zones {
cpu_thermal: cpu_thermal {
polling-delay-passive = <100>;
polling-delay = <500>;
--
2.18.0


2021-04-09 07:18:14

by Hsin-Yi Wang

[permalink] [raw]
Subject: Re: [PATCH 1/1] arm64: dts: mt8183-kukui: Enable thermal Tboard

On Fri, Apr 9, 2021 at 3:12 PM Michael Kao <[email protected]> wrote:
>
> Add Tboard thermal sensor settings.
>
> pull-up voltage: 1800 mv
> pull-up resistor: 75K
>
> Vsense = pull-up voltage * Rntc / ( pull-up resistor + Rntc )
> AuxIn = Vsense * 4096 / 1500
>
> TEST=boot kukui
> check /sys/class/thermal/thermal_zone*/type
> check /sys/class/thermal/thermal_zone*/temp
the TEST lines can be removed.

>
> Signed-off-by: Michael Kao <[email protected]>
> Signed-off-by: Nicolas Boichat <[email protected]>
> ---

Tested-by: Hsin-Yi Wang <[email protected]>

This removes following error:
[ 10.882325] generic-adc-thermal thermal-sensor1: Thermal zone
sensor register failed: -19
[ 10.911912] generic-adc-thermal thermal-sensor2: Thermal zone
sensor register failed: -19

> arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 14 ++++++++++++++
> arch/arm64/boot/dts/mediatek/mt8183.dtsi | 2 +-
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> index bf2ad1294dd3..202acb542b12 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> @@ -801,6 +801,20 @@
> status = "okay";
> };
>
> +&thermal_zones {
> + Tboard1 {
> + polling-delay = <1000>; /* milliseconds */
> + polling-delay-passive = <0>; /* milliseconds */
> + thermal-sensors = <&tboard_thermistor1>;
> + };
> +
> + Tboard2 {
> + polling-delay = <1000>; /* milliseconds */
> + polling-delay-passive = <0>; /* milliseconds */
> + thermal-sensors = <&tboard_thermistor2>;
> + };
> +};
> +
> &u3phy {
> status = "okay";
> };
> diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> index 1ad0a1d55d53..f0719dbef249 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> @@ -673,7 +673,7 @@
> nvmem-cell-names = "calibration-data";
> };
>
> - thermal-zones {
> + thermal_zones: thermal-zones {
> cpu_thermal: cpu_thermal {
> polling-delay-passive = <100>;
> polling-delay = <500>;
> --
> 2.18.0
>

2021-05-06 05:27:42

by Michael Kao

[permalink] [raw]
Subject: Re: [PATCH 1/1] arm64: dts: mt8183-kukui: Enable thermal Tboard

Hi Maintainers,

Gentle pin for this patch.

Thanks

On Fri, 2021-04-09 at 15:16 +0800, Hsin-Yi Wang wrote:
> On Fri, Apr 9, 2021 at 3:12 PM Michael Kao <[email protected]>
> wrote:
> >
> > Add Tboard thermal sensor settings.
> >
> > pull-up voltage: 1800 mv
> > pull-up resistor: 75K
> >
> > Vsense = pull-up voltage * Rntc / ( pull-up resistor + Rntc )
> > AuxIn = Vsense * 4096 / 1500
> >
> > TEST=boot kukui
> > check /sys/class/thermal/thermal_zone*/type
> > check /sys/class/thermal/thermal_zone*/temp
>
> the TEST lines can be removed.
>
> >
> > Signed-off-by: Michael Kao <[email protected]>
> > Signed-off-by: Nicolas Boichat <[email protected]>
> > ---
>
> Tested-by: Hsin-Yi Wang <[email protected]>
>
> This removes following error:
> [ 10.882325] generic-adc-thermal thermal-sensor1: Thermal zone
> sensor register failed: -19
> [ 10.911912] generic-adc-thermal thermal-sensor2: Thermal zone
> sensor register failed: -19
>
> > arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 14 ++++++++++++++
> > arch/arm64/boot/dts/mediatek/mt8183.dtsi | 2 +-
> > 2 files changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> > b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> > index bf2ad1294dd3..202acb542b12 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> > +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> > @@ -801,6 +801,20 @@
> > status = "okay";
> > };
> >
> > +&thermal_zones {
> > + Tboard1 {
> > + polling-delay = <1000>; /* milliseconds */
> > + polling-delay-passive = <0>; /* milliseconds */
> > + thermal-sensors = <&tboard_thermistor1>;
> > + };
> > +
> > + Tboard2 {
> > + polling-delay = <1000>; /* milliseconds */
> > + polling-delay-passive = <0>; /* milliseconds */
> > + thermal-sensors = <&tboard_thermistor2>;
> > + };
> > +};
> > +
> > &u3phy {
> > status = "okay";
> > };
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> > b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> > index 1ad0a1d55d53..f0719dbef249 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> > +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> > @@ -673,7 +673,7 @@
> > nvmem-cell-names = "calibration-data";
> > };
> >
> > - thermal-zones {
> > + thermal_zones: thermal-zones {
> > cpu_thermal: cpu_thermal {
> > polling-delay-passive = <100>;
> > polling-delay = <500>;
> > --
> > 2.18.0
> >