From patchwork Fri Dec 4 03:18: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: 7765231 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 8E39CBEEE1 for ; Fri, 4 Dec 2015 03:18:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B279E20499 for ; Fri, 4 Dec 2015 03:18:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB47C20454 for ; Fri, 4 Dec 2015 03:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755205AbbLDDSS (ORCPT ); Thu, 3 Dec 2015 22:18:18 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:20067 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755193AbbLDDSQ (ORCPT ); Thu, 3 Dec 2015 22:18:16 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 04 Dec 2015 12:18:14 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id C82C146DD5; Fri, 4 Dec 2015 12:18:14 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id C3492480A4; Fri, 4 Dec 2015 12:18:14 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id B9735480A3; Fri, 4 Dec 2015 12:18:14 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id NAQ10842; Fri, 4 Dec 2015 12:18:14 +0900 X-IronPort-AV: E=Sophos;i="5.20,378,1444662000"; d="scan'";a="201104523" Received: from mail-pu1apc01lp0023.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.23]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Dec 2015 12:18: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 SG2PR06MB1020.apcprd06.prod.outlook.com (10.161.9.28) with Microsoft SMTP Server (TLS) id 15.1.337.19; Fri, 4 Dec 2015 03:18:11 +0000 Message-ID: <87wpsugazs.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/4] 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: <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:11 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0003.jpnprd01.prod.outlook.com (25.161.74.141) To SG2PR06MB1020.apcprd06.prod.outlook.com (25.161.9.28) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1020; 2:tvTCD0h526SsfM4QK5fxVd4txXN/euekJihzUOLYfWekL/TqlLX+oVxqe9zlJsatFQ2u9xu1F4RbL+h6CefT/Wz8UY3DfO0KQIg/AWbCYo63Rlhnk6IWdM/DrsOm4ZWzWT62V+E0ssi4FO+ZBrxekw==; 3:0EfQh3fS+0EWqxMZ7RENozDP1IPD3rqv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EfQOYXOlFuh3HUUi4yZctzsBE9n+FFWRBbGYnJxisLUEnAcXUqExH8jWTIoa06KM3yYlcNfjMXPTMbgqexXPjV1v352gsbndqT9tXgEdI0RNohny2cYjsX/ASUh7yTZNVcvjYGE+0Cifh/aBANcmp8D5cr/Cl0l9cz4pn/d6jI5g8H59CgwI5dv5KQy1fmCfbNYurxFiVdcxWjWtYGC1dt65lg0GhZVs8h46dCzXNpWoQz41Df3aJ/YKRGZyNI4MMVPmayds9oh0l0FSM3NAJ2NKiKKSX0IsxSTiQUPAuwqicBrVdUWPwKbbHK5yuUAuncFqKDRUEQhrDeGwQ9MSBAQaR GPopMnvgjfBDPDnXhH7hj40T35 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)(10201501046)(3002001); SRVR:SG2PR06MB1020; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1020; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(43544003)(19580395003)(46406003)(586003)(4001350100001)(23726003)(1096002)(5008740100001)(33646002)(5001770100001)(81156007)(42186005)(6116002)(97736004)(19580405001)(83506001)(40100003)(47776003)(101416001)(122386002)(3846002)(69596002)(50466002)(5001960100002)(86362001)(36756003)(5004730100002)(106356001)(53416004)(54356999)(2950100001)(105586002)(189998001)(92566002)(87976001)(77096005)(76176999)(66066001)(575784001)(229853001)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1020; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1020; 23:U0C1UtlaUMzbbvhIoERYpKBD2ajQvwM8ykmkzfwLQ?= =?us-ascii?Q?UJUglY31lJxVnOwUaENYPh+RrbC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o2O5hXBGVMjeXFws/ysIyhiL0U9a05Q2zqSW/ihRpMJvuXZpdWgGv?= =?us-ascii?Q?ysa4B07yB68pqkTv1JpXAT+QttQBmmZeWSqZHEBAgapATKbGFxVqFnykQVG9?= =?us-ascii?Q?cybHlVl0+1egwGf4XRzs0NJVMZxDTGqPUTOAkXRVwbXahOoDvGwSZFPAU65u?= =?us-ascii?Q?UelNBFnle5wEQy1skodph8LvOmL7kKzZIY20lzBZHFctDgMSRIEnw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1020; 5:MmUk21bh7kOXf5BcaickrceN51kyIzN3Ly5+1dIvcHTaGhFr2gJ5RoJOKez8mWs1SAroY3zpHHqQNbY5PSNBTSV2+rALoHDg5DPg044TIU+5tpyTAILFdmMKDTOPCsXJ1f5kivGmvVSJthXpy6xCQQ==; 24:ZzmqaQaORz7iuwvUnh3N9djJS/08xfFbi1GwfmdyXtbHpyjCRfeTp7/YA1qJrxWgx2OWYh/rqgKRlx7rZJj7Dr9D9CoQvb27f3RtK57wZYM=; 20:aooAKXIHfmqcdprtoEmQMO8wTKzwcvoV9fE7YDYHQMbVQRSKl9tPnytUgR2St+RDyRxJmmbth7lNV40eSnUrwKVGMUdt8ykpqsl1EP4waWDfoTJFBcHNIpUCtjPDT9969qCEZmIscwSHH4sIIaPxUHMD8wP/yqF+NQy37dFIHXs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 03:18:11.1694 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1020 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 --- 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 {