mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* hwmon: label vs temp%d_label
@ 2024-04-02 20:24 Chris Packham
  2024-04-02 20:59 ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2024-04-02 20:24 UTC (permalink / raw)
  To: Guenter Roeck, jdelvare; +Cc: linux-hwmon, linux-kernel

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.

Thanks,
Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hwmon: label vs temp%d_label
  2024-04-02 20:24 hwmon: label vs temp%d_label Chris Packham
@ 2024-04-02 20:59 ` Guenter Roeck
  2024-04-02 21:22   ` Chris Packham
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2024-04-02 20:59 UTC (permalink / raw)
  To: Chris Packham; +Cc: jdelvare, linux-hwmon, linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hwmon: label vs temp%d_label
  2024-04-02 20:59 ` Guenter Roeck
@ 2024-04-02 21:22   ` Chris Packham
  2024-04-02 21:57     ` Chris Packham
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2024-04-02 21:22 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: jdelvare, linux-hwmon, linux-kernel


On 3/04/24 09:59, Guenter Roeck wrote:
> 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 ?

I have not. But in my defense I'm also using an older kernel LTS that 
doesn't have commit e1c9d6d61ddf ("hwmon: Add "label" attribute"). But 
now that I know it exists I can carry it as a local patch until we next 
update.

Thanks,
Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hwmon: label vs temp%d_label
  2024-04-02 21:22   ` Chris Packham
@ 2024-04-02 21:57     ` Chris Packham
  2024-04-02 22:17       ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2024-04-02 21:57 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: jdelvare, linux-hwmon, linux-kernel


On 3/04/24 10:22, Chris Packham wrote:
>
> On 3/04/24 09:59, Guenter Roeck wrote:
>> 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 ?
>
> I have not. But in my defense I'm also using an older kernel LTS that 
> doesn't have commit e1c9d6d61ddf ("hwmon: Add "label" attribute"). But 
> now that I know it exists I can carry it as a local patch until we 
> next update.

Related is there an lm-sensors change that uses this attribute for 
display purposes?

I do have a couple of PRs open on the lm-sensors github project I'd like 
to see merged but given recent events this should absolutely not be 
construed as a criticism of anyone maintaining lm-sensors merely a query 
as to whether PRs are the right path for changes or if they should be 
sent to a mailing list somewhere.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hwmon: label vs temp%d_label
  2024-04-02 21:57     ` Chris Packham
@ 2024-04-02 22:17       ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2024-04-02 22:17 UTC (permalink / raw)
  To: Chris Packham; +Cc: jdelvare, linux-hwmon, linux-kernel

On Tue, Apr 02, 2024 at 09:57:44PM +0000, Chris Packham wrote:
> 
> On 3/04/24 10:22, Chris Packham wrote:
> >
> > On 3/04/24 09:59, Guenter Roeck wrote:
> >> 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 ?
> >
> > I have not. But in my defense I'm also using an older kernel LTS that 
> > doesn't have commit e1c9d6d61ddf ("hwmon: Add "label" attribute"). But 
> > now that I know it exists I can carry it as a local patch until we 
> > next update.
> 
> Related is there an lm-sensors change that uses this attribute for 
> display purposes?
> 
Sorry, I don't know. I stopped paying attention to the lm-sensors package
a long time ago, and I don't know its status. I just don't have the time.

> I do have a couple of PRs open on the lm-sensors github project I'd like 
> to see merged but given recent events this should absolutely not be 
> construed as a criticism of anyone maintaining lm-sensors merely a query 
> as to whether PRs are the right path for changes or if they should be 
> sent to a mailing list somewhere.
> 
I have no idea, sorry.

Guenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-02 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 20:24 hwmon: label vs temp%d_label Chris Packham
2024-04-02 20:59 ` Guenter Roeck
2024-04-02 21:22   ` Chris Packham
2024-04-02 21:57     ` Chris Packham
2024-04-02 22:17       ` Guenter Roeck

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®