mbox series

[0/2] hwmon: Add "label" attribute

Message ID 20211221175029.144906-1-paul@crapouillou.net (mailing list archive)
Headers show
Series hwmon: Add "label" attribute | expand

Message

Paul Cercueil Dec. 21, 2021, 5:50 p.m. UTC
Hi Jean, Guenter, Rob,

This patchset adds support for specifying a hwmon device's label from
Device Tree. When the "label" device property is present, its value is
exported to the userspace via the "label" sysfs attribute.

This is useful for userspace to be able to identify an individual device
when multiple individual chips are present in the system.

Note that this mechanism already exists in IIO.

Patch [1/2] adds the "label" property to a new
dt-bindings/hwmon/common.yaml file.

Patch [2/2] adds the change to the core drivers/hwmon/hwmon.c file.

Cheers,
-Paul

Paul Cercueil (2):
  dt-bindings: hwmon: Introduce common properties
  hwmon: Add "label" attribute

 .../devicetree/bindings/hwmon/common.yaml     | 31 +++++++++++++++++++
 drivers/hwmon/hwmon.c                         | 22 ++++++++++++-
 2 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/common.yaml