Skip to contentSkip to conversation

docs: hwmon: (lm75) Add section for sysfs interface

PATCH Applied Flaviu Nistor 3 participants 3 messages Apr 17 – Apr 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: hwmon: (lm75) Add section for sysfs interface

Similar to other HWMON sensors add a section in the documentation describing the sysfs attributes, their permissions and a short description.

---
 Documentation/hwmon/lm75.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/hwmon/lm75.rst +16 -0
index 4269da04508e..288cf8485ea6 100644
@@ -181,3 +181,19 @@ is supported by this driver, other specific enhancements are not.
 
 The LM77 is not supported, contrary to what we pretended for a long time.
 Both chips are simply not compatible, value encoding differs.
+
+sysfs-Interface
+---------------
+
+The following list includes the sysfs attributes that the driver provides, their
+permissions and a short description:
+
+=============================== ======= ===========================================
+Name                            Perm    Description
+=============================== ======= ===========================================
+temp1_input:                    RO      Temperature input
+temp1_label:                    RO      Descriptive name for the sensor
+temp1_max:                      RW      Maximum temperature
+temp1_max_hyst:                 RW      Maximum hysteresis temperature
+update_interval                 RW      Update conversions interval in milliseconds
+=============================== ======= ===========================================
Signature · 1 line
2.34.1
#1 lore raw
Sashiko AI review found 3 potential issue(s): - [Low] Missing `temp1_alarm` sysfs attribute in the documentation. - [Low] Inaccurate permissions documented for `update_interval`. - [Low] Extraneous…

Sashiko AI review found 3 potential issue(s):
- [Low] Missing temp1_alarm sysfs attribute in the documentation.
- [Low] Inaccurate permissions documented for update_interval.
- [Low] Extraneous trailing colons in sysfs attribute names. --

commit c1dce0b929df71ecb8a78067d9800bb8e1c93d8f
Author: Flaviu Nistor <[email protected]>

docs: hwmon: (lm75) Add section for sysfs interface

This commit adds a new section to the lm75 documentation detailing the sysfs attributes, their permissions, and brief descriptions.

Quoted 4 lines
Documentation/hwmon/lm75.rst +0 -0
index 4269da04508ef..288cf8485ea61 100644

[ ... ]

Documentation/hwmon/lm75.rst is supported by this driver, other specific enhancements are not. · line 197

Quoted 13 lines
Documentation/hwmon/lm75.rst +13 -0
+sysfs-Interface
+---------------
+
+The following list includes the sysfs attributes that the driver provides, their
+permissions and a short description:
+
+=============================== ======= ===========================================
+Name                            Perm    Description
+=============================== ======= ===========================================
+temp1_input:                    RO      Temperature input
+temp1_label:                    RO      Descriptive name for the sensor
+temp1_max:                      RW      Maximum temperature
+temp1_max_hyst:                 RW      Maximum hysteresis temperature

This isn't a bug, but should the trailing colons on these attribute names be removed? Sysfs filenames do not contain colons, and the update_interval attribute below correctly omits it.

Quoted 1 line

+update_interval RW Update conversions interval in milliseconds

Is update_interval always read/write? Looking at lm75_is_visible() in the driver, it appears to only grant write permissions (0644) if the device supports multiple sample times. For chips with a single fixed sample time, the attribute is restricted to read-only (0444). Could the documentation reflect this conditional permission?

Quoted 1 line

+=============================== ======= ===========================================

Should temp1_alarm be included in this list? The driver code exposes HWMON_T_ALARM as read-only for chips that support it (such as the as6200 and tmp112), so the current documentation seems slightly incomplete without it.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#2 lore raw
In reply to Flaviu Nistor
Quoted 5 lines · Flaviu Nistor

Similar to other HWMON sensors add a section in the documentation describing the sysfs attributes, their permissions and a short description.

Applied, after removing the trailing ":" in attribute names.

Guenter

Quoted 28 lines
---
 Documentation/hwmon/lm75.rst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/hwmon/lm75.rst +16 -0
index 4269da04508e..288cf8485ea6 100644
@@ -181,3 +181,19 @@ is supported by this driver, other specific enhancements are not.
 
 The LM77 is not supported, contrary to what we pretended for a long time.
 Both chips are simply not compatible, value encoding differs.
+
+sysfs-Interface
+---------------
+
+The following list includes the sysfs attributes that the driver provides, their
+permissions and a short description:
+
+=============================== ======= ===========================================
+Name                            Perm    Description
+=============================== ======= ===========================================
+temp1_input:                    RO      Temperature input
+temp1_label:                    RO      Descriptive name for the sensor
+temp1_max:                      RW      Maximum temperature
+temp1_max_hyst:                 RW      Maximum hysteresis temperature
+update_interval                 RW      Update conversions interval in milliseconds
+=============================== ======= ===========================================