Skip to content

Commit 0a219d6

Browse files
DimitriFedrausre
authored andcommitted
dt-bindings: power: supply: gpio-charger: add support for default charge current limit
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. This is helpful when the smallest possible charge current limit is 0uA. The driver defaults to the smallest possible value at the moment, which disables charging on probe. With the default its possible to setup a safe charge current limit. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Dimitri Fedrau <[email protected]> Link: https://lore.kernel.org/r/20241218-default-charge-current-limit-v3-1-b26118cf06b5@liebherr.com Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 04d9741 commit 0a219d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Documentation/devicetree/bindings/power/supply/gpio-charger.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ properties:
5858
charge-current-limit-gpios property. Bit 1 second to last
5959
GPIO and so on.
6060

61+
charge-current-limit-default-microamp:
62+
description: Default charge current limit. Must be listed in
63+
charge-current-limit-mapping.
64+
6165
required:
6266
- compatible
6367

@@ -72,6 +76,7 @@ anyOf:
7276
dependencies:
7377
charge-current-limit-gpios: [ charge-current-limit-mapping ]
7478
charge-current-limit-mapping: [ charge-current-limit-gpios ]
79+
charge-current-limit-default-microamp: [charge-current-limit-mapping]
7580

7681
additionalProperties: false
7782

@@ -91,4 +96,5 @@ examples:
9196
charge-current-limit-mapping = <2500000 0x00>, // 2.5 A => both GPIOs low
9297
<700000 0x01>, // 700 mA => GPIO A.12 high
9398
<0 0x02>; // 0 mA => GPIO A.11 high
99+
charge-current-limit-default-microamp = <700000>;
94100
};

0 commit comments

Comments
 (0)