diff mbox series

[v2,1/2] dt-bindings: power: supply: gpio-charger: add support for default charge current limit

Message ID 20241213-default-charge-current-limit-v2-1-45886fce905c@liebherr.com
State New
Headers show
Series power: supply: gpio-charger: add support for default charge current limit | expand

Commit Message

Dimitri Fedrau via B4 Relay Dec. 13, 2024, 7:32 p.m. UTC
From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>

With DT properties charge-current-limit-gpios and
charge-current-limit-mapping one can define charge current limits in uA
using up to 32 GPIOs. Add property charge-current-limit-default-microamp
which selects a default charge current limit that must be listed in
charge-current-limit-mapping.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
 Documentation/devicetree/bindings/power/supply/gpio-charger.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Dimitri Fedrau Dec. 16, 2024, 6:12 p.m. UTC | #1
Am Mon, Dec 16, 2024 at 11:04:40AM +0100 schrieb Krzysztof Kozlowski:
> On Fri, Dec 13, 2024 at 08:32:33PM +0100, Dimitri Fedrau wrote:
> > With DT properties charge-current-limit-gpios and
> > charge-current-limit-mapping one can define charge current limits in uA
> > using up to 32 GPIOs. Add property charge-current-limit-default-microamp
> > which selects a default charge current limit that must be listed in
> > charge-current-limit-mapping.
> 
> Last time you wrote the point of it is to avoid defaulting to 0 A for
> charging, because existing implementation uses smallest possible value.
> This is supposed to be here in commit msg.
>
Will add it. Thanks for reviewing.

Best regards,
Dimitri
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml b/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
index 89f8e2bcb2d7836c6a4308aff51721bd83fa3ba1..25826bfc289c1c00c338fd0cee2ae6932529cfc3 100644
--- a/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
@@ -58,6 +58,10 @@  properties:
             charge-current-limit-gpios property. Bit 1 second to last
             GPIO and so on.
 
+  charge-current-limit-default-microamp:
+    description: Default charge current limit. Must be listed in
+      charge-current-limit-mapping.
+
 required:
   - compatible
 
@@ -72,6 +76,7 @@  anyOf:
 dependencies:
   charge-current-limit-gpios: [ charge-current-limit-mapping ]
   charge-current-limit-mapping: [ charge-current-limit-gpios ]
+  charge-current-limit-default-microamp: [charge-current-limit-mapping]
 
 additionalProperties: false
 
@@ -91,4 +96,5 @@  examples:
       charge-current-limit-mapping = <2500000 0x00>, // 2.5 A => both GPIOs low
                                      <700000 0x01>, // 700 mA => GPIO A.12 high
                                      <0 0x02>; // 0 mA => GPIO A.11 high
+      charge-current-limit-default-microamp = <700000>;
     };