From patchwork Sun Apr 2 13:33:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9658457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3163B602BA for ; Sun, 2 Apr 2017 13:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C23828448 for ; Sun, 2 Apr 2017 13:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FF1C2845B; Sun, 2 Apr 2017 13:36:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1FC7928448 for ; Sun, 2 Apr 2017 13:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hZLXH426U8wxleClP736aA0nB58ck9J7RCCvDkyKG7Q=; b=HldVE2yAouNoso5CDX9xW93APv fAWnvf9PGsFn0ZjK0o6QRwrgJdjVVWhdgm6DROXZkAe8r01ufLck1rM3niw5KcCmsh5JhcBwzErTL JUzJ7m9QFYdRjy32qXgsbcuYqm//FtHjJi4NuIYFD9EYwpEUVqiU53V7pL8EzVgcDAa6WM1FAaE0x Z8crBsh7gbIxtU7nExRwUpJ9Taai0uYt15Pz+Ld8g58dLJnrMp/1o2qmoahVT3vIl4yt2WXYmd/r/ nyur5Q8+1lNI1n+vsz7fG23vUGgjmSnKyROCdlTGsUF2+RmeWDU9O2NNd47iJBzIcdKtF12XE7dWc RI+Ql/yQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cufgD-0004Up-Ns; Sun, 02 Apr 2017 13:36:29 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cufgB-0004UO-Hw for linux-arm-kernel@bombadil.infradead.org; Sun, 02 Apr 2017 13:36:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fH9mdxUpGS4IRPThag/eIh68Q8aqom+Za2JRBDFeetk=; b=b9Jm+PowBMLFs8sxD2R/Iyk47 fwxBFYHlAYk92fCJrPdFhA8/cqhXOw+a3JP5DI5VppgHHoopRBzhhMhj+VAejCBNu3SwaD/UnYpcR k19Bie4D6MS14EaLIcFcCkKLi64O669q/b3qudvxRC0kIA+LqxKWRH/aqoG3R9L3Zogdit+LhZZbN n5p9CIoEMinFPkzk4GzGVwm0QIjcpc3o9i6CGYVC5XgzHYMQybiH/mh5dxz3eIWg9LDGr5cm6aHFZ V7OpLUc5Hfcj9uoN7DxxoBmhA8CO3GumvKgkwYWe9Bus3eznUj/TuExrc+ah99c52Z0ay0cpPpZ69 Mj3XKiIIA==; Received: from nov-007-i592.relay.mailchannels.net ([46.232.183.146]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cufg6-0001Sr-Hg for linux-arm-kernel@lists.infradead.org; Sun, 02 Apr 2017 13:36:26 +0000 X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 61C498A1BC9; Sun, 2 Apr 2017 13:35:54 +0000 (UTC) Received: from hermes.aosc.io (unknown [100.96.126.101]) by relay.mailchannels.net (Postfix) with ESMTPA id 7AA9C8A3372; Sun, 2 Apr 2017 13:35:53 +0000 (UTC) X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from hermes.aosc.io (hermes.aosc.io [172.20.52.122]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.37); Sun, 02 Apr 2017 13:35:54 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io X-MailChannels-Auth-Id: lmn-TZDUIOWCRQMW X-Hysterical-Arch: 55611704268da3f8_1491140154235_2703586197 X-MC-Loop-Signature: 1491140154235:2194667432 X-MC-Ingress-Time: 1491140154235 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id B90CE436A0; Sun, 2 Apr 2017 13:35:29 +0000 (UTC) From: Icenowy Zheng To: Lee Jones , Maxime Ripard , Chen-Yu Tsai , Jonathan Cameron , Quentin Schulz , Zhang Rui Subject: [RFC PATCH v2 4/4] ARM: sun8i: h3: add support for the thermal sensor in H3 Date: Sun, 2 Apr 2017 21:33:04 +0800 Message-Id: <20170402133304.56824-5-icenowy@aosc.io> In-Reply-To: <20170402133304.56824-1-icenowy@aosc.io> References: <20170402133304.56824-1-icenowy@aosc.io> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170402_143623_166916_92A362B2 X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, Icenowy Zheng MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As we have gained the support for the thermal sensor in H3, we can now add its device nodes to the device tree. Add them to the H3 device tree. The H5 thermal sensor has some differences, and will be added furtherly. Signed-off-by: Icenowy Zheng --- arch/arm/boot/dts/sun8i-h3.dtsi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi index b36f9f423c39..552217bb9266 100644 --- a/arch/arm/boot/dts/sun8i-h3.dtsi +++ b/arch/arm/boot/dts/sun8i-h3.dtsi @@ -72,6 +72,32 @@ }; }; + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&ths>; + }; + + soc { + ths: ths@01c25000 { + compatible = "allwinner,sun8i-h3-ths"; + reg = <0x01c25000 0x100>; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "bus", "ths"; + resets = <&ccu RST_BUS_THS>; + #thermal-sensor-cells = <0>; + #io-channel-cells = <0>; + }; + }; + + thermal-zones { + cpu_thermal { + /* milliseconds */ + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&ths>; + }; + }; + timer { compatible = "arm,armv7-timer"; interrupts = ,