summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/bcm_iproc_adc.c
diff options
context:
space:
mode:
authorMaciej Purski <m.purski@samsung.com>2017-12-18 09:43:58 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-08 16:03:42 +0100
commita28caa7b8fe19ac2c31b7630772107e0d50ce18e (patch)
treef7f4354c6d215542c99896b8701ddf8106f09d56 /drivers/iio/adc/bcm_iproc_adc.c
parentbbdcbd12a59a6306623ea5184e42a514e420b2e9 (diff)
iio: adc: 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) This is a part of the patchset: https://lkml.org/lkml/2017/11/22/394 Signed-off-by: Maciej Purski <m.purski@samsung.com> Reviewed-by: Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/adc/bcm_iproc_adc.c')
0 files changed, 0 insertions, 0 deletions