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: "Wangtao \(Kevin, Kirin\)" X-Patchwork-Id: 111198 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp987018qge; Tue, 29 Aug 2017 01:24:21 -0700 (PDT) X-Received: by 10.98.166.151 with SMTP id r23mr3081803pfl.168.1503995061659; Tue, 29 Aug 2017 01:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503995061; cv=none; d=google.com; s=arc-20160816; b=zvpWFdZmmKlxmnG5/RE7zMIpQqKV7ZKj5awYdMx6x5fxCk3HVef6CTzHBa5SPc+3s2 UohBXKU4O1+YN83CfBNyA3pqWZnvHO2IHL+x+JJlQeo7/isppeJLmDlnKpbrvWWfMvls 21Mdal71YnKpwg2JnKuB1m+0KpEggU7DXUh23z1im/i2fUxYPdPLuPz51B4bjHrdaVuP c9Cc8M463HWXe2TPdvDn+2y3sjK41OCeikSb75YJkuBz5ywMQc11YSlJ4qItrFC/yOT8 6zxlAsTfwKrA86SkTP554cUL4823AZHU5gh5RyZQSdnYujkcdZO0OzoR3sDrurW8qdMP 8WFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=wBoxBM221326V9vy0ECcWRQowrIlWduFIH/PBQUiefI=; b=nCXWS2iacunoY346zPXl8dcd7XrtM2X2oXn8vjUwfgEuQZhCFEMQF1PM9J8IoBAUgL AppeiOs3V8ujKv+e8GmuO1l6sfVhhuRJLGtpiWlPyU1l7PxU/1w9dDVV69BfN1nloRF5 k7jKoQ4kGPGnGaumljLl6R5NhMi9xb4Yqd+kUzaeztBdUQeRXlHfhHpOjFSFaH7mVeiq 2/UCxijwFqRMcWBPew531/RXtpsajW73iYo7+P/WJctqZZzjcD/mukffp9sDEo6vXn4D 1Ars2vze5GzYr22MGpQz+Z0JKf3Awl50mIEQYxpjxhOXCDtWLbgdDFA2+LbInhx9JUza cZ8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si1963752pff.4.2017.08.29.01.24.21; Tue, 29 Aug 2017 01:24:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbdH2IYQ (ORCPT + 26 others); Tue, 29 Aug 2017 04:24:16 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5483 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbdH2IYH (ORCPT ); Tue, 29 Aug 2017 04:24:07 -0400 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: , , , , , , CC: , , , , , , , 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.8.1 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