lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 15 Jun 2020 11:58:44 -0600
From:   Rob Herring <robh@...nel.org>
To:     Sebastian Reichel <sebastian.reichel@...labora.com>
Cc:     Sebastian Reichel <sre@...nel.org>,
        Emil Velikov <emil.velikov@...labora.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Daniel Mack <daniel@...que.org>,
        Haojian Zhuang <haojian.zhuang@...il.com>,
        Robert Jarzmik <robert.jarzmik@...e.fr>,
        Russell King <linux@...linux.org.uk>, linux-pm@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...labora.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCHv2 3/6] power: supply: gpio-charger: add
 charge-current-limit feature

On Sat, Jun 06, 2020 at 12:44:00AM +0200, Sebastian Reichel wrote:
> Add new charge-current-limit feature to gpio-charger.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@...labora.com>
> ---
>  .../bindings/power/supply/gpio-charger.yaml   |  31 ++++
>  drivers/power/supply/gpio-charger.c           | 140 ++++++++++++++++++
>  2 files changed, 171 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml b/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
> index 30eabbb14ef3..e11cfdc68a51 100644
> --- a/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
> @@ -39,6 +39,25 @@ properties:
>      maxItems: 1
>      description: GPIO indicating the charging status
>  
> +  charge-current-limit-gpios:
> +    minItems: 1
> +    maxItems: 32
> +    description: GPIOs used for current limiting
> +
> +  charge-current-limit-mapping:
> +    description: List of touples with current in uA and a GPIO bitmap (in

s/touples/tuples/

> +      this order). The touples must be provided in descending order of the

and here.

> +      current limit.
> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +    items:
> +      items:
> +        - description:
> +            Current limit in uA
> +        - description:
> +            Encoded GPIO setting. Bit 0 represents last GPIO from the
> +            charge-current-limit-gpios property. Bit 1 second to last
> +            GPIO and so on.

Seems a bit odd that bit N doesn't represent index N of the gpios.

> +
>  required:
>    - compatible
>  
> @@ -47,6 +66,12 @@ anyOf:
>      - gpios
>    - required:
>      - charge-status-gpios
> +  - required:
> +    - charge-current-limit-gpios
> +
> +dependencies:
> +  charge-current-limit-gpios: [ charge-current-limit-mapping ]
> +  charge-current-limit-mapping: [ charge-current-limit-gpios ]
>  
>  additionalProperties: false
>  
> @@ -60,4 +85,10 @@ examples:
>  
>        gpios = <&gpd 28 GPIO_ACTIVE_LOW>;
>        charge-status-gpios = <&gpc 27 GPIO_ACTIVE_LOW>;
> +
> +      charge-current-limit-gpios = <&gpioA 11 GPIO_ACTIVE_HIGH>,
> +                                   <&gpioA 12 GPIO_ACTIVE_HIGH>;
> +      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
>      };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ