From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932670AbbLHDGw (ORCPT ); Mon, 7 Dec 2015 22:06:52 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:39629 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932267AbbLHDGt (ORCPT ); Mon, 7 Dec 2015 22:06:49 -0500 X-IronPort-AV: E=Sophos;i="5.20,397,1444662000"; d="scan'208";a="201311080" Message-ID: <56664945.9070707@rvc.renesas.com> Date: Tue, 8 Dec 2015 10:06:45 +0700 From: Khiem Nguyen User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Kuninori Morimoto CC: Simon , Zhang Rui , Eduardo Valentin , Geert Uytterhoeven , Magnus , "linux-sh@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Khiem Nguyen , "Hien Duy. Dang" , Toru Oishi Subject: Re: [PATCH 6/8 v3] ARM: shmobile: r8a7790: enable to use thermal-zone References: <87y4d6672t.wl%kuninori.morimoto.gx@renesas.com> <87poyi66yt.wl%kuninori.morimoto.gx@renesas.com> In-Reply-To: <87poyi66yt.wl%kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Morimoto-san, Thanks for your patch. On 12/7/2015 2:44 PM, Kuninori Morimoto wrote: > > From: Kuninori Morimoto > > This patch enables to use thermal-zone on r8a7790. > This thermal sensor can measure temperature from -40000 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 > 90000, 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/r8a7790.dtsi | 26 ++++++++++++++++++++++++-- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi > index 6cfd0dc..49aaa67 100644 > --- a/arch/arm/boot/dts/r8a7790.dtsi > +++ b/arch/arm/boot/dts/r8a7790.dtsi > @@ -112,6 +112,25 @@ > }; > }; > > + thermal-zones { > + cpu_thermal: cpu-thermal { > + polling-delay-passive = <0>; > + polling-delay = <0>; > + > + thermal-sensors = <&thermal>; > + > + trips { > + cpu-crit { > + temperature = <1150000>; 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>; > @@ -202,12 +221,15 @@ > power-domains = <&cpg_clocks>; > }; > > - thermal@e61f0000 { > - compatible = "renesas,thermal-r8a7790", "renesas,rcar-thermal"; > + thermal: thermal@e61f0000 { > + compatible = "renesas,thermal-r8a7790", > + "renesas,rcar-gen2-thermal", > + "renesas,rcar-thermal"; > reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>; > interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>; > clocks = <&mstp5_clks R8A7790_CLK_THERMAL>; > power-domains = <&cpg_clocks>; > + #thermal-sensor-cells = <0>; > }; > > timer { >