From: "Pali Rohár" <pali@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "Marek Behún" <kabel@kernel.org>,
"Josef Schlehofer" <josef.schlehofer@nic.cz>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] powerpc: dts: turris1x.dts: Add channel labels for temperature sensor
Date: Fri, 30 Sep 2022 14:39:01 +0200 [thread overview]
Message-ID: <20220930123901.10251-1-pali@kernel.org> (raw)
Channel 0 of SA56004ED chip refers to internal SA56004ED chip sensor (chip
itself is located on the board) and channel 1 of SA56004ED chip refers to
external sensor which is connected to temperature diode of the P2020 CPU.
Fixes: 54c15ec3b738 ("powerpc: dts: Add DTS file for CZ.NIC Turris 1.x routers")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
With this change userspace 'sensors' applications prints labels:
$ sensors
sa56004-i2c-0-4c
Adapter: MPC adapter (i2c@3000)
board: +34.2°C (low = +0.0°C, high = +70.0°C)
(crit = +85.0°C, hyst = +75.0°C)
cpu: +58.9°C (low = +0.0°C, high = +70.0°C)
(crit = +85.0°C, hyst = +75.0°C)
And without this change it prints just generic tempX names:
$ sensors
sa56004-i2c-0-4c
Adapter: MPC adapter (i2c@3000)
temp1: +43.0°C (low = +0.0°C, high = +70.0°C)
(crit = +85.0°C, hyst = +75.0°C)
temp2: +63.4°C (low = +0.0°C, high = +70.0°C)
(crit = +85.0°C, hyst = +75.0°C)
---
arch/powerpc/boot/dts/turris1x.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/powerpc/boot/dts/turris1x.dts b/arch/powerpc/boot/dts/turris1x.dts
index 4033c554b06a..5b5278c32e43 100644
--- a/arch/powerpc/boot/dts/turris1x.dts
+++ b/arch/powerpc/boot/dts/turris1x.dts
@@ -69,6 +69,20 @@
interrupt-parent = <&gpio>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>, /* GPIO12 - ALERT pin */
<13 IRQ_TYPE_LEVEL_LOW>; /* GPIO13 - CRIT pin */
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ /* Local temperature sensor (SA56004ED internal) */
+ channel@0 {
+ reg = <0>;
+ label = "board";
+ };
+
+ /* Remote temperature sensor (D+/D- connected to P2020 CPU Temperature Diode) */
+ channel@1 {
+ reg = <1>;
+ label = "cpu";
+ };
};
/* DDR3 SPD/EEPROM */
--
2.20.1
next reply other threads:[~2022-09-30 12:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 12:39 Pali Rohár [this message]
2022-09-30 12:40 ` [PATCH] powerpc: dts: turris1x.dts: Add channel labels for temperature sensor Marek Behún
2022-09-30 12:46 ` Pali Rohár
2022-10-09 12:05 ` Pali Rohár
2022-11-01 22:43 ` Pali Rohár
2022-11-26 16:24 ` Pali Rohár
2022-11-29 1:18 ` Michael Ellerman
2022-11-29 18:56 ` Pali Rohár
2022-12-08 12:39 ` Michael Ellerman
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=20220930123901.10251-1-pali@kernel.org \
--to=pali@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=josef.schlehofer@nic.cz \
--cc=kabel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.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).