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, Ninad Malwade <nmalwade@nvidia.com>,
Rajkumar Kasirajan <rkasirajan@nvidia.com>
Subject: Re: [PATCH V5 3/4] hwmon: ina3221: Add support for channel summation disable
Date: Wed, 11 Oct 2023 09:15:38 +0100 [thread overview]
Message-ID: <dcd1d1b2-81fe-4d25-b1c4-cc3f89c44151@nvidia.com> (raw)
In-Reply-To: <20230929103650.86074-4-jonathanh@nvidia.com>
Hi Jean, Guenter,
On 29/09/2023 11:36, Jon Hunter wrote:
> From: Ninad Malwade <nmalwade@nvidia.com>
>
> The INA3221 allows the Critical alert pin to 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, we have to use the
> same shunt-resistor value on all included channels. Unless equal
> shunt-resistor values are used for each channel, the summation control
> function cannot be used and it is not enabled by the driver.
>
> To address this, add support to disable the summation of specific
> channels via device tree property "ti,summation-disable". The channel
> which has this property would be excluded from the calculation of
> summation control function.
>
> For example, summation control function calculates Shunt-Voltage Sum as:
>
> - input_shunt_voltage_summation = input_shunt_voltage_channel1
> + input_shunt_voltage_channel2
> + input_shunt_voltage_channel3
>
> If we want the summation to only use channel1 and channel3, we can add
> 'ti,summation-disable' property in device tree node for channel2. Then
> the calculation will skip channel2.
>
> - input_shunt_voltage_summation = input_shunt_voltage_channel1
> + input_shunt_voltage_channel3
>
> Note that we only want the channel to be skipped for summation control
> function rather than completely disabled. Therefore, even if we add the
> property 'ti,summation-disable', the channel is still enabled and
> functional.
>
> Finally, create debugfs entries that display if summation is disabled
> for each of the channels.
>
> Signed-off-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
> Signed-off-by: Ninad Malwade <nmalwade@nvidia.com>
> Co-developed-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Any feedback on this?
Thanks
Jon
--
nvpublic
next prev parent reply other threads:[~2023-10-11 8:15 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 ` [PATCH V5 2/4] dt-bindings: hwmon: ina3221: Add ti,summation-disable Jon Hunter
2023-10-02 17:20 ` 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 [this message]
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=dcd1d1b2-81fe-4d25-b1c4-cc3f89c44151@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=rkasirajan@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).