From patchwork Wed Jan 20 05:57:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8068471 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 2D222BEEE5 for ; Wed, 20 Jan 2016 05:57:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EAA7202FF for ; Wed, 20 Jan 2016 05:57:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 675052034A for ; Wed, 20 Jan 2016 05:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757803AbcATF5m (ORCPT ); Wed, 20 Jan 2016 00:57:42 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:37991 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757745AbcATF5l (ORCPT ); Wed, 20 Jan 2016 00:57:41 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 20 Jan 2016 14:57:39 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id D773F45830; Wed, 20 Jan 2016 14:57:39 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id B8759480A3; Wed, 20 Jan 2016 14:57:39 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id B16FB48014; Wed, 20 Jan 2016 14:57:39 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id QBE08297; Wed, 20 Jan 2016 14:57:39 +0900 X-IronPort-AV: E=Sophos;i="5.22,319,1449500400"; d="scan'";a="203877957" Received: from mail-pu1apc01lp0019.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.19]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 Jan 2016 14:57:38 +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 SIXPR06MB1024.apcprd06.prod.outlook.com (10.160.242.28) with Microsoft SMTP Server (TLS) id 15.1.365.19; Wed, 20 Jan 2016 05:57:36 +0000 Message-ID: <87ziw03ifb.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/4] ARM: shmobile: r8a7791: enable to use thermal-zone To: Eduardo Valentin CC: Zhang Rui , Simon , Magnus , Linux-Kernel , In-Reply-To: <874me84x3p.wl%kuninori.morimoto.gx@renesas.com> References: <874me84x3p.wl%kuninori.morimoto.gx@renesas.com> User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 20 Jan 2016 05:57:36 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0027.apcprd06.prod.outlook.com (25.164.91.37) To SIXPR06MB1024.apcprd06.prod.outlook.com (25.160.242.28) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1024; 2:IsO9SR6I2ANCZXLqU7Und1DwZ+TeF6bCx54u2JA1a1nLlgrG8NcuTE89tK/ELyYLWYeY7m5rYrkqCHol65XH304mOmHIjRrMZDqF2WvkWmPSfGdyUP27pTYpDv3k1i/0nM+zoBCuzjddKfh20i1kKg==; 3:3/y5BkZ0kvw0wLBTCx3DY0PRadxxGBpcmi5crZv+39sh7tL248RzbpGInyp9GidWJzajlSYTTSdOg2/RgXew5hpZXE3l9LE9MnXwVTQX/25XFYYyir3vvH03IAvppxmF; 25:ZearGIJDT+i+WX8RZ1jpyzFw+nlkQNtUc5gKbFMUHKV6I6p8EmumVdqLto2ubZmIxr2r5mhN0/oVv5W+2kPstxOLLVEg+4baLzPDmrf6uPiOiaSyQsgn3udU1kdZytd2qIgZ3dblTn1KHI0QFIgFwhPBEg6YNhKY/AUJrk1QAlWWHI4qbpGLbN+/asYaww/2rK3q0Q59pcJ1gjJNgFbcz5Osoqplltow4QgorvyL7AwaeU77gBbMlMBA4Ubg5leo X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB1024; X-MS-Office365-Filtering-Correlation-Id: 861fed20-b155-40cf-5cee-08d3215e998d X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1024; 20:g2qAHvW6cgGDQsLKCwIULWdQ+OOXwi/8VvP4xHOlZ1k7rHwCuFd6yVg4bk+ZrLOKxyoAo/Gkqrdf+GG+jCIjwAYpIdK0sZgL0qkCWkbx8U9v9nhzeqkhRRLiSdMuKxjPD4RTFaa7UpIJw+42ucg8OpW79c6/h1s1rQNPgc6eK6ZWB1B+oktyyYadLjCEogZ59IJyeZDeMvukHqGRLv+yQew21lCa2cyfdtVV2/DD1m2dFtMaIP2IOSa9m1riYi/UrGmwgJLdyPIG0OR/yin+4+Bn3ahWEVeJfA5+hC7pWeS+gD2AwmgLKIHdm6oYu9zVxjRffVW0gtAPtQU49UdYt415xJ8yhZVm6sI+P5bCfnDxeHGjniQEMrbQRbtj4l5+6wHNGj2sn7l8OWFUtMvsZ27d7cdWfdiYwu1jhA6szNncmSM/96PtidPEo5SPOiS4+YxH47sBBSwTI106OtsKGyvN1dZtlWBG2nNCZ24eJlXDuw/5IM6zDFB+KZrbHdv2; 4:ahV+B0CKEGUIFJc4wMZ0lHKAfy4zcc9x0W0g63X0rvDVebt+EueRogZAg2JLRo0rtDncla7EwSKrjkmpyNhytHlQeKb3LprPsdgUI5u0xpV7DBjhtxK7/aqWdARs/oVGjCwcUTq247wOJaA5XEV24Z7mt/iGsWKL/EkETNP/UtKVHCYf977N/a1mluX2Uyn6qed3DbZq7ulERXD6kdykhvtaox0LZCoPAoU/RXsrzEelS8aUyUx1ODZlaATZLUvJ3JVh/HKPSwXMZKOP8mIPuwCebl74mCCcBA+5mQO42EN66XYcvB/iJFfDSt2MCD8f2BshIsqQQ/18hh/aMF4udFwcGx2zDDXXH9fB4PLLTupMzJlFbQV5HX0WUm6lMok3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(3002001)(10201501046); SRVR:SIXPR06MB1024; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB1024; X-Forefront-PRVS: 0827D7ACB9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(43544003)(86362001)(50466002)(1411001)(23726003)(2950100001)(5004730100002)(69596002)(101416001)(5001960100002)(229853001)(2906002)(47776003)(77096005)(19580405001)(5008740100001)(83506001)(110136002)(106356001)(36756003)(46406003)(19580395003)(87976001)(53416004)(1096002)(122386002)(50986999)(42186005)(92566002)(6116002)(76176999)(33646002)(189998001)(3846002)(40100003)(81156007)(4001350100001)(105586002)(4326007)(97736004)(54356999)(586003)(66066001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB1024; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB1024; 23:dgZ2SZOdfmLiUJAQF0GaCjjKCTxe9XdvsG9uQskiM?= =?us-ascii?Q?pYsa45C7KQL/vhrkBxnoOkxfMcLS3DzK0snwMjGrwFKEbLbQlx6L1ACOBQhj?= =?us-ascii?Q?QAE4b1UIEwTHS6YBXTekFI465aF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-ascii?Q?2VpW58kCz7qDhLSBOXUJZN91X6exCqFhi3ZfVlldiqEG0tvUtZuwb6Xkmn9d?= =?us-ascii?Q?rkkQK/6M0ZyhPCyTHpReXn7/Sn11lxmy/35jtUejDVTtyyqk1bFSZK3Kpkis?= =?us-ascii?Q?Q4JqO4t9CsRBpGZCISQ21zIkqlCY9JOSZEPCq7MtRAxNG7jmbCM9SiDXHA2A?= =?us-ascii?Q?kQ0qkrVTcNExHs=3D?= X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1024; 5:Gy8jcYcuFQzzshVttnw1hWUByK5tUGAR7+VIYXZpADYMKqEXg1Fm49K/0cAxNd7C/JCy/nWGpins1SEkpWFrHAoxGegaTNmtFqC2lzvgkK0FgS/LM8Fh+A35A+48CTMGCzeeiEMyesMGnfTIJJsVbQ==; 24:+7I91UmainTC9vwPZSYDdGPFJ9sd+tFHlCfbViC+3t8UvjS+T1tnwZ57ZdgUqgAa3i0/yk66MSb2SYf8+JS6pXvsTFY6B3yeCg4VcNbuN+8=; 20:HXgklDhbG8i4ZGsJRXoDI6hU75ELSqlD3tc5RlxWowMkAzVxmXL7z/owvH4UTIq7x2fpC6liOZYGcy+fbeetUO83KEV8QqxwNQDR2I9HMF2qcps3sFp7jn4Mj6LUqBkEva5YW+0CvA0Dz5hwaDeLNUQg9EmTF/zEY3iQ6+yeSEk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2016 05:57:36.8692 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1024 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, 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 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/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 9176e45..793abd6 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 = <115000>; + 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 {