Re: [PATCH 1/2] dt-bindings: power: supply: Add Richtek RT9467 battery charger

From: Krzysztof Kozlowski
Date: Thu Sep 29 2022 - 07:31:34 EST


On 29/09/2022 12:37, ChiaEn Wu wrote:
> From: ChiaEn Wu <chiaen_wu@xxxxxxxxxxx>
>
> Add bindings for the Richtek RT9467 battery charger.
>
> Co-developed-by: ChiYuan Huang <cy_huang@xxxxxxxxxxx>
> Signed-off-by: ChiYuan Huang <cy_huang@xxxxxxxxxxx>
> Signed-off-by: ChiaEn Wu <chiaen_wu@xxxxxxxxxxx>
> ---

Thank you for your patch. There is something to discuss/improve.

> +
> + reg:
> + maxItems: 1
> +
> + wakeup-source: true
> +
> + interrupts:
> + maxItems: 1
> +
> + charge-enable-gpios:
> + description: GPIO is used to turn on and off charging.
> + maxItems: 1
> +
> + usb-otg-vbus-regulator:
> + type: object
> + description: OTG boost regulator.
> + unevaluatedProperties: false
> + $ref: /schemas/regulator/regulator.yaml#
> +
> + properties:
> + enable-gpios:
> + maxItems: 1

maxItems are coming from gpio-consumer-common.yaml, so just
enable-gpios: true

> +
> +required:
> + - compatible
> + - reg
> + - wakeup-source
> + - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/gpio/gpio.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + rt9467@5b {

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

> + compatible = "richtek,rt9467-charger";
> + reg = <0x5b>;
> + wakeup-source;
> + interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>;
> + charge-enable-gpios = <&gpio26 1 0>;

Use defines for GPIO flags.

> +
> + rt9467_otg_vbus: usb-otg-vbus-regulator {
> + regulator-name = "rt9467-usb-otg-vbus";
> + regulator-min-microvolt = <4425000>;
> + regulator-max-microvolt = <5825000>;
> + regulator-min-microamp = <500000>;
> + regulator-max-microamp = <3000000>;
> + };
> + };
> + };

Best regards,
Krzysztof