devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	"Rob Herring" <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: <linux-hwmon@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-tegra@vger.kernel.org>, Jon Hunter <jonathanh@nvidia.com>,
	"Ninad Malwade" <nmalwade@nvidia.com>
Subject: [PATCH V5 2/4] dt-bindings: hwmon: ina3221: Add ti,summation-disable
Date: Fri, 29 Sep 2023 11:36:48 +0100	[thread overview]
Message-ID: <20230929103650.86074-3-jonathanh@nvidia.com> (raw)
In-Reply-To: <20230929103650.86074-1-jonathanh@nvidia.com>

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>
---
 .../devicetree/bindings/hwmon/ti,ina3221.yaml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina3221.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina3221.yaml
index 0fd8ae5f6a22..5f10f1207d69 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina3221.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina3221.yaml
@@ -58,6 +58,25 @@ patternProperties:
       shunt-resistor-micro-ohms:
         description: shunt resistor value in micro-Ohm
 
+      ti,summation-disable:
+        description: |
+          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
+          is asserted.
+
+          For the summation limit to have a meaningful value, it is necessary
+          to use the same shunt-resistor value on all enabled channels. If
+          this is not the case or if a channel should not be used for
+          triggering the critical alert pin, then this property can be used
+          exclude specific channels from the summation control function.
+        type: boolean
+
     required:
       - reg
 
-- 
2.34.1


  parent reply	other threads:[~2023-09-29 10:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 10:36 [PATCH V5 0/4] hwmon: ina3221: Add selective summation support Jon Hunter
2023-09-29 10:36 ` [PATCH V5 1/4] dt-bindings: hwmon: ina3221: Convert to json-schema Jon Hunter
2023-10-02 17:19   ` Rob Herring
2023-10-26  0:58   ` Guenter Roeck
2023-09-29 10:36 ` Jon Hunter [this message]
2023-10-02 17:20   ` [PATCH V5 2/4] dt-bindings: hwmon: ina3221: Add ti,summation-disable Rob Herring
2023-10-26  0:59   ` Guenter Roeck
2023-09-29 10:36 ` [PATCH V5 3/4] hwmon: ina3221: Add support for channel summation disable Jon Hunter
2023-10-11  8:15   ` Jon Hunter
2023-10-26  0:59   ` Guenter Roeck
2023-09-29 10:36 ` [PATCH V5 4/4] arm64: tegra: Add power-sensors for Tegra234 boards Jon Hunter
2023-10-11 20:28 ` [PATCH V5 0/4] hwmon: ina3221: Add selective summation support Thierry Reding
2023-10-25 10:54   ` Jon Hunter
2023-10-13 12:36 ` (subset) " Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230929103650.86074-3-jonathanh@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nmalwade@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).