From patchwork Thu Aug 10 08:32:15 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: 109796 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2033445qge; Thu, 10 Aug 2017 01:40:28 -0700 (PDT) X-Received: by 10.84.232.66 with SMTP id f2mr12260276pln.441.1502354428417; Thu, 10 Aug 2017 01:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502354428; cv=none; d=google.com; s=arc-20160816; b=H6TUySLbp7xm2OwdPk5oFfqNdSKyy2wvA+kbwTPcLUq/218dHWgQvat0dHFZCqr0c8 yT+j1JrXP8ebrgUoLiNr25gHQ9rxf/CPKMXx86A2Z/fBgzjwRMlGbIoAwBzeJ+bSu7+Z AC0vbjbosK7yOghPpstrs3OyuOOk6NLHM8Bjl6sKp67DXzp4L4sd53Tdm2FWQXxN1US/ 1CO8dk9wDnBW6sEfY7TZNwIcDuNpuBXOLXHahJdshKH63q9kippKbTNv+GZFaa2mBXa0 QHNFNlm9El1/QEOHZsTqFIPenYtwT3hf6F+q6G+LuHprWEsKp6QTyoRi1o7lLAyGyp4N Q+rw== 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=1GjyeQPpoY1+f6Sr7hdMeXPJAmuG5T1GlXIUQQle/vA=; b=dmfNRJz5J32vG1szdSM0YitwlVrYP3fMbO2QI24uHGlDoJyDHXXgMtkXtLq7mMiy8I owtd2Egyqz2UroteOd0mzpNLh8+TjZrIJXibLnDl+ma/HZ+msfqdlzoA7ni/E7uKwa/S 9QLcTALv9/CjQL5DxjGyjLu+XK7rwMe9K6dz9bSQNw60zgqLOCaRkxFGs4/KWiFnoUG3 TF4vvSpXanzVMgpLn34fPAq2EnDGejzRLFa9argAHAS4kXUwsQx/HrRRO+s99ZGatAfj tgYewIKUntUMgibRwHHTVO+0c7M1NTNemcAaE3cH0bt+NL9PKkqhbwulQpP7zxrkc8d1 D0BQ== 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 a26si3850676pfl.487.2017.08.10.01.40.28; Thu, 10 Aug 2017 01:40:28 -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 S1752366AbdHJIkY (ORCPT + 25 others); Thu, 10 Aug 2017 04:40:24 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3041 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbdHJIiM (ORCPT ); Thu, 10 Aug 2017 04:38:12 -0400 Received: from 172.30.72.60 (EHLO DGGEMS409-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DEX89442; Thu, 10 Aug 2017 16:38:06 +0800 (CST) Received: from HSH1000038028.huawei.com (10.177.161.152) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.301.0; Thu, 10 Aug 2017 16:37:58 +0800 From: Tao Wang To: , , , , , , CC: , , , , , , Subject: [PATCH v3 3/3] arm64: dts: register Hi3660's thermal sensor Date: Thu, 10 Aug 2017 16:32:15 +0800 Message-ID: <1502353935-92924-4-git-send-email-kevin.wangtao@hisilicon.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1502353935-92924-1-git-send-email-kevin.wangtao@hisilicon.com> References: <1498102923-68481-1-git-send-email-kevin.wangtao@hisilicon.com> <1502353935-92924-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.0A020202.598C1B6F.0045, 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: 2e8426716405e4bada2e74c8981b6f3d 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 | 10 ++++++++++ include/dt-bindings/thermal/hi3660-thermal.h | 30 ++++++++++++++++++++++++++++ 2 files changed, 40 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..7e2081d 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,14 @@ &sdio_cfg_func>; status = "disabled"; }; + + tsensor: tsensor@FFF3000 { + compatible = "hisilicon,tsensor"; + reg = <0x0 0xfff30000 0x0 0x1000>; + offset = <0x1c 0x5c 0x9c>; + coefficients = <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..1efe625 --- /dev/null +++ b/include/dt-bindings/thermal/hi3660-thermal.h @@ -0,0 +1,30 @@ +/* + * 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 THERMAL_NO_LIMIT (~0) + +#endif