From patchwork Fri May 15 06:12:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 6411391 Return-Path: X-Original-To: patchwork-linux-mediatek@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 8B5A19F6E5 for ; Fri, 15 May 2015 06:13:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E36E2034F for ; Fri, 15 May 2015 06:13:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 986382034C for ; Fri, 15 May 2015 06:13:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yt8s6-0003Xn-R2; Fri, 15 May 2015 06:13:22 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yt8s4-0003Nw-II for linux-mediatek@lists.infradead.org; Fri, 15 May 2015 06:13:21 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] ident=Debian-exim) by metis.ext.pengutronix.de with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Yt8rN-00012A-Vo; Fri, 15 May 2015 08:12:38 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1Yt8r8-0000pI-M6; Fri, 15 May 2015 08:12:22 +0200 Date: Fri, 15 May 2015 08:12:22 +0200 From: Sascha Hauer To: Wei-Ning Huang Subject: Re: [PATCH 14/15] thermal: Add Mediatek thermal controller support Message-ID: <20150515061222.GK6325@pengutronix.de> References: <1431507163-19933-1-git-send-email-s.hauer@pengutronix.de> <1431507163-19933-15-git-send-email-s.hauer@pengutronix.de> <1431597146.2650.59.camel@x220> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:08:02 up 59 days, 17:59, 87 users, load average: 0.01, 0.07, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150514_231320_849279_CAD6B316 X-CRM114-Status: GOOD ( 18.07 ) X-Spam-Score: -0.0 (/) Cc: Paul Bolle , linux-pm@vger.kernel.org, Stephen Warren , linux-kernel@vger.kernel.org, Eduardo Valentin , Mikko Perttunen , linux-mediatek@lists.infradead.org, kernel@pengutronix.de, Zhang Rui , Brian Norris , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Hi Wei-Ning, On Fri, May 15, 2015 at 01:33:02PM +0800, Wei-Ning Huang wrote: > Hi Sascha, > I tried these patches but I didn't see any entries under > '/sys/class/thermal', am I missing something? > Wei-Ning Please write a mail to me rather than to Paul if you want me to react. You'll need a dts snippet that registers a thermal zone. Try the attached patch. I haven't posted it because it only contains my testing code which registers a fake gpio controlled fan. Sascha -----------------------------8<----------------------------- From 2ea6d94fe430c317064d06b46a8d0d2036ca4236 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 12 May 2015 09:24:25 +0200 Subject: [PATCH] ARM64: dts: mt8173-evb: debugging: Add fake thermal zone This adds a thermal zone for the CPU which is controlled by a fan. No fan exists on this board and the temperatures are bogus. This is only for debugging purposes until the cpufreq driver is available. Signed-off-by: Sascha Hauer --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts index 43d5401..0a1f905 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts +++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts @@ -14,6 +14,7 @@ /dts-v1/; #include "mt8173.dtsi" +#include / { model = "mediatek,mt8173-evb"; @@ -31,6 +32,44 @@ }; chosen { }; + + fan: gpio_fan { + compatible = "gpio-fan"; + gpios = <&pio 24 0>; + gpio-fan,speed-map = <0 0 + 4500 1>; + #cooling-cells = <2>; + }; + + thermal-zones { + cpu_thermal: cpu_thermal { + polling-delay-passive = <1000>; /* milliseconds */ + polling-delay = <0>; /* milliseconds */ + + thermal-sensors = <&thermal 0>; + + trips { + cpu_passive: cpu_passive { + temperature = <47000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + + cpu_crit { + temperature = <90000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_passive>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; }; &uart0 {