From: Guenter Roeck <linux@roeck-us.net>
To: Rob Herring <robh@kernel.org>, Alexey Charkov <alchark@flipper.net>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Subject: Re: [PATCH v5 0/2] Add support for Texas Instruments INA4230 power monitor
Date: Wed, 1 Apr 2026 07:50:06 -0700 [thread overview]
Message-ID: <9ee56bb2-6f46-49de-bf01-b687bc32393e@roeck-us.net> (raw)
In-Reply-To: <CAL_JsqJcqMM1LK1dEFvjRWdOc8g=7+G4VvF-jmzbSJ1ijBB=1A@mail.gmail.com>
On 4/1/26 07:03, Rob Herring wrote:
> On Tue, Mar 31, 2026 at 11:46 AM Alexey Charkov <alchark@flipper.net> wrote:
>>
>> On Tue, Mar 31, 2026 at 8:10 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>>
>>> On 3/31/26 08:52, Rob Herring wrote:
>>>> On Mon, Mar 30, 2026 at 09:07:32AM -0700, Guenter Roeck wrote:
>>>>> On 3/30/26 08:14, Alexey Charkov wrote:
>>>>>> TI INA4230 is a 4-channel power monitor with I2C interface, similar in
>>>>>> operation to INA3221 (3-channel) and INA219 (single-channel) but with
>>>>>> a different register layout, different alerting mechanism and slightly
>>>>>> different support for directly reading calculated current/power/energy
>>>>>> values (pre-multiplied by the device itself and needing only to be scaled
>>>>>> by the driver depending on its selected LSB unit values).
>>>>>>
>>>>>> In this initial implementation, the driver supports reading voltage,
>>>>>> current, power and energy values, but does not yet support alerts, which
>>>>>> can be added separately if needed. Also the overflows during hardware
>>>>>> calculations are not yet handled, nor is the support for the device's
>>>>>> internal 32-bit energy counter reset.
>>>>>>
>>>>>> An example device tree using this binding and driver is available at [1]
>>>>>> (not currently upstreamed, as the device in question is in engineering
>>>>>> phase and not yet publicly available)
>>>>>>
>>>>>> [1] https://github.com/flipperdevices/flipper-linux-kernel/blob/flipper-devel/arch/arm64/boot/dts/rockchip/rk3576-flipper-one-rev-f0b0c1.dts
>>>>>>
>>>>>> Signed-off-by: Alexey Charkov <alchark@flipper.net>
>>>>>> ---
>>>>>> Changes in v5:
>>>>>> - Reworded per-channel subnodes description in the binding for clarity (Sashiko)
>>>>>> - NB: Sashiko's suggestion to allow interrupts in the binding sounds premature,
>>>>>> as the alerts mechanism is not implemented yet and there are no known users
>>>>>> to test it. If anyone has hardware with the alert pins wired to an interrupt
>>>>>> line - please shout and we can test/extend it together
>>>>>
>>>>> The bindings are supposed to be complete, even if not implemented, so I am not sure
>>>>> if the DT maintainers will agree here. We'll see.
>>>>
>>>> Given ti,alert-polarity-active-high is added seems like the interrupt
>>>> should be too. And the interrupt can specify the polarity, so is that
>>>> property really needed? There's alway the possibility that you have some
>>>> inverter on the board too and the interrupt polarity is not enough, but
>>>> solve that problem when it actually exists.
>>>>
>>>
>>> The alert pin can be attached to a board interrupt, or (more likely) it can
>>> be attached to the I2C controller's alert pin. In the latter case there is
>>> no interrupt property.
>>
>> Alright, I will add the interrupt property and keep the dedicated flag
>> for alert polarity.
>>
>> Following the logic of binding completeness, should I add a flag for
>> the single-shot mode too, even though I dropped that functionality
>> from the driver in one of the prior iterations?
>
> I don't remember what that was exactly, but that sounds like a user
> selection which would be some sysfs or other runtime control rather
> than in DT. Unless the h/w design dictates what mode should be used.
>
I agree. I can not imagine that to be a hardware design constraint.
Thanks,
Guenter
prev parent reply other threads:[~2026-04-01 14:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 15:14 Alexey Charkov
2026-03-30 15:14 ` [PATCH v5 1/2] dt-bindings: hwmon: Add TI INA4230 4-channel I2C " Alexey Charkov
2026-03-30 15:14 ` [PATCH v5 2/2] hwmon: Add support for TI INA4230 " Alexey Charkov
2026-03-30 18:39 ` Guenter Roeck
2026-03-30 16:07 ` [PATCH v5 0/2] Add support for Texas Instruments " Guenter Roeck
2026-03-31 15:52 ` Rob Herring
2026-03-31 16:10 ` Guenter Roeck
2026-03-31 16:46 ` Alexey Charkov
2026-04-01 14:03 ` Rob Herring
2026-04-01 14:50 ` Guenter Roeck [this message]
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=9ee56bb2-6f46-49de-bf01-b687bc32393e@roeck-us.net \
--to=linux@roeck-us.net \
--cc=alchark@flipper.net \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/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
all inboxes | Powered by JetHome®