From patchwork Thu Jan 28 02:46:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8145831 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 AA1139F818 for ; Thu, 28 Jan 2016 02:46:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4F6A202FE for ; Thu, 28 Jan 2016 02:46:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23BED202DD for ; Thu, 28 Jan 2016 02:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967784AbcA1Cq1 (ORCPT ); Wed, 27 Jan 2016 21:46:27 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:21972 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965155AbcA1Cq0 (ORCPT ); Wed, 27 Jan 2016 21:46:26 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 28 Jan 2016 11:46:24 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 113074B05A; Thu, 28 Jan 2016 11:46:25 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id EC6308002D; Thu, 28 Jan 2016 11:46:24 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id E21808002F; Thu, 28 Jan 2016 11:46:24 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id MAM12845; Thu, 28 Jan 2016 11:46:24 +0900 X-IronPort-AV: E=Sophos;i="5.22,356,1449500400"; d="scan'";a="204429999" 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; 28 Jan 2016 11:46:23 +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:46:22 +0000 Message-ID: <8737ti2zmo.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/4][RESEND] ARM: shmobile: r8a7793: 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:46:22 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR06CA0022.apcprd06.prod.outlook.com (25.164.91.32) To HKXPR06MB1016.apcprd06.prod.outlook.com (25.161.181.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 2:nPaZa+HDpJjT3vRfh7fSuWKnUpbdVbZWOrfLDDdqoVWk1lK7wLlRigJgz6UBLsYktO6KE5zaXQxgYzfO+KSJtQvcziQGM0bP8NjWxwHS6a/ynv5Y2Qj48VHr/wSa6jmyHpR8lbCGBgCvqtMpxz4soA==; 3:clLgsk/qVTo4UTwN2yZk+vcxNAZPUg6dGWx8Yvbeex+69Nr4lcW2lUll7GifICvy0vmyaMjgxM0Sgh1VpcpqNXdgFl4A7AHOCzMKvNBPdFyG7b+AcYDkeKus6CumndYB; 25:WGjBLAG1DW789WiTDN1mnasGR9ma5SH48sEKYLgtdhpPx4p42Di9fLnCjRJ/RVNKAl8FOyOJbvABm7M6Vgi0/TEM9X/hZJDpaiG2PersCw0IujyMOvTD7xZJ3JBjAtI2rMQLWfte4EEfxPSAV6q3NjbNIaTLoViMSXRQ6Lp3oP3/88YBaTnuOo3S4Z6oSH+meOj+FJRDRP5fXlEH45hsafml63DN9KuBDBsECgS2Bkb/o+skVnMRA/l1xB/ADX2x X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1016; X-MS-Office365-Filtering-Correlation-Id: 1a2364f0-4585-436a-b895-08d3278d3564 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 20:4XT6CYSUWIXnScnwXt0eR3V1U/AUnZQ/oXOiaAQ+fTPV81ZdjWImE7jX9DbQvUoJ8MsuXkILsUmiLRaW4yoY7jX49AWt0BEPPoE/alr7BDXM89/n/1vgsZND5TetaBOTgkW2lwUP2NRTK9XmpCGxLJIHuW4tgRoLGpUebGg65yyF3DsPUiiRP6DEPAkeeJc0XEYXVyOK5U14ek3bIO6+GWCcUo2rpH6Z8GCOlDXq9Ivz3pV0rwKSqb2mOh92juNBpwqW3c14RAuoRDB7THssnv9J5fnK8Uba52f4RBVLdoUJGS4JpEnkkGBVsrcZ2tltgyCInt8y2gdoV7yHKtA69erT7SoDnNJjVCaUvy2bmaW8mqj98CJ3gNHjFIP/RQYWySNADEFFfRV3O3xVJAzMgHHnuOXwlg3Ec+yUTC9DZ/SzRJbnNr/jT8/MTUNvBkSuFTqKGVFsm1k2mLiwafeR0KzMAp++3qldppLAt8Gcw9eucoZDxrfANCTffIekBCV1; 4:PdLdJlhxYAvjU0GYQrtYaxiiRh5j8LFCEJ0ndFQE3MeYdIxVM0DFosELQovIirdxFgGTXbWVkfJpr/D5mOjAES4ytfwUbzcR2JGazecFiVU7fzaB/RAufIQ1NI7sxDfa3I1aFunQ0FHH2CxMWpC9u6BXRKdihVGDwyWaNvo2eHJGt3ZO/QATgI5ya1XO93M2xWMwmj0i28fi4dY/ebgrt7HxqC6CM25EZuDCcKDEPl3FVRg8MlR2VMVuUPLXj9hktSvNMPJ8HFvmJPs4U7USWctRJtf37JljNjez7zNuuqKrveADFypbC5eUChXrN2N4o6gKG50kLwTYIWxlpyq0mMIFLiAMbv3NpichCXETFY+ZyW+vccBX0Fj3IhQF7d7G0iyoyj7b8TcY1hGIDqhHu5wFSW8+0xbbEEjR7f hoqd0= 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:khrkHI15m+2TWhTHSTjKPf01QLcCo7f5v8KWnvxSA?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CtTObtWItFn2rgJ3PIlNi4Nd?= =?us-ascii?Q?+2Pzm7vQAvMx6JolSr7XAnhFUqEPa/upVCmhefbNUe2SHbAL/SSCSiGMLfk6?= =?us-ascii?Q?USK9025nNRv8GVohfN5dLW791AdfYOxvSnJou1DiHlZ7ClIBg9edQ4Du8VGh?= =?us-ascii?Q?SNiaaCZI/97TA7e879GZP4BUdP6Doh2i9aYycnRPphOoFWkdcyQVaAikRKaC?= =?us-ascii?Q?9zlRkN3IM2F5N0Nvha/vq/oK6pxQ2PMkwcKdXxtT6cyCPvHIge6yGRKh8xwI?= =?us-ascii?Q?Qi+Nprk2kFWOlfyrvrAxt48sdDuq+gRwy+z?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1016; 5:7fZ7cr9rnjuEXNZ9w0AasQkmwK021+LprMZBP+HSBBax6W48CrS+ZyYjw3gktknyQZCJRm0aIktRm2qznnoVQkecwVoStN4hu/SwKs0CYUj9HW3LQKDQBP14FAXAWJNYGA//JPlp7l62Xh6QX/Z3FQ==; 24:utWg2iGFJru2Kw3NnT1KlcEmRe5EolqTmTAse9OzSyvLfczzXPA2qwbzH6u/eGaq/7Lq0KE6v0wFSFgGnqnb3lV39UvcRpwAVDW72g95O6M=; 20:YmrTutgFViLqdTzg/zU3yi09TKIdBP/wE1mq2psbZeOKCJNR0RkpEZkjIdIh809E6uAG47fK5HDFTU0cdG34VNDuDwsqWwvav3FSea+nqnePWLcihlGV7TjwkITiymFsLwswM/GiAkPZmC/Vcefqo/OWPyFOJQmGxiV3Q7Cmx/Q= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2016 02:46:22.3255 (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 r8a7793. 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/r8a7793.dtsi | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi index aef9e69..56a459a 100644 --- a/arch/arm/boot/dts/r8a7793.dtsi +++ b/arch/arm/boot/dts/r8a7793.dtsi @@ -45,6 +45,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>; @@ -161,12 +180,15 @@ power-domains = <&cpg_clocks>; }; - thermal@e61f0000 { - compatible = "renesas,thermal-r8a7793", "renesas,rcar-thermal"; + thermal: thermal@e61f0000 { + compatible = "renesas,thermal-r8a7793", + "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 R8A7793_CLK_THERMAL>; power-domains = <&cpg_clocks>; + #thermal-sensor-cells = <0>; }; timer {