From patchwork Tue Aug 29 08:17:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Wang X-Patchwork-Id: 9926865 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 129A560383 for ; Tue, 29 Aug 2017 08:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F34762888A for ; Tue, 29 Aug 2017 08:29:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7E7128898; Tue, 29 Aug 2017 08:29:01 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable 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 64F9228895 for ; Tue, 29 Aug 2017 08:29:01 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=+1OcsfGYuTQfOJmE5diekPHvzfQbHusDV9aQNyGnXUA=; b=HfLDmB3elxyjgO CflSeTClLxTeNUiIJ6gIfSa7+xo9B6+lIsVt81BIY7kVPrdqs9jQ/N2Vi6Ig5mgbzdcYiuCz5I+B3 556YbdFlhH0ZlaY0AvPqltbVCkSYcxKrPE5rGwym2nb61OQ2vrzKm2H/M3QURnko1PozmQrztnoPd bCC5eUZV1gTa0ztt4mB5Guree7u3q6DBN63IhMX/QAjXlQRlQKaMQfdVzn3g0dgJX2uEZXiuX2AGs wgGlUPIrAZetvzTpLpbSV0Wv9DjzcGTTf/X6KSSI8WGPj9aZ8jxAsJGpmSv6cojwvPpICIFoUjOe6 roTVdB1TlP+8cx4phKuw==; 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 1dmbtJ-00022Q-9r; Tue, 29 Aug 2017 08:28:57 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmbsw-00080O-L1 for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2017 08:28:37 +0000 Received: from 172.30.72.59 (EHLO DGGEMS401-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DGC68826; Tue, 29 Aug 2017 16:24:04 +0800 (CST) Received: from HSH1000038028.huawei.com (10.177.161.152) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.301.0; Tue, 29 Aug 2017 16:23:58 +0800 From: Tao Wang To: , , , , , , Subject: [PATCH v4 3/3] arm64: dts: register Hi3660's thermal sensor Date: Tue, 29 Aug 2017 16:17:46 +0800 Message-ID: <1503994666-13954-4-git-send-email-kevin.wangtao@hisilicon.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1503994666-13954-1-git-send-email-kevin.wangtao@hisilicon.com> References: <1503994666-13954-1-git-send-email-kevin.wangtao@hisilicon.com> MIME-Version: 1.0 X-Originating-IP: [10.177.161.152] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.59A524A4.0078, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 83ca64707c145ce5072af9384a504cbe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170829_012835_108908_883A09F4 X-CRM114-Status: GOOD ( 13.09 ) 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: kevin.wangtao@linaro.org, sunzhaosheng@hisilicon.com, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, leo.yan@linaro.org, gengyanping@hisilicon.com, linux-arm-kernel@lists.infradead.org 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 From: Tao Wang Bind thermal sensor driver for Hi3660. Signed-off-by: Tao Wang Signed-off-by: Leo Yan --- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 14 +++++++++++++ include/dt-bindings/thermal/hi3660-thermal.h | 31 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 include/dt-bindings/thermal/hi3660-thermal.h diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi index c6a1961..1ee6084 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { compatible = "hisilicon,hi3660"; @@ -848,5 +849,18 @@ &sdio_cfg_func>; status = "disabled"; }; + + tsensor: tsensor@fff30000 { + compatible = "hisilicon,hi3660-tsensor"; + #address-cells = <2>; + #size-cells = <2>; + reg = <0x0 0xfff3001c 0x0 0x4>, + <0x0 0xfff3005c 0x0 0x4>, + <0x0 0xfff3009c 0x0 0x4>; + hisi,tsensors = ; + hisi,coef = <165000 (-40000)>; + hisi,adc-range = <0x74 0x39A>; + #thermal-sensor-cells = <1>; + }; }; }; diff --git a/include/dt-bindings/thermal/hi3660-thermal.h b/include/dt-bindings/thermal/hi3660-thermal.h new file mode 100644 index 0000000..d9d9b6a --- /dev/null +++ b/include/dt-bindings/thermal/hi3660-thermal.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017 Hisilicon Limited. + * Copyright (c) 2017 Linaro Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __DTS_HI3660_THERMAL_H +#define __DTS_HI3660_THERMAL_H + +/* sensor id */ +#define LITTLE_CPU_TEMP 0 +#define BIG_CPU_TEMP 1 +#define GPU_TEMP 2 +#define MAX_TEMP 3 +#define AVG_TEMP 4 + +#define HISI_MAX_TSENSORS 3 +#define THERMAL_NO_LIMIT (~0) + +#endif