hwmon: (ina2xx) implement update_interval attribute for ina226
Subsystems (2)
PATCH v3 1/1 hwmon: (ina2xx) implement update_interval attribute for ina226
This attribute allows to configure the update interval of ina226. Although the bus and shunt voltage conversion times remain hardcoded to 1.1 ms, we can now modify said interval by changing the averaging rate.
While we're at it - add an additional variable to ina2xx_data, which holds the current configuration settings - this way we'll be able to restore the configuration in case of an unexpected chip reset.
--- Documentation/hwmon/ina2xx | 7 ++ drivers/hwmon/ina2xx.c | 164 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 165 insertions(+), 6 deletions(-)
Documentation/hwmon/ina2xx +7 -0
@@ -48,3 +48,10 @@ The shunt value in micro-ohms can be set via platform data or device tree at compile-time or via the shunt_resistor attribute in sysfs at run-time. Please refer to the Documentation/devicetree/bindings/i2c/ina2xx.txt for bindings if the device tree is used. + +Additionally ina226 supports update_interval attribute as described in +Documentation/hwmon/sysfs-interface. Internally the interval is the sum of +bus and shunt voltage conversion times multiplied by the averaging rate. We +don't touch the conversion times and only modify the number of averages. The +lower limit of the update_interval is 2 ms, the upper limit is 2253 ms. +The actual programmed interval may vary from the desired value.
drivers/hwmon/ina2xx.c +158 -6
243 lines not on this page · raw message
Signature · 7 lines
2.1.3 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Bartosz Golaszewski
This attribute allows to configure the update interval of ina226. Although the bus and shunt voltage conversion times remain hardcoded to 1.1 ms, we can now modify said interval by changing the averaging rate.
While we're at it - add an additional variable to
ina2xx_data, which holds the current configuration settings - this way we'll be able to restore the configuration in case of an unexpected chip reset.Signed-off-by Bartosz Golaszewski <[email protected]>
Applied to -next.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors