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

dt-bindings: hwmon: ina3221: Add ti,summation-disable

The INA3221 has a critical alert pin that can be controlled by the
summation control function. This function adds the single
shunt-voltage conversions for the desired channels in order to
compare the combined sum to the programmed limit. The Shunt-Voltage
Sum Limit register contains the programmed value that is compared
to the value in the Shunt-Voltage Sum register in order to
determine if the total summed limit is exceeded. If the
shunt-voltage sum limit value is exceeded, the critical alert pin
pulls low.

For the summation limit to have a meaningful value, it is necessary
to use the same shunt-resistor value on all included channels. Add a new
vendor specific property, 'ti,summation-disable', to allow specific
channels to be excluded from the summation control function if the shunt
resistor is different to other channels or the channel should not be
considered for triggering the critical alert pin.

Note that the ina3221 has always supported summing the various input
channels and summation is enabled by default if the shunt-resistor
values are the same. This change simply provides a way to exclude
inputs from the summation. If this property is not populated, then the
functionality of the driver does not change.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230929103650.86074-3-jonathanh@nvidia.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Jon Hunter and committed by
Guenter Roeck
13ab5fdc 81b75e33

+19
+19
Documentation/devicetree/bindings/hwmon/ti,ina3221.yaml
··· 58 58 shunt-resistor-micro-ohms: 59 59 description: shunt resistor value in micro-Ohm 60 60 61 + ti,summation-disable: 62 + description: | 63 + The INA3221 has a critical alert pin that can be controlled by the 64 + summation control function. This function adds the single 65 + shunt-voltage conversions for the desired channels in order to 66 + compare the combined sum to the programmed limit. The Shunt-Voltage 67 + Sum Limit register contains the programmed value that is compared 68 + to the value in the Shunt-Voltage Sum register in order to 69 + determine if the total summed limit is exceeded. If the 70 + shunt-voltage sum limit value is exceeded, the critical alert pin 71 + is asserted. 72 + 73 + For the summation limit to have a meaningful value, it is necessary 74 + to use the same shunt-resistor value on all enabled channels. If 75 + this is not the case or if a channel should not be used for 76 + triggering the critical alert pin, then this property can be used 77 + exclude specific channels from the summation control function. 78 + type: boolean 79 + 61 80 required: 62 81 - reg 63 82