Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property

Add a property to the binding to define the selected shunt voltage gain.
This specifies the range and accuracy that applies to the shunt circuit.
This property only applies to devices that have a selectable shunt
voltage range via PGA or ADCRANGE register configuration.

Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211102052754.817220-2-nathan@nathanrossi.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Nathan Rossi and committed by
Guenter Roeck
8be23b9b ed68a0ef

+21
+21
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
··· 36 36 Shunt resistor value in micro-Ohm. 37 37 $ref: /schemas/types.yaml#/definitions/uint32 38 38 39 + ti,shunt-gain: 40 + description: | 41 + Programmable gain divisor for the shunt voltage accuracy and range. This 42 + property only applies to devices that have configurable PGA/ADCRANGE. The 43 + gain value is used configure the gain and to convert the shunt voltage, 44 + current and power register values when reading measurements from the 45 + device. 46 + 47 + For devices that have a configurable PGA (e.g. INA209, INA219, INA220), 48 + the gain value maps directly with the PG bits of the config register. 49 + 50 + For devices that have ADCRANGE configuration (e.g. INA238) a shunt-gain 51 + value of 1 maps to ADCRANGE=1 where no gain divisor is applied to the 52 + shunt voltage, and a value of 4 maps to ADCRANGE=0 such that a wider 53 + voltage range is used. 54 + 55 + The default value is device dependent, and is defined by the reset value 56 + of PGA/ADCRANGE in the respective configuration registers. 57 + $ref: /schemas/types.yaml#/definitions/uint32 58 + enum: [1, 2, 4, 8] 59 + 39 60 required: 40 61 - compatible 41 62 - reg