diff options
author | Maciej Purski <m.purski@samsung.com> | 2017-11-22 18:32:15 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2018-01-03 02:05:34 +0300 |
commit | 5d389b125186cf254ad5b8015763ac07c151aea4 (patch) | |
tree | f29d66a4392038fb1803589ef2cc1101c8b93b15 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | cf583b4275761754638c946ff777546d1a9b6744 (diff) | |
download | linux-5d389b125186cf254ad5b8015763ac07c151aea4.tar.xz |
hwmon: (ina2xx) Make calibration register value fixed
Calibration register is used for calculating current register in
hardware according to datasheet:
current = shunt_volt * calib_register / 2048 (ina 226)
current = shunt_volt * calib_register / 4096 (ina 219)
Fix calib_register value to 2048 for ina226 and 4096 for ina 219 in
order to avoid truncation error and provide best precision allowed
by shunt_voltage measurement. Make current scale value follow changes
of shunt_resistor from sysfs as calib_register value is now fixed.
Power_lsb value should also follow shunt_resistor changes as stated in
datasheet:
power_lsb = 25 * current_lsb (ina 226)
power_lsb = 20 * current_lsb (ina 219)
Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions