From patchwork Fri Dec 4 08:35:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7766211 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 9A7B1BEEE5 for ; Fri, 4 Dec 2015 08:36:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4617204AF for ; Fri, 4 Dec 2015 08:36:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCB97204A2 for ; Fri, 4 Dec 2015 08:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755749AbbLDIft (ORCPT ); Fri, 4 Dec 2015 03:35:49 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:48053 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755541AbbLDIfo (ORCPT ); Fri, 4 Dec 2015 03:35:44 -0500 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 04 Dec 2015 17:35:42 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id B2C554C21E; Fri, 4 Dec 2015 17:35:42 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id A23258002E; Fri, 4 Dec 2015 17:35:42 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 9C1BC8002D; Fri, 4 Dec 2015 17:35:42 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id TAH04170; Fri, 4 Dec 2015 17:35:42 +0900 X-IronPort-AV: E=Sophos;i="5.20,380,1444662000"; d="scan'";a="201127321" Received: from mail-hk2apc01lp0210.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.210]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 04 Dec 2015 17:35:41 +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 SIXPR06MB1021.apcprd06.prod.outlook.com (10.160.238.156) with Microsoft SMTP Server (TLS) id 15.1.337.19; Fri, 4 Dec 2015 08:35:39 +0000 Message-ID: <877fkufwao.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 7/8 v2] ARM: shmobile: r8a7791: 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:39 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0016.jpnprd01.prod.outlook.com (25.161.225.154) To SIXPR06MB1021.apcprd06.prod.outlook.com (25.160.238.156) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1021; 2:9XqrbSRu62d9iw54eH/VoonTZAC2TXHVs85wyzL8s7lQcBXxuOP0KgkTpzkre3kJllEhb7Y5xIVGNDxKS7uI0pItpb03rVuNbEEi6cz7S0AUt36StemDGQ77CABCXRKN4IAi26h2r4iq1AQKQGpscw==; 3:xPdRhBxkMpssODYdLneVAFJN07LfikcH+bT3h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E2cfYi8HXQc5+sb8BsmQyKw5FPw3MKU7xWxlRU+O0sKW4EkHSbEKVpS0AW7w5bbPBJGEJP9/4KeZdNCdsW7IrmN4fz2yrJtbdOftYmzxHpCv0KJuEsO8bWbgkQ5dlDcIFFrDhLtpTGNpC/L/pxHjMzw7CpVEH4g03Ld2k+DDfLdU/LnzIO19xp5Ed9aJx8EAJ/MZs1/3vtVb34psPLquvVg0GZjFfWz+ve8KQ2tNkKtNOVNUKrfHsDOIGrlW1FP4RShBjZC9DFkhFrSfl2Z7F2d31+P0ZErOoUMo9xHNtWqx806FOFgC8kthSWx vc/Pk= 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:SIXPR06MB1021; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB1021; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(43544003)(2950100001)(86362001)(189998001)(66066001)(47776003)(586003)(1096002)(3846002)(6116002)(23726003)(19580405001)(19580395003)(77096005)(36756003)(83506001)(87976001)(42186005)(53416004)(40100003)(122386002)(101416001)(92566002)(46406003)(81156007)(229853001)(5008740100001)(5001770100001)(97736004)(5004730100002)(5001960100002)(105586002)(50986999)(33646002)(69596002)(106356001)(76176999)(54356999)(4001350100001)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB1021; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB1021; 23:Ts+/nN3YrZ2Hml0t2nmA37fPs63rZtAlCIp0224LT?= =?us-ascii?Q?IDsChk7dPjp1AJnhk+eEd8EdzbmUjzCmZF8ohaWYcVJ/k29Q9cxVF3PK1Pps?= =?us-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QWfSSrGXmjjXBgJCd5UpRko29fL3hPKA9l+cfOZxgWs796?= =?us-ascii?Q?QXyY4lHZbSLT7W4iO7GbvO30k7o8qwQru8UaSU38BJAZN1YNTy04l7DYWE2g?= =?us-ascii?Q?mcBDYhlGR/5qJqWD6iM+pzc5mEGiiQjvnQ22chVf7OEoOvwk0oa949vsIS4Y?= =?us-ascii?Q?SJXRme0IkiD+JrffJOAlqggfo39hgO9?= X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB1021; 5:MFKPHDhv60sZMhbCkdloWilZTn3byn8OvT6yE2TKasyfdoB13lr+uKmYGVwaGaykpJqGSRsU/XoHcp678Y9FMW2wnbRg9lc9dCfYEumH33z3/coWgXkWBgozARfpCHF6v/1Zjc6rxo3mDd7k4MKLfw==; 24:FUQgBXH2dY8JmQRrugTnbccimpKGZzGKmMKqqkKigAMOQrq1cBKyogeMy/4/Hl/7YCqtebH4kgUcfNPj1uvte2p7or/zBaTD2HvxndmuBh8=; 20:3BreSDaji3EkX23DKLqfI4rC6/SetSrlzQ+Lvo7c94hd0qkj2W59Cy7LCT9ow5AjeK+imzsONjBNQHhIxUhXvlUGC+Pb2SJZk5O9PsmcUOE0KJaz/emuMTAuf7UxAr3f++dGaAr41bLUsqPH27XQ41+dRs06TxFbu9TvvliCtUg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 08:35:39.5728 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1021 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 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 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/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 1487d92..2fff856 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 = <1150000>; + 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-thermal-gen2", + "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 {