From patchwork Fri Dec 4 08:35:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7766131 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@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 69A19BEEED for ; Fri, 4 Dec 2015 08:35:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35E61204AF for ; Fri, 4 Dec 2015 08:35:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FC6C20504 for ; Fri, 4 Dec 2015 08:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755456AbbLDIfS (ORCPT ); Fri, 4 Dec 2015 03:35:18 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:25874 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755333AbbLDIfQ (ORCPT ); Fri, 4 Dec 2015 03:35:16 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 04 Dec 2015 17:35:14 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 971AF476DC; Fri, 4 Dec 2015 17:35:14 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 86D2D8002E; Fri, 4 Dec 2015 17:35:14 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 81AB08002D; Fri, 4 Dec 2015 17:35:14 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAC04086; Fri, 4 Dec 2015 17:35:14 +0900 X-IronPort-AV: E=Sophos;i="5.20,380,1444662000"; d="scan'";a="199892282" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Dec 2015 17:35:13 +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 SG2PR06MB1019.apcprd06.prod.outlook.com (10.161.9.27) with Microsoft SMTP Server (TLS) id 15.1.337.19; Fri, 4 Dec 2015 08:35:11 +0000 Message-ID: <878u5afwbg.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/8 v2] ARM: shmobile: r8a7790: 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: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> References: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 4 Dec 2015 08:35:11 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0025.jpnprd01.prod.outlook.com (25.161.74.163) To SG2PR06MB1019.apcprd06.prod.outlook.com (25.161.9.27) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1019; 2:BYE2hHwd018kmrtbzQmnfAyUow3whfMYXUQZFmNHA2TrGj+y0GmtzeD5o8N7DyfS3sdcgdhp9/01UknbU1MUNBfLho8fU187O1AKxfZOapJHuYThacFV4PbOunyA1aTxFht8RndyW4uAGl1oxKJl9A==; 3:BWpn030Q/b6bMckDLVoVjTmLNjysgHHlx30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6xjBtWRqoueRCha8of7qbnTdWKyz/O3eFO2JLXHBRZ2LMGJYzb7T0KP5abLRn8su/OZeONQ4dHUFDh9nD9ITwSVxII7rieVio0vRpS5J7sIvMABPI37pNe7qFmLPnUYoOaRxCKrwPeaBcEFoQ2/W/MXAT39Q7srhSWLolYxakXyx83bJN4CGzezLhiMO8T08e1k7P8kYARmgNjE9CMahXE1BARntHhW1xMKAN0o2ThxTHglsEMXXAE5OMaBmMKdVKmvA7TlRK/1CDqms4B6a+XiSgz7hLZ6TszpsZxsTt6Q60AvDzQaMuCkz0tJO/mp/i HXnZA= 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:SG2PR06MB1019; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1019; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(43544003)(189002)(5004730100002)(189998001)(6116002)(105586002)(77096005)(36756003)(586003)(5001770100001)(69596002)(3846002)(101416001)(50466002)(2950100001)(106356001)(42186005)(86362001)(23726003)(229853001)(53416004)(1096002)(81156007)(97736004)(575784001)(19580405001)(50986999)(122386002)(40100003)(76176999)(5008740100001)(19580395003)(92566002)(83506001)(33646002)(46406003)(5001960100002)(87976001)(47776003)(66066001)(4001350100001)(54356999); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1019; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1019; 23:zScdV96iGIvSx3fbwydsy3S+jhjDUGctNiBYExldR?= =?us-ascii?Q?blkeKkglCcWwPzyOsnBus91SY9Hf978MS8l+OqbIVHTHkIyOBzLN0wIbPhBU?= =?us-ascii?Q?8PyqC3uG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rdAOuK92X?= =?us-ascii?Q?t3IRFVaCwuq6C8MOa4DoCgcY/Z84aeuFacxoI1yq40TANVLKwkYkpczXeoUn?= =?us-ascii?Q?hVvF2Dym/wD+Hb3h41/D4ELL6yUHPhCpWmVoMBSU7miSWI0vazaEk3oGLBZV?= =?us-ascii?Q?08NvzT99oLNORAHT3yRhJ9U7Gc8yo4cfwxE6j1UBz2R6F9pzZd6Kg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1019; 5:6XcNAa2nnmcUZ0DrXQQ5+yfKWD1f4RPkrLn30PJ3om5XdQcolkQX9XoCRCWBWMAopPdQ01o+Sg4A/KcN2vZNydqfev0m9LfiOCd2UQJrDrBm/oBt0ha5RmZNvn2KSMynzZ71BYCOjqZNnWhOHj9V8Q==; 24:90W9GbWucj0iWwr6/uGJ/wBorYWxhf9V+WvbSHP+pAwFJlpqrmJpQm1PFWTdskvWCURL3Mash7Rk92GWjbM7hOcFG8KG0Zm72wm08kQKIcU=; 20:VJju5DaGj+rG/xiaVEeMvKlW010w3+kYU0xyzV0mwcd402i/BcaUdLnxCx2NToTGVsjnNSpuE8oO0kYvn11vRlVp5Z+uO12p1SXVrAK0697y9C3xrqaNvsqKUzkqTvgeVJfYA6fsItSsXcpUMmsdxNhGYVVQUQd/2ZTOE+hhr5Q= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 08:35:11.5288 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1019 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 --- v1 -> v2 - 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 6cfd0dc..bbbc3cd 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-thermal-gen2", + "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 {