From patchwork Fri Dec 4 03:18:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7765261 X-Patchwork-Delegate: horms@verge.net.au 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 AE9E29F7B5 for ; Fri, 4 Dec 2015 03:18:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDF50204D2 for ; Fri, 4 Dec 2015 03:18:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D661820454 for ; Fri, 4 Dec 2015 03:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755293AbbLDDSe (ORCPT ); Thu, 3 Dec 2015 22:18:34 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:43566 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755291AbbLDDSd (ORCPT ); Thu, 3 Dec 2015 22:18:33 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 04 Dec 2015 12:18:31 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 94AF44880B; Fri, 4 Dec 2015 12:18:31 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 8F9E52806E; Fri, 4 Dec 2015 12:18:31 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 88F3F2806D; Fri, 4 Dec 2015 12:18:31 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id NAA27373; Fri, 4 Dec 2015 12:18:31 +0900 X-IronPort-AV: E=Sophos;i="5.20,378,1444662000"; d="scan'";a="199869538" Received: from mail-hk2apc01lp0209.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.209]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Dec 2015 12:18:30 +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 HKXPR06MB1016.apcprd06.prod.outlook.com (10.161.181.156) with Microsoft SMTP Server (TLS) id 15.1.331.20; Fri, 4 Dec 2015 03:18:28 +0000 Message-ID: <87vb8egaz9.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/4] ARM: shmobile: r8a7791: enable to use thermal-zone User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Simon , Zhang Rui , Eduardo Valentin CC: Magnus , , , In-Reply-To: <871tb2hpn2.wl%kuninori.morimoto.gx@renesas.com> References: <871tb2hpn2.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 4 Dec 2015 03:18:28 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HKXPR03CA0054.apcprd03.prod.outlook.com (10.141.129.44) To HKXPR06MB1016.apcprd06.prod.outlook.com (25.161.181.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 2:G00GtHEOCJqyBiKjjX29tVFyin2uP/JfQwJkJy3AzRl7koreYCeXI4NTygMOTI8Bt7Eu1JBIbR4XQQUju9oGc9eAaEOXMZQOgsUVQzH64b+sWbC2/ezz+ebbI/oIV31ypuFd/cBxTf6X50HgmI/ORA==; 3:/xAIaVObq09W8K5+qMF+IdT40k8kXtJXK7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D4v+AXPLsjNp+DUkP5tDdPHEpVI7sP0NJViZAMcWnATKqSMOtMIt4Lp5AKvmjoyI80gssZenYiFbXleCOYANmJwADlgxr9tzFWhoq3RiugoU4hk/o9wEY3PR/SRkc29fs6u3ur/CIHZHwjsavwhgMKNKqQ8KJN/I5tOwVzcPfrubEEmFKx3w7OIRbzn09TNKfjXZMtsMGOx/+wk86me3vekLFnUdlV17SUFYiFTJ0Da5m9D1XIqotBwcHc8UFoxk8jeHkd/qGyC6hqS1fQUP+9f2yn+Qw3Y60V2QEr8yHaaIcvo/R7dx0cPqb7GKUgRliOeHm51mc/kon5CytCBIPxKY +ntRFyAZ4U0viP2OrHA4P5o3Nq 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:HKXPR06MB1016; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1016; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(43544003)(189002)(199003)(33646002)(69596002)(106356001)(83506001)(19580405001)(40100003)(19580395003)(77096005)(229853001)(53416004)(86362001)(42186005)(586003)(92566002)(36756003)(46406003)(105586002)(5004730100002)(81156007)(4001350100001)(6116002)(97736004)(1096002)(5001770100001)(66066001)(76176999)(50986999)(54356999)(50466002)(2950100001)(3846002)(23726003)(47776003)(101416001)(189998001)(87976001)(5008740100001)(122386002)(5001960100002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1016; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1016; 23:s7W9J1Vz3mPlH21t0PEfzD5u5/J8AlW05u61uK8tX?= =?us-ascii?Q?U82vwz6AB9BsVju5uQWZit1frHfKcjRk47b6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DzRpJ+nPWJiK99UwuVrji4mS54BTi5qbfKFY8b4Ko/KA6H2E?= =?us-ascii?Q?Lv2EAfP2vfP9mdnl8rKEuevnXw0DEuMtTruZdILQZ7hTJJwhaYYkC3h2SUiR?= =?us-ascii?Q?kMKsurV9T2+QqGIHK1I9bJ/Vq9NXVECZs7vlJ2AMcT+qbDr6PW3Ec9FCCrtp?= =?us-ascii?Q?gekvp4hkmZMQWNyAbOmUItCliud7GO5?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 5:uQD+1f96gvdNMyvISfeSXyU1Zed1mimNEVdKTCO71FWooH3mwqWL//jFhKUBugNSR6WuiGYBifGNa/JwozTbZ080weCifN4mY/Qb70uSE8vs7xelk/iWSd0xMOr2VlrEKXF/AOQwM75l+M4fYKTX9Q==; 24:pyQDX+aagQ2S11UlHysGI6pw3TN9L3jQ/e8qW2/PyL2Zqln6imd9bgpoALII0pESmSMRQfXfzL/mY0+9ldtvYlhF3LpCFot97HoWYOGIqlg=; 20:quKoqeNbpDIryJltvpOq9LsHA1gqW9zmGgzSaOehU5avm+k+NJxTXmekYmufA4HTtiT5bM4jJlXdUwuAuamk4ohS/YdHYNm/x/aU7+pgf2qh4YCxXQDOxQ01I9VuzEWi9y+kmkjZNQj+GjvhkvNDH1fKPteOZ0hJPieHDATWTaU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 03:18:28.4754 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1016 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 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 --- 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..2fff856 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-thermal-gen2", + "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 {