mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
023912dbb8
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>
63 lines
2.3 KiB
ReStructuredText
63 lines
2.3 KiB
ReStructuredText
Kernel driver ina3221
|
|
=====================
|
|
|
|
Supported chips:
|
|
|
|
* Texas Instruments INA3221
|
|
|
|
Prefix: 'ina3221'
|
|
|
|
Addresses: I2C 0x40 - 0x43
|
|
|
|
Datasheet: Publicly available at the Texas Instruments website
|
|
|
|
http://www.ti.com/
|
|
|
|
Author: Andrew F. Davis <afd@ti.com>
|
|
|
|
Description
|
|
-----------
|
|
|
|
The Texas Instruments INA3221 monitors voltage, current, and power on the high
|
|
side of up to three D.C. power supplies. The INA3221 monitors both shunt drop
|
|
and supply voltage, with programmable conversion times and averaging, current
|
|
and power are calculated host-side from these.
|
|
|
|
Sysfs entries
|
|
-------------
|
|
|
|
======================= =======================================================
|
|
in[123]_label Voltage channel labels
|
|
in[123]_enable Voltage channel enable controls
|
|
in[123]_input Bus voltage(mV) channels
|
|
curr[123]_input Current(mA) measurement channels
|
|
shunt[123]_resistor Shunt resistance(uOhm) channels
|
|
curr[123]_crit Critical alert current(mA) setting, activates the
|
|
corresponding alarm when the respective current
|
|
is above this value
|
|
curr[123]_crit_alarm Critical alert current limit exceeded
|
|
curr[123]_max Warning alert current(mA) setting, activates the
|
|
corresponding alarm when the respective current
|
|
average is above this value.
|
|
curr[123]_max_alarm Warning alert current limit exceeded
|
|
in[456]_input Shunt voltage(uV) for channels 1, 2, and 3 respectively
|
|
samples Number of samples using in the averaging mode.
|
|
|
|
Supports the list of number of samples:
|
|
|
|
1, 4, 16, 64, 128, 256, 512, 1024
|
|
|
|
update_interval Data conversion time in millisecond, following:
|
|
|
|
update_interval = C x S x (BC + SC)
|
|
|
|
* C: number of enabled channels
|
|
* S: number of samples
|
|
* BC: bus-voltage conversion time in millisecond
|
|
* SC: shunt-voltage conversion time in millisecond
|
|
|
|
Affects both Bus- and Shunt-voltage conversion time.
|
|
Note that setting update_interval to 0ms sets both BC
|
|
and SC to 140 us (minimum conversion time).
|
|
======================= =======================================================
|