hwmon: (ltc2990) support all measurement modes

Updated version of the ltc2990 driver which supports all measurement
modes (current, voltage, temperature) available in the chip.

If devicetree is used, the mode must be specified with the property
"lltc,meas-mode". The format and possible values of the property are
described in the binding.

If devicetree is not used, the mode of the chip will not be configured.
Unless the chip is configured by another source, only the internal
temperature and supply voltage will be measured.

Signed-off-by: Tom Levens <tom.levens@cern.ch>
Tested-By: mike.looijmans@topic.nl
[groeck: Fixed compiler warning]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Tom Levens
2017-07-03 06:29:00 +02:00
committed by Guenter Roeck
parent 7de859fcf9
commit 5d9ca430ea
3 changed files with 185 additions and 42 deletions

View File

@@ -8,6 +8,7 @@ Supported chips:
Datasheet: http://www.linear.com/product/ltc2990
Author: Mike Looijmans <mike.looijmans@topic.nl>
Tom Levens <tom.levens@cern.ch>
Description
@@ -16,10 +17,8 @@ Description
LTC2990 is a Quad I2C Voltage, Current and Temperature Monitor.
The chip's inputs can measure 4 voltages, or two inputs together (1+2 and 3+4)
can be combined to measure a differential voltage, which is typically used to
measure current through a series resistor, or a temperature.
This driver currently uses the 2x differential mode only. In order to support
other modes, the driver will need to be expanded.
measure current through a series resistor, or a temperature with an external
diode.
Usage Notes
@@ -32,12 +31,19 @@ devices explicitly.
Sysfs attributes
----------------
in0_input Voltage at Vcc pin in millivolt (range 2.5V to 5V)
temp1_input Internal chip temperature in millidegrees Celcius
A subset of the following attributes are visible, depending on the measurement
mode of the chip.
in[1-4]_input Voltage at V[1-4] pin in millivolt
temp2_input External temperature sensor TR1 in millidegrees Celcius
temp3_input External temperature sensor TR2 in millidegrees Celcius
curr1_input Current in mA across V1-V2 assuming a 1mOhm sense resistor
curr2_input Current in mA across V3-V4 assuming a 1mOhm sense resistor
The "curr*_input" measurements actually report the voltage drop across the
input pins in microvolts. This is equivalent to the current through a 1mOhm
sense resistor. Divide the reported value by the actual sense resistor value
in mOhm to get the actual value.
in0_input Voltage at Vcc pin in millivolt (range 2.5V to 5V)
temp1_input Internal chip temperature in millidegrees Celcius
curr1_input Current in mA across v1-v2 assuming a 1mOhm sense resistor.
curr2_input Current in mA across v3-v4 assuming a 1mOhm sense resistor.