Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933104AbbLHF3v (ORCPT ); Tue, 8 Dec 2015 00:29:51 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:49263 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932752AbbLHF3q (ORCPT ); Tue, 8 Dec 2015 00:29:46 -0500 X-IronPort-AV: E=Sophos;i="5.20,397,1444662000"; d="scan'";a="201319756" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87k2op5x3x.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 7/8 v4] ARM: shmobile: r8a7791: 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> Content-Type: text/plain; charset="US-ASCII" Date: Tue, 8 Dec 2015 05:29:39 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0004.jpnprd01.prod.outlook.com (25.161.74.142) To SIXPR06MB1024.apcprd06.prod.outlook.com (25.160.242.28) X-Microsoft-Exchange-Diagnostics: 1;SIXPR06MB1024;2:Z0isK+M2jQ8ZZ1ivFPxaT/kvizujruEus2igx/2j/LOGuO+1YDsyKdgAB/Vfea49538s9tWQhPE9vpaqWfU1KF5/l6arZM0niBo4jYz3sHMFg5cB0qxbX359Hw6aJ3vjU0jVuklC0yXe/rlXYk4enA==;3:9ZXwIBEa9rZZSEXSdxA4VcLrRpuq13hWCiC5lcxkMKMgc7sOLcuHTUmRAwyF+eA8tD/WXYCOXQUsR9h/z5zzj+yoSz6Ryg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/yxAJQrCIfH1USvBy6A+bticUkxjIaNZVWsIM11HVm4pyA1K+wdawcGfyNb4yNWqd1i8enQ2oScLuQCVTkuMKzJWzcMd2u3eIuKC8IwXmxFi05Ep68K0up7JdK2+L2JCfwJyp0ATSjror7ACGjQXOJkP5icmO7kHHKuPy34h4Qpa34XgN6ZNYKJrappx2a6fvVxmRposZn6V7c5jcBTnwl/b462sOjh4tRGOqJ9YZy97/Qsf7AcveyFoBX50JmSuOWQFfOKsYuiRqxaCprP17ddnOvuMkVhVOXYBq++OQLG+ctrH+2kPJfBnRM01hZ 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:SIXPR06MB1024;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB1024; X-Forefront-PRVS: 0784C803FD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(43544003)(199003)(189002)(4001350100001)(1096002)(5001770100001)(66066001)(86362001)(5004730100002)(97736004)(81156007)(46406003)(83506001)(19580395003)(6116002)(50986999)(42186005)(101416001)(76176999)(53416004)(69596002)(77096005)(3846002)(33646002)(5008740100001)(23726003)(2950100001)(19580405001)(47776003)(189998001)(36756003)(50466002)(54356999)(106356001)(5001960100002)(586003)(87976001)(229853001)(122386002)(92566002)(40100003)(105586002);DIR:OUT;SFP:1102;SCL:1;SRVR:SIXPR06MB1024;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SIXPR06MB1024;23:l2CYH5FuYPbXwH7jTAfiKJdy0Z4FrszV1Lt6pJqQQ?= =?us-ascii?Q?Pq7KNzCs4lZ+GzNGJD8BRPiz3IloX/Jm3GL2ff1Gqndj30gYYL8m7H4dVHWR?= =?us-ascii?Q?fpcJZ0nwE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K8n4adQH?= =?us-ascii?Q?DjB+gMjkcuzGpgcy2HCClnJDKzj7BgFcpi8VXOVn24ogeqf8ZUwAmsaEp42h?= =?us-ascii?Q?hzsv1jUzQvMR6TIH8wYuwTbGnK8pEx9sbgoT8eLCxe1IZnrR6OoJOPVnrLCF?= =?us-ascii?Q?bW2xZ9mB9kPlkNSejpZ8xg4l2g2z+EC?= X-Microsoft-Exchange-Diagnostics: 1;SIXPR06MB1024;5:yYwmkgt5LZsXQgYCbBfymktzb/FBB7m5zO+Z5rDAQLNSSTu9HsBgrYZvnEKbcPhb15jgVIn6xudQPewNesYPtbBJ0LlApr4F2W3NQUuHQ+m0OIbRBCF/Bqi9TzZaTSyaaV8dyKXWlLmadxOiWUMylQ==;24:TBX93TpmKXapZ7UOv0/4Cf6RY6rwnxKJEjhMe5pBgk2EcPnjSyLPqxWHmHsj2UkEwm74ClOSsTeki6N/66tOwiH7EzgGnT4UwNmcopXzte4=;20:zJtDb/AEFuS/B/J6/rDur67Tzo24xvGcOt309hEdt3tIcymNYqLCeLqdJz+I1AUIpF7x6BqtwgGSZiO9bYIIW33bMFVRZz8t8DA0jgYo+wxAT+nRNRcnsICDcNKK28LW3W8RKXsWg4IDXdyIG0hlgovEfgTbJqEJRqSSyH9BP5s= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2015 05:29:39.8373 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB1024 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2447 Lines: 86 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 --- v3 -> v4 - modifing -> modifying - reached -> reaches - <1150000> -> <115000> 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 3776974..9b37c80 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 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/