hwmon: (ina3221) Add voltage conversion time settings
authorNicolin Chen <nicoleotsuka@gmail.com>
Wed, 17 Apr 2019 23:12:10 +0000 (16:12 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 18 Apr 2019 13:44:11 +0000 (06:44 -0700)
commit023912dbb80f5faf7a028aad6562774472d82a5a
tree906ecb878ef4645ad71f1b33f84ed46e2514d2bf
parent521c0b6116ef60e4b96ba42dbf285b2ad69071d4
hwmon: (ina3221) Add voltage conversion time settings

The CONFIG register has two 3-bit fields for conversion time
settings of Bus-voltage and Shunt-voltage, respectively. The
conversion settings, along with averaging mode, allow users
to optimize available timing requirement.

This patch adds an 'update_interval' sysfs node through the
hwmon_chip_info of hwmon core. It reflects a total hardware
conversion time:
    samples * channels * (Bus + Shunt conversion times)

Though INA3221 supports different conversion time setups for
Bus and Shunt voltages, this patch only adds the support of
a unified setting for both conversion times, by dividing the
conversion time into two equal values.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
[groeck: .rst related formatting changes in documentation]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/ina3221.rst
drivers/hwmon/ina3221.c