summaryrefslogtreecommitdiff
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2025-08-30 21:48:29 -0700
committerGuenter Roeck <linux@roeck-us.net>2025-09-07 16:34:29 -0700
commit7e420b6a274206f339fe3617943ba1ef9dd1fcb0 (patch)
tree2ba2907ceaf868ea3625e569c67917ce078b7207 /rust/helpers/helpers.c
parent4a4fcd611295af96af51574b31f9e19e7505f965 (diff)
hwmon: (ina238) Simplify voltage register accesses
Calculate voltage LSB values in the probe function and use throughout the code. Use a single function to read all voltages, independently of the register width. Use the pre-calculated LSB values to convert register values to voltages and do not rely on runtime chip specific code. Use ROUND_CLOSEST functions instead of divide operations to reduce rounding errors. Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions