Re: [PATCH 7/8 v3] ARM: shmobile: r8a7791: enable to use thermal-zone

2015-12-07 Thread Kuninori Morimoto

Hi Khiem

> Hi Morimoto-san,
> 
> Thanks for your patch.
> I have same comments as patch 0006.

Thanks, will fix in v4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/8 v3] ARM: shmobile: r8a7791: enable to use thermal-zone

2015-12-07 Thread Khiem Nguyen

Hi Morimoto-san,

Thanks for your patch.
I have same comments as patch 0006.

On 12/7/2015 2:44 PM, Kuninori Morimoto wrote:


From: Kuninori Morimoto 

This patch enables to use thermal-zone on r8a7791.
This thermal sensor can measure temperature from -4 to 125000,
but over 117000 can be critical on this chip.
Thus, default critical temperature is now set as 115000 (this driver
is using 5000 steps) (Current critical temperature is using it as
9, but there is no big reason about it)

And it doesn't check thermal zone periodically (same as current
behavior). You can exchange it by modifing polling-delay[-passive]


modifing -> modifying


property.

You can set trip temp if your kernel has CONFIG_THERMAL_WRITABLE_TRIPS,
but you need to take care to use it, since it will call
orderly_poweroff() it it reached to the value.


if it reaches


echo $temp > /sys/class/thermal/thermal_zone0/trip_point_0_temp

Signed-off-by: Kuninori Morimoto 
---
v2 -> v3

  - compatible "renesas,rcar-thermal-gen2" -> "renesas,rcar-gen2-thermal"

  arch/arm/boot/dts/r8a7791.dtsi | 26 --
  1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1487d92..d885e5f 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -69,6 +69,25 @@
};
};

+   thermal-zones {
+   cpu_thermal: cpu-thermal {
+   polling-delay-passive   = <0>;
+   polling-delay   = <0>;
+
+   thermal-sensors = <>;
+
+   trips {
+   cpu-crit {
+   temperature = <115>;


One zero is redundant here. It should be 115000.


+   hysteresis  = <0>;
+   type= "critical";
+   };
+   };
+   cooling-maps {
+   };
+   };
+   };
+
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
@@ -185,12 +204,15 @@
power-domains = <_clocks>;
};

-   thermal@e61f {
-   compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal";
+   thermal: thermal@e61f {
+   compatible ="renesas,thermal-r8a7791",
+   "renesas,rcar-gen2-thermal",
+   "renesas,rcar-thermal";
reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7791_CLK_THERMAL>;
power-domains = <_clocks>;
+   #thermal-sensor-cells = <0>;
};

timer {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/8 v3] ARM: shmobile: r8a7791: enable to use thermal-zone

2015-12-07 Thread Khiem Nguyen

Hi Morimoto-san,

Thanks for your patch.
I have same comments as patch 0006.

On 12/7/2015 2:44 PM, Kuninori Morimoto wrote:


From: Kuninori Morimoto 

This patch enables to use thermal-zone on r8a7791.
This thermal sensor can measure temperature from -4 to 125000,
but over 117000 can be critical on this chip.
Thus, default critical temperature is now set as 115000 (this driver
is using 5000 steps) (Current critical temperature is using it as
9, but there is no big reason about it)

And it doesn't check thermal zone periodically (same as current
behavior). You can exchange it by modifing polling-delay[-passive]


modifing -> modifying


property.

You can set trip temp if your kernel has CONFIG_THERMAL_WRITABLE_TRIPS,
but you need to take care to use it, since it will call
orderly_poweroff() it it reached to the value.


if it reaches


echo $temp > /sys/class/thermal/thermal_zone0/trip_point_0_temp

Signed-off-by: Kuninori Morimoto 
---
v2 -> v3

  - compatible "renesas,rcar-thermal-gen2" -> "renesas,rcar-gen2-thermal"

  arch/arm/boot/dts/r8a7791.dtsi | 26 --
  1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1487d92..d885e5f 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -69,6 +69,25 @@
};
};

+   thermal-zones {
+   cpu_thermal: cpu-thermal {
+   polling-delay-passive   = <0>;
+   polling-delay   = <0>;
+
+   thermal-sensors = <>;
+
+   trips {
+   cpu-crit {
+   temperature = <115>;


One zero is redundant here. It should be 115000.


+   hysteresis  = <0>;
+   type= "critical";
+   };
+   };
+   cooling-maps {
+   };
+   };
+   };
+
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
@@ -185,12 +204,15 @@
power-domains = <_clocks>;
};

-   thermal@e61f {
-   compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal";
+   thermal: thermal@e61f {
+   compatible ="renesas,thermal-r8a7791",
+   "renesas,rcar-gen2-thermal",
+   "renesas,rcar-thermal";
reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7791_CLK_THERMAL>;
power-domains = <_clocks>;
+   #thermal-sensor-cells = <0>;
};

timer {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/8 v3] ARM: shmobile: r8a7791: enable to use thermal-zone

2015-12-07 Thread Kuninori Morimoto

Hi Khiem

> Hi Morimoto-san,
> 
> Thanks for your patch.
> I have same comments as patch 0006.

Thanks, will fix in v4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/8 v3] ARM: shmobile: r8a7791: enable to use thermal-zone

2015-12-06 Thread Kuninori Morimoto

From: Kuninori Morimoto 

This patch enables to use thermal-zone on r8a7791.
This thermal sensor can measure temperature from -4 to 125000,
but over 117000 can be critical on this chip.
Thus, default critical temperature is now set as 115000 (this driver
is using 5000 steps) (Current critical temperature is using it as
9, but there is no big reason about it)

And it doesn't check thermal zone periodically (same as current
behavior). You can exchange it by modifing polling-delay[-passive]
property.

You can set trip temp if your kernel has CONFIG_THERMAL_WRITABLE_TRIPS,
but you need to take care to use it, since it will call
orderly_poweroff() it it reached to the value.
echo $temp > /sys/class/thermal/thermal_zone0/trip_point_0_temp

Signed-off-by: Kuninori Morimoto 
---
v2 -> v3

 - compatible "renesas,rcar-thermal-gen2" -> "renesas,rcar-gen2-thermal"

 arch/arm/boot/dts/r8a7791.dtsi | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1487d92..d885e5f 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -69,6 +69,25 @@
};
};
 
+   thermal-zones {
+   cpu_thermal: cpu-thermal {
+   polling-delay-passive   = <0>;
+   polling-delay   = <0>;
+
+   thermal-sensors = <>;
+
+   trips {
+   cpu-crit {
+   temperature = <115>;
+   hysteresis  = <0>;
+   type= "critical";
+   };
+   };
+   cooling-maps {
+   };
+   };
+   };
+
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
@@ -185,12 +204,15 @@
power-domains = <_clocks>;
};
 
-   thermal@e61f {
-   compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal";
+   thermal: thermal@e61f {
+   compatible ="renesas,thermal-r8a7791",
+   "renesas,rcar-gen2-thermal",
+   "renesas,rcar-thermal";
reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7791_CLK_THERMAL>;
power-domains = <_clocks>;
+   #thermal-sensor-cells = <0>;
};
 
timer {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 7/8 v3] ARM: shmobile: r8a7791: enable to use thermal-zone

2015-12-06 Thread Kuninori Morimoto

From: Kuninori Morimoto 

This patch enables to use thermal-zone on r8a7791.
This thermal sensor can measure temperature from -4 to 125000,
but over 117000 can be critical on this chip.
Thus, default critical temperature is now set as 115000 (this driver
is using 5000 steps) (Current critical temperature is using it as
9, but there is no big reason about it)

And it doesn't check thermal zone periodically (same as current
behavior). You can exchange it by modifing polling-delay[-passive]
property.

You can set trip temp if your kernel has CONFIG_THERMAL_WRITABLE_TRIPS,
but you need to take care to use it, since it will call
orderly_poweroff() it it reached to the value.
echo $temp > /sys/class/thermal/thermal_zone0/trip_point_0_temp

Signed-off-by: Kuninori Morimoto 
---
v2 -> v3

 - compatible "renesas,rcar-thermal-gen2" -> "renesas,rcar-gen2-thermal"

 arch/arm/boot/dts/r8a7791.dtsi | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1487d92..d885e5f 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -69,6 +69,25 @@
};
};
 
+   thermal-zones {
+   cpu_thermal: cpu-thermal {
+   polling-delay-passive   = <0>;
+   polling-delay   = <0>;
+
+   thermal-sensors = <>;
+
+   trips {
+   cpu-crit {
+   temperature = <115>;
+   hysteresis  = <0>;
+   type= "critical";
+   };
+   };
+   cooling-maps {
+   };
+   };
+   };
+
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
@@ -185,12 +204,15 @@
power-domains = <_clocks>;
};
 
-   thermal@e61f {
-   compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal";
+   thermal: thermal@e61f {
+   compatible ="renesas,thermal-r8a7791",
+   "renesas,rcar-gen2-thermal",
+   "renesas,rcar-thermal";
reg = <0 0xe61f 0 0x14>, <0 0xe61f0100 0 0x38>;
interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7791_CLK_THERMAL>;
power-domains = <_clocks>;
+   #thermal-sensor-cells = <0>;
};
 
timer {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/