From patchwork Tue Dec 8 05:29:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7794421 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 74EB6BEEE5 for ; Tue, 8 Dec 2015 05:29:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3FDF2045A for ; Tue, 8 Dec 2015 05:29:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0539120527 for ; Tue, 8 Dec 2015 05:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932624AbbLHF33 (ORCPT ); Tue, 8 Dec 2015 00:29:29 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:41221 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932332AbbLHF3Z (ORCPT ); Tue, 8 Dec 2015 00:29:25 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 08 Dec 2015 14:29:23 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id D4A22433EF; Tue, 8 Dec 2015 14:29:23 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id C25C21806F; Tue, 8 Dec 2015 14:29:23 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id BC4051800A; Tue, 8 Dec 2015 14:29:23 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id QAK31533; Tue, 8 Dec 2015 14:29:23 +0900 X-IronPort-AV: E=Sophos;i="5.20,397,1444662000"; d="scan'";a="201319727" Received: from mail-hk2apc01lp0209.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.209]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 08 Dec 2015 14:29:22 +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 SG2PR06MB1017.apcprd06.prod.outlook.com (10.161.9.25) with Microsoft SMTP Server (TLS) id 15.1.337.19; Tue, 8 Dec 2015 05:29:20 +0000 Message-ID: <87lh955x4h.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/8 v4] ARM: shmobile: r8a7790: enable to use thermal-zone User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Simon , Zhang Rui , Eduardo Valentin CC: Geert Uytterhoeven , Magnus , , , , "devicetree@vger.kernel.org" In-Reply-To: <87vb895x9d.wl%kuninori.morimoto.gx@renesas.com> References: <87vb895x9d.wl%kuninori.morimoto.gx@renesas.com> Date: Tue, 8 Dec 2015 05:29:20 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0020.jpnprd01.prod.outlook.com (25.161.225.158) To SG2PR06MB1017.apcprd06.prod.outlook.com (25.161.9.25) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1017; 2:g4OJWqlpEjf1BZp0ahmXdp4KlfvqN8GOwnb56vpRqaCzt2+89Dvow7DXAD9lBRRzR9XMRhWpAjupc7lSFnQFC8073kEmBDcBgdo2Gzzd49R8tEQZEdp6z4kgFQ8T9d4mhpfbN0rI2cv1N6+2wlUDmw==; 3:Q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CCvIe/vDg6t3857y+rdNBHZNFVqV6gFiwaksXaBUoqLcoCZpxDWQVy20gP+DeLjlVRrT0oc6Upo9Tf2fVl+tKs+m90rBTtA0qlOKCQl+MsHQOGfHJpmQVu5JwjnvGwGQkf/ppHcQZk3oPNZaGiGjBuVkQBO7sHPrv9MJ7QVeHiNkH8x2nTOA0vqZx5L9Elu988xPsy3JWj8DrV5waw5T/f9BB5xbhkV2+iDsIC5daaumKyRUOokvQBK2ciwLldW/DYc3gisREvs/3ZVvSoyojxAfv1XE9M2+EW+JzRBmm7MJJv1G8YtUFCyuNAFlWvYdilL11WpqX/MYHOSQcILTycRh9QDoCYVA+RfCdO5gt4TVXyJRpuI0yDkpWakJ47l 5HsRlDycfANMvH6ZskFZkGvHC5 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:SG2PR06MB1017; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1017; X-Forefront-PRVS: 0784C803FD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(43544003)(81156007)(42186005)(101416001)(66066001)(47776003)(19580405001)(33646002)(46406003)(50986999)(54356999)(229853001)(83506001)(86362001)(105586002)(106356001)(50466002)(19580395003)(87976001)(122386002)(5004730100002)(97736004)(4001350100001)(36756003)(23726003)(77096005)(5001960100002)(40100003)(1096002)(76176999)(5001770100001)(3846002)(586003)(5008740100001)(2950100001)(6116002)(69596002)(92566002)(189998001)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1017; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1017; 23:jekP2LNo/GelDAR45B+xF8KpdJH6cbJz+BPPCaxB+?= =?us-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qpkmIdbVTIb2FxF5f3DdRv+xbkPxn?= =?us-ascii?Q?8jt5WNBBfO25IOZxX0S8QA4FjcewCU2VmoGHbDWjg8RWCUFl6d8nN1ixCw35?= =?us-ascii?Q?7HpjJzSWns2w/yF/KYjbqdMNUAPbrCClwg+EZ7EDc87+8ixCEADGVJduFSlH?= =?us-ascii?Q?6DmEdMliduo8UFNdQbDvKB81VPBP+CRtBaZvkHltBCHxE1ZDWaWzuc1VmhDm?= =?us-ascii?Q?DIiG+LtahpHedzhmdWEsjAWqaWi06GW?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1017; 5:NHFP0aQyyCaEPamnBsoCHoQjpQsaw/R88PNZ+xPFuXHspN+icoXoxLPOR6EHG2uovFvcPpz1ansV0zCjP/G0FkOvRiGj22LYYZeNKPnVxijihkc+qx4l7cytL7N+4Xw3cyYMzQ+wR1onPRyxwu4lWA==; 24:/TJ672sHCDjglorT5tGiHtY5mRe0c9SMW3WX2q3OFaZczXTemZKKWV1PMYR0xoeC02OmiEk7tzc7XF3eLdHQb84gchDUeV1XqlPCU8bA+24=; 20:S4oTTHgRx083SPESNCFbURZ6R0wa39QYDo9B7w3rEm1r1OXm2/YXc42oCTVydtsVb2hd7uUWTovBtwN1NqIhj30Q8ZbUfnQpRXhslyjasMxyA/zrvW+Eonj4dxYnzPXfmSfmg+eTt943gq8nvDYkF7BsBcu5b0YtlEe07rOg5kI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2015 05:29:20.1485 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1017 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 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 --- v3 -> v4 - modifing -> modifying - reached -> reaches - <1150000> -> <115000> 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 9f3036b..2203b97 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 {