[PATCH V5 1/6] dt-bindings: power: supply: sgm41542: document sgm41542

Conor Dooley conor at kernel.org
Fri Jun 5 09:39:11 PDT 2026


On Thu, Jun 04, 2026 at 05:07:56PM -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan at hotmail.com>
> 
> Document the SG Micro sgm41542 battery charger/boost converter.
> The parameters of input-current-limit-microamp and
> input-voltage-limit-microvolt are defined as such since they are in
> common use among multiple bindings currently.
> 
> Signed-off-by: Chris Morgan <macromorgan at hotmail.com>
> ---
>  .../power/supply/sgmicro,sgm41542.yaml        | 104 ++++++++++++++++++
>  1 file changed, 104 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml b/Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml
> new file mode 100644
> index 000000000000..a97afea83700
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml
> @@ -0,0 +1,104 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/supply/sgmicro,sgm41542.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: SGM41542 Battery Charger
> +
> +description:
> +  The SGMicro SGM41542 is a single cell battery charger/boost controller.
> +
> +maintainers:
> +  - Chris Morgan <macromorgan at hotmail.com>
> +  - Xu Shengfei <xsf at rock-chips.com>
> +
> +allOf:
> +  - $ref: power-supply.yaml#
> +
> +properties:
> +  compatible:
> +    const: sgmicro,sgm41542
> +
> +  input-current-limit-microamp:
> +    description:
> +      Optional value to clamp the maximum input current limit to for
> +      the device. If omitted, the default value for the hardware will
> +      be used (2400000).
> +    minimum: 100000
> +    maximum: 3800000

Instead of the text,
default: 2400000

> +
> +  input-voltage-limit-microvolt:
> +    description:
> +      Optional value to clamp the maximum input voltage limit to for
> +      the device. If omitted, the default value for the hardware will
> +      be used (4500000).
> +    minimum: 3900000
> +    maximum: 12000000

Same here.
pw-bot: changes-requested

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  monitored-battery:
> +    description: |
> +        A phandle to a monitored battery node. Values for the following
> +        are used by the driver and if not present will result in default
> +        values being applied:

I saw the wording "The charger uses the following battery properties"
elsewhere, and I think that's superior to what's here.

I had a quick check and didn't notice other devices that talked about
defaults here. I feel like it's probably a good idea to state in the
binding what the defaults are, so that if u-boot or whatever grows a
support for this hardware that it uses the same ones.

Cheers,
Conor.

> +        constant-charge-current-max-microamp
> +        constant-charge-voltage-max-microvolt
> +        charge-term-current-microamp
> +        precharge-current-microamp
> +
> +  reg:
> +    maxItems: 1
> +
> +  regulators:
> +    type: object
> +    properties:
> +      otg-vbus:
> +        type: object
> +        description: OTG boost regulator
> +        $ref: /schemas/regulator/regulator.yaml
> +        unevaluatedProperties: false
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    battery: battery {
> +      compatible = "simple-battery";
> +      constant-charge-current-max-microamp = <10000000>;
> +      constant-charge-voltage-max-microvolt = <4350000>;
> +      precharge-current-microamp = <180000>;
> +      charge-term-current-microamp = <300000>;
> +    };
> +
> +    i2c {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      charger at 3b {
> +        compatible = "sgmicro,sgm41542";
> +        reg = <0x3b>;
> +        input-current-limit-microamp = <3000000>;
> +        input-voltage-limit-microvolt = <4500000>;
> +        interrupt-parent = <&gpio0>;
> +        interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
> +        monitored-battery = <&battery>;
> +
> +        regulators {
> +          otg-vbus {
> +            regulator-max-microvolt = <5000000>;
> +            regulator-min-microvolt = <5000000>;
> +          };
> +        };
> +      };
> +    };
> -- 
> 2.43.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20260605/bbf755ec/attachment.sig>


More information about the Linux-rockchip mailing list