From patchwork Mon Dec 7 07:44:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7781231 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 86C829F350 for ; Mon, 7 Dec 2015 07:44:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A08C20380 for ; Mon, 7 Dec 2015 07:44:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55D522034F for ; Mon, 7 Dec 2015 07:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754988AbbLGHoe (ORCPT ); Mon, 7 Dec 2015 02:44:34 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:57652 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754942AbbLGHoa (ORCPT ); Mon, 7 Dec 2015 02:44:30 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 07 Dec 2015 16:44:29 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 293984D784; Mon, 7 Dec 2015 16:44:29 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 12F948002E; Mon, 7 Dec 2015 16:44:29 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 0D6D08002D; Mon, 7 Dec 2015 16:44:29 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id SAS15830; Mon, 7 Dec 2015 16:44:29 +0900 X-IronPort-AV: E=Sophos;i="5.20,393,1444662000"; d="scan'";a="200013718" Received: from mail-pu1apc01lp0015.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.15]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 07 Dec 2015 16:44:27 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HKXPR06MB1015.apcprd06.prod.outlook.com (10.161.180.156) with Microsoft SMTP Server (TLS) id 15.1.337.19; Mon, 7 Dec 2015 07:44:26 +0000 Message-ID: <87poyi66yt.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/8 v3] 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 , Geert Uytterhoeven CC: Magnus , , , , "devicetree@vger.kernel.org" In-Reply-To: <87y4d6672t.wl%kuninori.morimoto.gx@renesas.com> References: <87y4d6672t.wl%kuninori.morimoto.gx@renesas.com> Date: Mon, 7 Dec 2015 07:44:26 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0018.apcprd06.prod.outlook.com (25.164.91.28) To HKXPR06MB1015.apcprd06.prod.outlook.com (25.161.180.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1015; 2:yCS05x8y+Ps+3QWYg95FsH/155IaWJRBJRxgnHY5brAd3tEuTQUQP/quCxHJaNk/aHQCprG37Fozx5wT8w5JnAcdM1cXSFk/RuBO05wlMAdoGuLIzX0k9Svd4mbOsBglq+Pe1r+cBjqUFHBaQR1yhA==; 3:mzFxXM0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HayHNc6+CYA8tDS9Cr7TY1ay3YKwgWiBHcsMVKNgvi4ske7xOz4uFys11v8b1LXEu3Hm4kh4u6zn7GCwXIpSOZepmfqnrMiazQv0bQtPZdltvgqQDvl1zT85egZH1n7OyO9bYFReRE4QHZV/D97sEYHdAcHRVhxzy/1dfN+a78T/YAYJSxPv/IVXsCiq3n/qyCHZzumVVPWddw8dYEPjdcAuGCOFjaDZNov4In7vRR4EoJ0Sf5QrDrJ9loyv652HJFIO9ZHecxcU35WYGS4BZ0QS4I3I6mK7EEITSafUnD9PHcx9RK00HzQ5Cksk4E/iC3uliWWM/cUCadvfgyV9oXcfLtz5ZS9sseaQmqWcaAlapEsM Yq07I70NBht4hhNDLnSJH99euk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:HKXPR06MB1015; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1015; X-Forefront-PRVS: 078310077C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(43544003)(189002)(199003)(5004730100002)(46406003)(122386002)(19580395003)(40100003)(101416001)(229853001)(54356999)(69596002)(33646002)(47776003)(66066001)(5008740100001)(76176999)(86362001)(50466002)(575784001)(586003)(23726003)(106356001)(87976001)(1096002)(6116002)(3846002)(83506001)(105586002)(19580405001)(53416004)(42186005)(50986999)(92566002)(77096005)(189998001)(5001770100001)(97736004)(36756003)(2950100001)(81156007)(4001350100001)(5001960100002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1015; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1015; 23:b/zIslaUnFGXyn19J8geT06cFnLBO5QzfYuhkAz60?= =?us-ascii?Q?Sele2u1/BPnc33M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ii?Q?nZBdjvEZs9Oslx6mSKucOLpgOxIDKwfWWwYOH5Hp79vjcoBW4f32o2/EDWjb?= =?us-ascii?Q?k+3J7eErmQsbiuWSsCVCdFLfkIbCJYpIzRgKh5YPEmvtvpnlKOkPY6OyMQcV?= =?us-ascii?Q?dMbBm+XUHy7OorfaUvLJ9ulAhA9P8YN6Zx57ICLklVpMIqyktJMJPc1yaU9d?= =?us-ascii?Q?fM9rpYGr2dKox5znutBknNw02wab0ovBdzCyDeVgfQjJbcvm3PdJw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1015; 5:BAZ0RcZR9ZSc4loVwrQbfos90+XPg+njMuGBqn2V+FtU16tdIs9gzichDZ7EQCR6dh85fNNbXyQguyCPz5BCOf0u5hjPFymdsZnL2Sm8PLggE2MwAUzM6Oh2ZIzxLqjGN8S3zHOHZ+YDMx4F0tNpmw==; 24:Cp1pPxtfriNKjgZwcx+v6BKWRGE0Q+xDfGvfT9iOHFz0tiBpyvhCiAO3HL8vOfTb+SpHNG/I5hPoFEKRE0j7ahY9orwCc67kh8vHyUGYJQ0=; 20:gB8FgwWFTzyyf/gxQzbj5K3ImZrDk1lnLSHp3WRoP9vzZ86ZxTXV1LHKmWkZswMiY1bvUoig8+T/puKsNKJ0FwcabVbYfWUINapowhSyxUwcKQZzx09ijuHA9HxU5RJSPzuLMkVSmqWO2Cz/7pjIeRFCKfMVIHbjtzY3h4dM8lU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2015 07:44:26.3802 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1015 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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] 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/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>; + 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 {