Skip to contentSkip to conversation

hwmon: (tmp102) add support for update interval

PATCH Applied Flaviu Nistor 2 participants 2 messages Apr 3

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

PATCH v3 1/1 hwmon: (tmp102) add support for update interval

Since the sensor supports different sampling intervals via bits CR0 and CR1 from the CONFIG register, add support in order for the conversion rate to be changed from user space. Default is 4 conv/sec.

---
Changes in v3:
- Implement all changes suggested inline by Guenter Roeck.
- Fixed identified issues from link provided by Guenter Roeck:
https://sashiko.dev/#/patchset/20260401164701.18456-1-flaviu.nistor%40gmail.com
- Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Implement all changes suggested inline by Guenter Roeck.
- Fixed identified issues from link provided by Guenter Roeck:
https://sashiko.dev/#/patchset/20260331175418.16145-1-flaviu.nistor%40gmail.com
- Link to v1: https://lore.kernel.org/all/[email protected]/

 Documentation/hwmon/tmp102.rst |  19 ++++-
 drivers/hwmon/tmp102.c         | 128 +++++++++++++++++++++++++++------
 2 files changed, 123 insertions(+), 24 deletions(-)
Documentation/hwmon/tmp102.rst +16 -3
index 3c2cb5bab1e9..425a09a3c9b3 100644
@@ -41,12 +41,25 @@ degree from -40 to +125 C. Resolution of the sensor is 0.0625 degree.  The
 operating temperature has a minimum of -55 C and a maximum of +150 C.
 
 The TMP102 has a programmable update rate that can select between 8, 4, 1, and
-0.5 Hz. (Currently the driver only supports the default of 4 Hz).
+0.25 Hz.
 
 The TMP110 and TMP113 are software compatible with TMP102, but have different
 accuracy (maximum error) specifications. The TMP110 has an accuracy (maximum error)
 of 1.0 degree, TMP113 has an accuracy (maximum error) of 0.3 degree, while TMP102
 has an accuracy (maximum error) of 2.0 degree.
 
-The driver provides the common sysfs-interface for temperatures (see
-Documentation/hwmon/sysfs-interface.rst under Temperatures).
+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
+=============================== ======= ===========================================
drivers/hwmon/tmp102.c +107 -21

180 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Flaviu Nistor

Since the sensor supports different sampling intervals via bits CR0 and CR1 from the CONFIG register, add support in order for the conversion rate to be changed from user space. Default is 4 conv/sec.

Applied.

Thanks,
Guenter