[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7376d6a7-9e12-41ae-85ce-957294f140f6@kernel.org>
Date: Wed, 5 Nov 2025 07:56:32 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Igor Reznichenko <igor@...nichenko.net>
Cc: conor+dt@...nel.org, corbet@....net, david.hunter.linux@...il.com,
devicetree@...r.kernel.org, krzk+dt@...nel.org, linux-doc@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
linux@...ck-us.net, robh@...nel.org, skhan@...uxfoundation.org
Subject: Re: [PATCH v3 1/2] dt-bindings: hwmon: ST TSC1641 power monitor
On 04/11/2025 17:30, Igor Reznichenko wrote:
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> + - |
>>> + #include <dt-bindings/interrupt-controller/irq.h>
>>> +
>>> + i2c {
>>> + #address-cells = <1>;
>>> + #size-cells = <0>;
>>> +
>>> + power-sensor@40 {
>>> + compatible = "st,tsc1641";
>>> + reg = <0x40>;
>>> + interrupt-parent = <&gpio1>;
>>> + interrupts = <1 IRQ_TYPE_LEVEL_LOW>; /* Polarity board dependent */
>>> + shunt-resistor-micro-ohms = <1000>;
>>> + st,alert-polarity-active-high;
>>
>> That's wrong IMO. Either you use it as SMBus alert or as CPU interrupt.
>> If you use as CPU interrupt, then the flag in "interrupts" defines what
>> is the level of this interrupt. That flag is a combination of both
>> CPU/SoC side and any inverters on the device. And actually you wrote it
>> already - "Polarity board dependent" - so why do you:
>> 1. Provide polarity twice
>> 2. Provide inconsistent values - alert interrupt is level low, but
>> alert interrupt is also active (level) high. So level low or level high?
>
> I tried to illustrate both in one example, but I can see how this is confusing.
> Will it work if I split the interrupt part into separate example?
>
No need for another example, just drop the interrupts here.
Best regards,
Krzysztof
Powered by blists - more mailing lists