devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: cy_huang@richtek.com, sre@kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org
Cc: chiaen_wu@richtek.com, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: power: supply: Fix rt9467 charger enable gpio active level
Date: Wed, 31 May 2023 11:17:37 +0200	[thread overview]
Message-ID: <1f966e93-50c3-142e-620c-8fbb16e9b1a7@linaro.org> (raw)
In-Reply-To: <1685522813-14481-1-git-send-email-cy_huang@richtek.com>

On 31/05/2023 10:46, cy_huang@richtek.com wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
> 
> The RT9467 charger enable pin is an external signal that used to enable
> battery charging. From the datasheet, the active level is low. Although
> it's already configured to logic low at driver probe function, but the

NAK.

You mix two different things. Driver behavior and DTS. Driver can
operate either on real level - matching hardware - or on logical level
(high as enable, low as disable). First choice is usually wrong, because
it does not allow inverted signals.

'Correcting' bindings to wrong approach is wrong. If the signal is
active low, then the flag is active low. Simple as that.

> current binding example declared it as 'GPIO_ACTIVE_LOW', this causes
> this pin be output high and disable battery charging.
> 
> Fixes: e1b4620fb503 ("dt-bindings: power: supply: Add Richtek RT9467 battery charger")
> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
> ---
> Hi,
> 
>   This patch is to fix the active level for charger enable gpio polarity.

This is just example - it does not fix anything...

> Currently, the wrong active level makes the user confused and
> unexpectedly disable battery charging by default.
> ---
>  Documentation/devicetree/bindings/power/supply/richtek,rt9467.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/richtek,rt9467.yaml b/Documentation/devicetree/bindings/power/supply/richtek,rt9467.yaml
> index 3723717..cdc7678 100644
> --- a/Documentation/devicetree/bindings/power/supply/richtek,rt9467.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/richtek,rt9467.yaml
> @@ -69,7 +69,7 @@ examples:
>          reg = <0x5b>;
>          wakeup-source;
>          interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>;
> -        charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>;
> +        charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_HIGH>;
>  
>          rt9467_otg_vbus: usb-otg-vbus-regulator {
>            regulator-name = "rt9467-usb-otg-vbus";

Best regards,
Krzysztof


  reply	other threads:[~2023-05-31  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  8:46 [PATCH] dt-bindings: power: supply: Fix rt9467 charger enable gpio active level cy_huang
2023-05-31  9:17 ` Krzysztof Kozlowski [this message]
2023-05-31  9:36   ` ChiYuan Huang

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=1f966e93-50c3-142e-620c-8fbb16e9b1a7@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=chiaen_wu@richtek.com \
    --cc=conor+dt@kernel.org \
    --cc=cy_huang@richtek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@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;
as well as URLs for NNTP newsgroup(s).