Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933188AbbLOBTH (ORCPT ); Mon, 14 Dec 2015 20:19:07 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:62057 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933085AbbLOBTD (ORCPT ); Mon, 14 Dec 2015 20:19:03 -0500 X-IronPort-AV: E=Sophos;i="5.20,429,1444662000"; d="scan'";a="201809492" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <874mfkqzok.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/8 v5] ARM: shmobile: r8a7790: enable to use thermal-zone User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Simon , Zhang Rui , Eduardo Valentin CC: Geert Uytterhoeven , Magnus , , , , "devicetree@vger.kernel.org" In-Reply-To: <87d1u8qzsy.wl%kuninori.morimoto.gx@renesas.com> References: <87d1u8qzsy.wl%kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset="US-ASCII" Date: Tue, 15 Dec 2015 01:18:59 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0012.jpnprd01.prod.outlook.com (25.161.24.22) To HK2PR06MB1011.apcprd06.prod.outlook.com (25.161.187.28) X-Microsoft-Exchange-Diagnostics: 1;HK2PR06MB1011;2:DDSG0uH5s4oNrGr+fBJn8BPFc43/YFmxLMDi5i9cMV5iyWwxliReuE0t2ArpqQ1gy4U1MfbaSxDXFSZQqkKUBcaTfFkGy9IEgZmBEJ8xWr8YV1/NJ+hIdshomX9fvEnW1Ehlv9lTUjEQXXCaRVnfUQ==;3:Qgmq0p80B1w+sqqE024CIqew9i+5pBoX7PDiL93V1w562KEMqNbWVzILQb/SxUcSH+OebNR4wvQsy2sbywMB0lHIbZu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2Kni/+JzMYav7EYk3WiLVpBCDhOcQmn++DrnyqT8k1DFeyGR1iBT59ia3HyU203zZ8dJs0uOeFwKA2WFq9cb85kZZ3vNXg68rOfH1GPoWVo64sQGPUyZ1lyHXIGs5u1BUUjsFjcGT17BTa9mT+zyMOHCyaxvGVCtIUfZ57u+aefQcHRkKZJw+Hcn56BIC6aiFoXzXbLDVtfnbELBbG2fQAKmGTBo5nIozVPz5DI5GPm9srS/7UIYqZR8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046);SRVR:HK2PR06MB1011;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1011; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(43544003)(189002)(2950100001)(36756003)(105586002)(19580405001)(6116002)(76176999)(53416004)(54356999)(50986999)(86362001)(87976001)(586003)(106356001)(101416001)(47776003)(42186005)(33646002)(92566002)(69596002)(81156007)(40100003)(23726003)(77096005)(66066001)(5001770100001)(5008740100001)(5004730100002)(3846002)(46406003)(1096002)(97736004)(50466002)(189998001)(5001960100002)(229853001)(83506001)(4001350100001)(19580395003)(122386002);DIR:OUT;SFP:1102;SCL:1;SRVR:HK2PR06MB1011;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HK2PR06MB1011;23:y6PWW+tDctffOKh2YYw5jQ1f4ydj1/sK12Bo6BE9K?= =?us-ascii?Q?Krc86bVNXeQzamRap73YN9WNuV2xsG30c9wtCx0eBQrPfnq5cv/hwc9iW/3k?= =?us-ascii?Q?tQMJ/Gt9+dURGELXohz7+yoSy2Zs/UgmIO+HJclrxqhOrZNtPzdvR5bTfFeB?= =?us-ascii?Q?3Us0Mx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hBMb?= =?us-ascii?Q?IDnZ+X1coouvM0jwLDfjs52auD8p7zdGP3I8ErDlvt88Y58Tm7nLpKTgHB+J?= =?us-ascii?Q?ZikMjjdOY/mw48B0lLNhiTVpoU/iJx+?= X-Microsoft-Exchange-Diagnostics: 1;HK2PR06MB1011;5:ClB6pKAT/sFAFLPXA/9hmx/WvpOgTcOFOdZmxCymdr+nqjYNYXcjs/kSnOBXQgX3TuD3u6tADwFzD+OkWOmn80DmmkrEkKngPIpmlHq53INw+PrqVXwSj4e/roZwJaVS+tkpnTDZc5giRFNS0CgqJQ==;24:pYEjDUH5uFhGi6/BQv2r+Q9mXkevQ+yK0R649lzpBLrWZRMLCAbIVts44AwZx8x+zAEpqDkpmMirs0cqkk+pvu3FEjv696QudKl8jg5vm8c=;20:0eL55VjGxd6eXcYPGwbvLRExtft5ehDAQqe3/QUJTCaJ9ESEprSIdbKa5HzaSdV1o4dqRvCteryJqNVX0R3HDPQhxG7OQPUzqnW2m/kfC+vTjKjDq6bTDVCqafVR0a3Mle2r2cLeo1BqnU+q41fqAuQRS4O3wKjuoJlD5a74Zj8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2015 01:18:59.3127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1011 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2390 Lines: 84 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 modifying 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 reaches to the value. echo $temp > /sys/class/thermal/thermal_zone0/trip_point_0_temp Signed-off-by: Kuninori Morimoto --- v4 -> v5 - no change 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 9f3036b..2203b97 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 = <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 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/