From patchwork Tue Sep 25 09:03:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 147413 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp472925lji; Tue, 25 Sep 2018 02:04:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV61gm/RZmNsS8SCoBodWc4FMVYsDhn0KtRU3irGg1CP5FQ3ZZnp9Tnk+hnNfBftTZOvZtjcc X-Received: by 2002:a63:8742:: with SMTP id i63-v6mr73525pge.27.1537866277204; Tue, 25 Sep 2018 02:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537866277; cv=none; d=google.com; s=arc-20160816; b=hLtWDmlYwCS/i3FV1l6kvNFhF3ftkiKP02wbzfD69I7a912ojlKPZVcRpIXzjx12ek PG3f40Hgp3Qhp7JpBVY1yLiWVrZF8VOU5taAvKmVqD/GLyf1871Xqxkhd/BP6FByHUtY C6ubIxct953imyvP1S8Jl0BKIzdEOR9Uhid75ZgMFut9f5uTHTjqv1gpPSQqFm7LiTpG crg4Al+mz3QDL/RxK4+X3M67+xoOcMSq8u6rhlZQjnMtjByMvSIu3qTuDLSIqTMjH/lF CIuAvajuMx+UrE0E9XSL7pEg8nR3bJ24RNHhAuJJrEoY4gORyYfAlt9NlG7OL3dKTrO2 Kv6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=fOZ6rfysb+Hiuh5cPbqLhry8YsLUdhlmW/oJcrqQRxA=; b=hWM7nQfdGOkPScwcTLC+JgheFaozAwPMsnBWiOG42CszLun/JlzS8xSuqYZGq9tcP6 ED5T+1ntgETQ7+YX/SkRpZx8Dl82yXgkUmgMZGWAheakxDpRchVIxX3jNawRAhcDzjeC ZE+5H//kMO98RR71TNNWyazkE1P3L+CWtg44SXrsupXdvSYMwgiioD8SRMKYd52IVukK 0u3xqemhAGJd+7YxC6k9rqj1b6rZpNgJLx0urV7j/BXs+9AweC2ArblTnaAiL3DmYJWL rK+T7hLlHHEKu5vr3KlLKjkZ2A6Ap1ilW3UaMDzxqoGklx36G2FXUyzAhLKKv/8cj18o j40A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hcVBj09/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay4-v6si52987plb.410.2018.09.25.02.04.36; Tue, 25 Sep 2018 02:04:37 -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; dkim=pass header.i=@linaro.org header.s=google header.b="hcVBj09/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728753AbeIYPLG (ORCPT + 32 others); Tue, 25 Sep 2018 11:11:06 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39998 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbeIYPLF (ORCPT ); Tue, 25 Sep 2018 11:11:05 -0400 Received: by mail-wr1-f66.google.com with SMTP id y8-v6so18833950wrh.7 for ; Tue, 25 Sep 2018 02:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fOZ6rfysb+Hiuh5cPbqLhry8YsLUdhlmW/oJcrqQRxA=; b=hcVBj09/LPgzagzXbG9tfUX8oRAsiwmFID99WPVrdOQGmbC1/0KZ9FWpIpwqpIRwUp s0EdWA/zagjvvwkOeDckhfYfza+coZ2FjWx/hC0xW5q2qvV+REWF/BYRpH/agpwbHgjp swl2HELI+DPy1jSvRSc+6SD4QrEnNdJPpCZXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fOZ6rfysb+Hiuh5cPbqLhry8YsLUdhlmW/oJcrqQRxA=; b=cmkI9+Lg8rv5X5f/eu84rAts5HlZ48j+eVaw5iwI3Y+q31Ycgkj5n+xEhXhSKTCmVy VN+jrOgyNku6X21UokEtD3wKvxvRMYI4gtux6RrJnG1LmydEa47QV+729CXYigiB8CDx 0UFQqzO3QvSidq371dgUHt2tv7haUTCWw+VvoPZOQzAop67uj4OzhZ/a0JHmmiUVSr8j v3ac1sEoPf7vLcPv1AFKk1f6cvT9HBbR6EuNFDUxdqtCvYYM0iOUBXDyiSsDUvZG9Fnr x2BPsKf6uUUMtwmqCsuaoNL/a2MSRNR2r3dLhVU/ZWlqjlTkPOiNAbYQLXtw0p677sBB 5qrA== X-Gm-Message-State: ABuFfojXch6S0UbhKyDkzU/vruXW9MfwSfQAlilKAf8cV0bzlYoLsH7X NFXHW/9M6tB+s6UvCL9c6rVXng== X-Received: by 2002:a5d:448d:: with SMTP id j13-v6mr40484wrq.236.1537866271365; Tue, 25 Sep 2018 02:04:31 -0700 (PDT) Received: from localhost.localdomain (251.150.136.77.rev.sfr.net. [77.136.150.251]) by smtp.gmail.com with ESMTPSA id y206-v6sm1523828wmg.14.2018.09.25.02.04.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 02:04:30 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, daniel.lezcano@linaro.org, leo.yan@linaro.org, Zhang Rui , Rob Herring , Mark Rutland , Wei Xu , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/HISILICON SOC SUPPORT) Subject: [PATCH 08/14] ARM64: dts: hisilicon: Add tsensor interrupt name Date: Tue, 25 Sep 2018 11:03:06 +0200 Message-Id: <1537866192-12320-9-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.org> References: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the interrupt names for the sensors, so the code can rely on them instead of dealing with index which are prone to error. The name comes from the Hisilicon documentation found on internet. Signed-off-by: Daniel Lezcano --- .../bindings/thermal/hisilicon-thermal.txt | 3 ++ arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 63 +++++++++++----------- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 1 + 3 files changed, 36 insertions(+), 31 deletions(-) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/thermal/hisilicon-thermal.txt b/Documentation/devicetree/bindings/thermal/hisilicon-thermal.txt index cef716a..3edfae3 100644 --- a/Documentation/devicetree/bindings/thermal/hisilicon-thermal.txt +++ b/Documentation/devicetree/bindings/thermal/hisilicon-thermal.txt @@ -7,6 +7,7 @@ region. - interrupt: The interrupt number to the cpu. Defines the interrupt used by /SOCTHERM/tsensor. +- interrupt-names: The interrupt names for the different sensors - clock-names: Input clock name, should be 'thermal_clk'. - clocks: phandles for clock specified in "clock-names" property. - #thermal-sensor-cells: Should be 1. See ./thermal.txt for a description. @@ -18,6 +19,7 @@ for Hi6220: compatible = "hisilicon,tsensor"; reg = <0x0 0xf7030700 0x0 0x1000>; interrupts = <0 7 0x4>; + interrupt-names = "tsensor_intr"; clocks = <&sys_ctrl HI6220_TSENSOR_CLK>; clock-names = "thermal_clk"; #thermal-sensor-cells = <1>; @@ -28,5 +30,6 @@ for Hi3660: compatible = "hisilicon,hi3660-tsensor"; reg = <0x0 0xfff30000 0x0 0x1000>; interrupts = ; + interrupt-names = "tsensor_a73"; #thermal-sensor-cells = <1>; }; diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi index f432b0a..bf8a479 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi @@ -1081,46 +1081,47 @@ compatible = "hisilicon,hi3660-tsensor"; reg = <0x0 0xfff30000 0x0 0x1000>; interrupts = ; + interrupt-names = "tsensor_a73"; #thermal-sensor-cells = <1>; }; - thermal-zones { + thermal-zones { - cls0: cls0 { - polling-delay = <1000>; - polling-delay-passive = <100>; - sustainable-power = <4500>; + cls0: cls0 { + polling-delay = <1000>; + polling-delay-passive = <100>; + sustainable-power = <4500>; - /* sensor ID */ - thermal-sensors = <&tsensor 1>; + /* sensor ID */ + thermal-sensors = <&tsensor 1>; - trips { - threshold: trip-point@0 { - temperature = <65000>; - hysteresis = <1000>; - type = "passive"; - }; + trips { + threshold: trip-point@0 { + temperature = <65000>; + hysteresis = <1000>; + type = "passive"; + }; - target: trip-point@1 { - temperature = <75000>; - hysteresis = <1000>; - type = "passive"; - }; - }; + target: trip-point@1 { + temperature = <75000>; + hysteresis = <1000>; + type = "passive"; + }; + }; - cooling-maps { + cooling-maps { map0 { - trip = <&target>; - contribution = <1024>; - cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; - }; + trip = <&target>; + contribution = <1024>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; map1 { - trip = <&target>; - contribution = <512>; - cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; - }; - }; - }; - }; + trip = <&target>; + contribution = <512>; + cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi index 247024d..9eae986 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi @@ -841,6 +841,7 @@ compatible = "hisilicon,tsensor"; reg = <0x0 0xf7030700 0x0 0x1000>; interrupts = ; + interrupt-names = "tsensor_intr"; clocks = <&sys_ctrl 22>; clock-names = "thermal_clk"; #thermal-sensor-cells = <1>;