From: Guenter Roeck <linux@roeck-us.net>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: hwmon: label vs temp%d_label
Date: Tue, 2 Apr 2024 13:59:41 -0700 [thread overview]
Message-ID: <fdd952dd-2f3c-4f66-8e73-68f1dadde237@roeck-us.net> (raw)
In-Reply-To: <9a09bf46-d097-4e5b-bdb3-cc9dc6f5d01c@alliedtelesis.co.nz>
On Tue, Apr 02, 2024 at 08:24:37PM +0000, Chris Packham wrote:
> Hi Guenter, Jean,
>
> I've got a requirement to add some meaningful names to some hwmon
> sensors (LM75 specifically) so that we can provide some indication of
> where on a board the sensor is located (e.g. "Intake" vs "Exhaust" vs
> "Near that really hot chip").
>
> I see that the sysfs ABI documents both "label" for the chip and
> "temp[1-*]_label" (as well as similar fan and Vin attributes). The
> latter seem to be supported by the hwmon core but I don't see anything
> for the former (I'm struggling to find any driver that supports a
> chip-wide label).
>
> Assuming I want to have a label added in the device tree to a lm75 would
> something like the following be acceptable
>
> sensor@48 {
> compatible = "national,lm75";
> reg = <0x48>;
> label = "Intake";
> };
>
> I'd then update the lm75 driver to grab that from the devicetree and use
> it to provide the hwmon_temp_label attribute.
>
Have you tried just declaring the label property as you suggested above
in your system without doing anything else, and looked at the generated
sysfs attributes ?
Guenter
next prev parent reply other threads:[~2024-04-02 20:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 20:24 Chris Packham
2024-04-02 20:59 ` Guenter Roeck [this message]
2024-04-02 21:22 ` Chris Packham
2024-04-02 21:57 ` Chris Packham
2024-04-02 22:17 ` Guenter Roeck
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=fdd952dd-2f3c-4f66-8e73-68f1dadde237@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Chris.Packham@alliedtelesis.co.nz \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®