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

Krzysztof Kozlowski
2026-04-28T15:10:02Z

On 28/04/2026 16:09, Chris Morgan wrote:
> On Tue, Apr 28, 2026 at 09:47:00AM +0200, Krzysztof Kozlowski wrote:
>> On Mon, Apr 27, 2026 at 12:09:09PM -0500, Chris Morgan wrote:
>>> From: Chris Morgan <macromorgan@hotmail.com>
>>>
>>> Document the SG Micro sgm41542 battery charger/boost converter.
>>>
>>> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
>>> ---
>>> .../supply/sgmicro,sgm41542-charger.yaml | 99 +++++++++++++++++++
>>> 1 file changed, 99 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542-charger.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542-charger.yaml b/Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542-charger.yaml
>>> new file mode 100644
>>> index 000000000000..3e5041e5b551
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542-charger.yaml
>>
>> Filename must match compatible.
>
> Acknowledged.
>
>>
>>> @@ -0,0 +1,99 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/power/supply/sgmicro,sgm41542-charger.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: SGM41542 Battery Charger
>>> +
>>> +description: |
>>
>> Do not need '|' unless you need to preserve formatting.
>>
>
> Will fix.
>
>>> + The SGMicro SGM41542 is a single cell battery charger/boost controller.
>>> +
>>> +maintainers:
>>> + - Chris Morgan <macromorgan@hotmail.com>
>>> + - Xu Shengfei <xsf@rock-chips.com>
>>> +
>>> +properties:
>>> + compatible:
>>> + const: sgmicro,sgm41542
>>> +
>>> + input-current-limit-microamp:
>>
>> Missing vendor prefix.
>>
>
> This *appears* to be a standard value (perhaps not formally, but in use by
> enough devices to suggest a defacto standard), which is why I did not use
> the vendor prefix here. Do I need to add that for this one?

I know, I found these other properties but I think they were just coming
from old schema.

If it is really a common property, then should be defined in a common
schema and this did not happen.

>
>>> + 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
>>> +
>>> + 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
>>> +
>>> + interrupts:
>>> + maxItems: 1
>>> +
>>> + monitored-battery:
>>
>> You miss definition of this property. I guess this is power supply, so
>> reference proper schema for power supplies. Look at other bindings to
>> for some example code.
>
> I'll look at this some more, I might have a few more questions. But I will
> make the changes requested.
>
>>
>>> + 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:
>>> + constant-charge-current-max-microamp
>>> + constant-charge-voltage-max-microvolt
>>> + charge-term-current-microamp
>>> + precharge-current-microamp
>>> +
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + regulators:
>>
>> No need for regulators node, just define here otg-vbus directly. But
>> honestly, your example is incomplete or you defined something implied by
>> the compatible. If you have a fixed 5V regulator, what is the point of
>> defining it in the DT?
>
> The regulator can be adjusted within a range around 5V, and is referenced
> by the USB subsystem. Should I still omit it from the device tree or instead
> define the min and max values?

If it can be adjusted then it's fine, can stay.

Best regards,
Krzysztof