From patchwork Thu Jan 28 02:45:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8145791 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 6881B9F818 for ; Thu, 28 Jan 2016 02:45:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4B4120303 for ; Thu, 28 Jan 2016 02:45:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6C5E202FE for ; Thu, 28 Jan 2016 02:45:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967491AbcA1Cpl (ORCPT ); Wed, 27 Jan 2016 21:45:41 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:22983 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965155AbcA1Cpk (ORCPT ); Wed, 27 Jan 2016 21:45:40 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 28 Jan 2016 11:45:38 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 3C59E5FDFD; Thu, 28 Jan 2016 11:45:38 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 23C1E1806F; Thu, 28 Jan 2016 11:45:38 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 1C6481800A; Thu, 28 Jan 2016 11:45:38 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id MAT29530; Thu, 28 Jan 2016 11:45:38 +0900 X-IronPort-AV: E=Sophos;i="5.22,356,1449500400"; d="scan'";a="203170189" Received: from mail-pu1apc01lp0017.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.17]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 28 Jan 2016 11:45:36 +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.390.13; Thu, 28 Jan 2016 02:45:34 +0000 Message-ID: <8760ye2zo3.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/4][RESEND] ARM: shmobile: r8a7790: enable to use thermal-zone User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Eduardo Valentin , Zhang Rui CC: Linux-Renesas , Wolfram Sang , Simon , Magnus , Linux-Kernel In-Reply-To: <878u3a2zqt.wl%kuninori.morimoto.gx@renesas.com> References: <878u3a2zqt.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 28 Jan 2016 02:45:34 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0009.jpnprd01.prod.outlook.com (25.161.225.147) To HKXPR06MB1016.apcprd06.prod.outlook.com (25.161.181.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 2:pMQ8S647C//Je8HS63yQ4Ef4Vj7Fb9ItqSfsVs5CH4IV2XDZcd9C/pMZNnhMjGh94xN5x4aYcerKBNRfC/LLh6g8oQH4X7ttMiEryGgoEoYDu0eELjHyDjUGisvth4mcPVrnK55da+1i7liDDfXj/w==; 3:S1TPaOAe2r+9FCYY57oY3gl3wVN4HoERS6Me0Y8j45JEmiGm2y7MJDmc0k3BOwOe8GS/uO1LBrRkH1MebX+CqgPdz43rcLgIErITTeH/3hWRTv6SpQjvo9kKV7LTABQZ; 25:3S6BvjYI1EZdsLYOmDUbiKwHTg6gECNU3EzxLwQRvN7mMLz/EpsbxM4FrwmXHjYe9o8/vwreR2hLXbrM5JkAUXkZi3YiVOaqaLnkxlHIFixzeLpWzBHCGxq/YukaFUrCb8jVPcd4myMbmH9I1IURJpaGvGx6s5VF+oE0Aj8LOxt7qKarActYetHBnVvL0+/Fx4PLzzS4ED0Q2doPINTMykb7mdUBsLrVmLk1E7657/gZWNCufdcwkOPppAXBnYHl X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1016; X-MS-Office365-Filtering-Correlation-Id: 268c5f00-4d19-4c10-c762-08d3278d1927 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 20:pNMttsqQsgZEo7dFDrkPwkpL286cas/n5gm3zr0lGtCk327mD5oTKr4U/IgRKa5VMEn/nT58CIDYh0ovlavNPpUYAE7dZDMLWxwpGdUuXutNfQO7AJUrILq9Fefo+2DtI3z12ODExQGV67zU58QEfB4sCqOhuRfy4ew2pG8oiMkzygaQtfj4RGdyXEoOIYxOV2EplTIIclKmOMPG26/ghpf8fHWTXIAaGmJHNEQUMpn8vfAHn93LIzNAN5V+6gOWDX7ccVf2jYbjSSotaApRx98XvsCO9pRx+7d3nP78Wpws49rdHaoZ0wJjhKcFrcBfBerU2MqWWhVvKNnwRR5CwECH4S6BUe6qQtGOnIwvFP1mEgX3odxRhG8gJ95hcahR/0qLdRLvSvhhv5EQeaVi6Ysj2kiEK2KbeHa7t4BncjMTTYI8fDk1JahdACbW6xhATdHccgiRBWdw5kY0Zhze1koIgYOJRDpckF0omLtKRH95Iu1hq02VZqaPbMedYWCR; 4:PyihbRz9I/Nvjsnfg2yeb+sW7tI1CfOaaXVee16lCVeQm+aZ1lRDLsgIQevM9q3r7SCu9vZ3v6xv9e+OR/ujh7kO6kv1HgEaor8j6c7sUvqeTEH2ZL7BImbDKG8RcfubUInM+EgI/Qr9NyS/ZbpdCbhe27ymKLiuUKRPOcpAkjDXfWh+tK73kGuuiQljNbmFHiO5eerUlNn1bYCK2+n5r58PmSzlw56ZQSfj1G7deRM6E9uVJnyyy8zqppK16Qq2tfzLCgp4AoKrcdalnOdUswssLUp58ovr5eTVrZbRaojNFJuVqNOTNIE9NzVgiehyW+TXWU9t/ootCSWApc0OjtJYeXwdGbA/+m5TKcY7F9nhOYNQnwq3ofQ+lDFRgctvMlxjnM4yO9A8sRp6bDZJZfxpm00bdAuS6COS7r RZfHw= 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)(5005006)(3002001)(10201501046); SRVR:HKXPR06MB1016; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1016; X-Forefront-PRVS: 083526BF8A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(43544003)(199003)(4326007)(19580405001)(122386002)(83506001)(53416004)(50466002)(36756003)(92566002)(40100003)(86362001)(87976001)(33646002)(2906002)(3470700001)(46406003)(42186005)(5004730100002)(3846002)(77096005)(5001770100001)(69596002)(1096002)(23726003)(54356999)(5001960100002)(6116002)(2950100001)(47776003)(189998001)(81156007)(76176999)(4001350100001)(19580395003)(97736004)(106356001)(50986999)(105586002)(66066001)(5008740100001)(229853001)(101416001)(586003); 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:IfN63uU9Kof8u7/NuVQNTfld+QvW/YGKj74rUjU+V?= =?us-ascii?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2U8yUpZB2e2yiBv6EQ4p?= =?us-ascii?Q?BO60lfJx7uxfeJ5u3cq/hEV0GEaexnA+eeXqsfNnafPI+Z8K689W5dfOHzzM?= =?us-ascii?Q?eImIkpU43W1JjpO3TPzDc/mw1q4pGaRp+pgDbKLIzWLA9x+kpQ+IPM7uuaYj?= =?us-ascii?Q?d+HgnkeRH6UIe2kynr0xo2cX4AQWIzPokHCyp4zv2zqeRTAuyKAE909/wpn5?= =?us-ascii?Q?Cjdi57sOBqFmiUfh8uk99UbIA9mBYgbexcCWNHYsqpIuxOLIyDS8GAdADreJ?= =?us-ascii?Q?Y8PN5tRWfzW4wIn/5zj7kfSqzlvFznrYjv3?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 5:8vyodyK8UQR8XkJCsopK2dBFg0xquayRub/jnrEwy8IQqen4iIeMdDf3sv4PXattmU/ZnRxWLs+L60dU5CxC1aVHHzYFXYFBDQ9UbG6s5QIkcSqCgtTwBw6sJVugfnXA9gFLKZCHr4uKytSyMgIZ2A==; 24:8ho/YFSAVlHJ+iDv+q4RYKFl/Lu2u1nGPYYi9VKH648WkIs1lpwt8BS8jKR7C7HexLoXosqw6EQnPG8IEjRCcxxizkzjjRZdkQfheJPLMN0=; 20:We/f+bhlauLFjLve82JI7Jja+LQV1m0rjzTkSWd0IK+K90LXSLhG2Df+TsulR5ylsey+OAY9Q0S0H6hpbu4k8oxYm3IyrWrOUUfAWbE0gskYbqbSjG2GJxjH4OkBZTlea/GuW5/M6/C25wT/sPFXAZh6zJe+urVTe8E+9MaS+u4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2016 02:45:34.7937 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1016 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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 --- 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 7dfd393..d371660 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 {