linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
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 <rui.zhang@intel.com>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Wei Xu <xuwei5@hisilicon.com>,
	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	[thread overview]
Message-ID: <1537866192-12320-9-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.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 <daniel.lezcano@linaro.org>
---
 .../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(-)

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 = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+		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 = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+			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 = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "tsensor_intr";
 			clocks = <&sys_ctrl 22>;
 			clock-names = "thermal_clk";
 			#thermal-sensor-cells = <1>;
-- 
2.7.4


  parent reply	other threads:[~2018-09-25  9:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  9:02 [PATCH 00/14] thermal/drivers/hi3660: Dual cluster sensors support Daniel Lezcano
2018-09-25  9:02 ` [PATCH 01/14] thermal/drivers/hisi: Change the platform data pointer to sensor ops Daniel Lezcano
2018-09-25  9:03 ` [PATCH 02/14] thermal/drivers/hisi: Change the driver to be sensor oriented Daniel Lezcano
2018-09-25  9:03 ` [PATCH 03/14] thermal/drivers/hisi: Set the thermal zone private data to the sensor pointer Daniel Lezcano
2018-09-25  9:03 ` [PATCH 04/14] thermal/drivers/hisi: Factor out the probe functions Daniel Lezcano
2018-09-25  9:03 ` [PATCH 05/14] thermal/drivers/hisi: Prepare to support multiple sensors Daniel Lezcano
2018-09-25  9:03 ` [PATCH 06/14] thermal/drivers/hisi: Add multiple sensors support Daniel Lezcano
2018-09-25  9:03 ` [PATCH 07/14] thermal/drivers/hisi: Replace macro name with relevant sensor location Daniel Lezcano
2018-09-25  9:03 ` Daniel Lezcano [this message]
2018-10-15 16:28   ` [PATCH 08/14] ARM64: dts: hisilicon: Add tsensor interrupt name Rob Herring
2018-10-15 18:01     ` Daniel Lezcano
2018-10-16 14:44       ` Rob Herring
2018-10-16 15:12         ` Daniel Lezcano
2018-09-25  9:03 ` [PATCH 09/14] thermal/drivers/hisi: Use platform_get_irq_byname Daniel Lezcano
2018-09-25  9:03 ` [PATCH 10/14] ARM64: dts: hisilicon: Add interrupt names for the tsensors Daniel Lezcano
2018-10-15 16:31   ` Rob Herring
2018-10-15 18:01     ` Daniel Lezcano
2018-09-25  9:03 ` [PATCH 11/14] thermal/drivers/hisi: Remove pointless irq field Daniel Lezcano
2018-09-25  9:03 ` [PATCH 12/14] thermal/drivers/hisi: Add more sensors channel Daniel Lezcano
2018-09-25  9:03 ` [PATCH 13/14] ARM64: dts: hisilicon: Add dual clusters thermal zones for hi3660 Daniel Lezcano
2018-09-25  9:03 ` [PATCH 14/14] thermal/drivers/hisi: Add the dual clusters sensors " Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537866192-12320-9-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=xuwei5@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).