From patchwork Mon Dec 7 07:44:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7781261 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35EC4BEEE1 for ; Mon, 7 Dec 2015 07:45:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3857B2038A for ; Mon, 7 Dec 2015 07:45:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36C992037C for ; Mon, 7 Dec 2015 07:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755064AbbLGHow (ORCPT ); Mon, 7 Dec 2015 02:44:52 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:48308 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753916AbbLGHos (ORCPT ); Mon, 7 Dec 2015 02:44:48 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 07 Dec 2015 16:44:47 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 191334C91D; Mon, 7 Dec 2015 16:44:47 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 02D392806E; Mon, 7 Dec 2015 16:44:46 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id EE2E42806D; Mon, 7 Dec 2015 16:44:46 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id SAN20272; Mon, 7 Dec 2015 16:44:46 +0900 X-IronPort-AV: E=Sophos;i="5.20,393,1444662000"; d="scan'";a="201249751" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 07 Dec 2015 16:44:46 +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 SG2PR06MB1018.apcprd06.prod.outlook.com (10.161.9.26) with Microsoft SMTP Server (TLS) id 15.1.337.19; Mon, 7 Dec 2015 07:44:43 +0000 Message-ID: <87oae266yc.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 7/8 v3] ARM: shmobile: r8a7791: 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:43 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HK2PR02CA0040.apcprd02.prod.outlook.com (25.163.104.178) To SG2PR06MB1018.apcprd06.prod.outlook.com (25.161.9.26) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1018; 2:AN5vls3Wqc2Qid2k3tB0EZ+Yn3DBh9VwUBkdfO70RUK6cQS35/yw5UrFeI5boIkgo6ozHjcuJsH0Q/lxAEDnPJ4xLgKS2aV72jJqyrpC5kBixRTkD6gtTzJgD8kw0gbNS4WogTVyUKwmLHPupedEOw==; 3:CeLcJRk0TCdSztUsVhizDZ/Z1Ib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QG3S++ANb+RTfP1LQ6N8RFQUl4N7ezJzsXPa147kIpEk8N6wKKCFm0uip1JIBCyovHqEpJnarw6xTK7Ef+1Q3cMMMpXn+8KVux+ZUV23kXIT7PakDvykoMarHmuZ+vTcPIIDNvQYfEpCRsWNxWNgNJCaYab366aOIulTVXbxJTjpt2Qr1LJFls+l6WjIJSml/qEyouT/tBMxu8nWGSBzJMn7OeQQXpTiC22I4BUk/SdtrcJuguvPOxayc2dhY4bKFq9HW/VCkHsL9chVoy7Vd0tvUoYlOTZr0EFJPutPacyp8onvl0co0Vau16DnU+D1ogESDLMwfZmI+8f3N NN9gblTTEaAs2gc4KCoIDHhVJ7 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:SG2PR06MB1018; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1018; X-Forefront-PRVS: 078310077C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(43544003)(199003)(189002)(5008740100001)(229853001)(1096002)(23726003)(586003)(189998001)(3846002)(46406003)(33646002)(5004730100002)(106356001)(53416004)(54356999)(50986999)(76176999)(40100003)(86362001)(42186005)(122386002)(2950100001)(83506001)(87976001)(19580405001)(6116002)(69596002)(5001770100001)(19580395003)(81156007)(105586002)(97736004)(50466002)(36756003)(5001960100002)(47776003)(92566002)(77096005)(101416001)(4001350100001)(66066001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1018; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1018; 23:quKOI/mC/QJ52Rrxedckh0bTTDS8FCcPGKV5eJPVw?= =?us-ascii?Q?u7ZwRgMrNnWUYAiPlexl+fLfYJ4lgSn5NvQbYKZ54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dJTmOE67AvApCYgHvHQeQshkew+nl4Xmi54h/kPMJgU3IbESKNKHokf6K?= =?us-ascii?Q?VtzaIfP7r1HyU+dBUJpb3JJbR9neho74v5tdsZ9ctItxz5/1dxaEWJt1hMZj?= =?us-ascii?Q?Tz+8dQdoSXIUPFoTXN6tj4dLjO/0OIU4F1+IynPtI4KaXT4t8AXGLk46TUIe?= =?us-ascii?Q?GQ+K7QcM6XzH1CY7WxrqOinIibCmUSl?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1018; 5:4pbh1aa0t670D9HqAjUN3/MgUCR281RNdlhGDDWrO/R2lRUoWYIDlfD8GUuV66JgBXcdMR7von5jjOHdOskueARtMW2lJOmPLLve1At6dP1d/u/PnQJam2mSiuT7uha8dXBxX+BNn1UfbBx6JBfUGA==; 24:KbyviBbVdn5YaYB3Nu05fEvBjAPOuv/WsnoRB9VDivfW6BrStB/Pghzr3Yy7c1G8xRPEelageRut7b+ODYCIQas+zyoq4PJ31pSvqALgZJ8=; 20:l6cCCPlr16/olCkibFqYFzuhNm/oBqNjW0UNO4o4vSlJk50sWpAxhTSsPK4MWEvmSCNSb+2bJwlQ3t3fUZ5J56WR0vZs778UQsQ8vW1aU5bxFYc9gV1FdQMznnoDYqTx+DE6iJefhKWmwK5m5GQHG6SHydWzXNMWZaYEc68Sm24= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2015 07:44:43.9096 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1018 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 r8a7791. 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/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 = <&thermal>; + + trips { + cpu-crit { + temperature = <1150000>; + hysteresis = <0>; + type = "critical"; + }; + }; + cooling-maps { + }; + }; + }; + gic: interrupt-controller@f1001000 { compatible = "arm,gic-400"; #interrupt-cells = <3>; @@ -185,12 +204,15 @@ power-domains = <&cpg_clocks>; }; - thermal@e61f0000 { - compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal"; + thermal: thermal@e61f0000 { + compatible = "renesas,thermal-r8a7791", + "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 R8A7791_CLK_THERMAL>; power-domains = <&cpg_clocks>; + #thermal-sensor-cells = <0>; }; timer {