Re: [PATCH v1 1/5] dt-bindings: power: Add bindings for a power domain controlled by a regulator

From: Max Krummenacher
Date: Wed Jun 15 2022 - 11:19:13 EST


Hi

On Tue, Jun 14, 2022 at 9:24 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
> Hi Max,
>
> On Thu, Jun 9, 2022 at 5:16 PM Max Krummenacher <max.oss.09@xxxxxxxxx> wrote:
> > From: Max Krummenacher <max.krummenacher@xxxxxxxxxxx>
> >
> > Adds binding for a power domain provider which uses a regulator to control
> > the power domain.
> >
> > Signed-off-by: Max Krummenacher <max.krummenacher@xxxxxxxxxxx>
>
> Thanks for your patch!
>
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/power/regulator-power-domain.yaml
> > @@ -0,0 +1,58 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/power/regulator-power-domain.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Power domain controlled by a regulator
> > +
> > +maintainers:
> > + - Max Krummenacher <max.krummenacher@xxxxxxxxxxx>
> > +
> > +description: |+
> > + Power domain provider which uses a regulator to control
> > + the power domain.
> > +
> > +allOf:
> > + - $ref: "power-domain.yaml#"
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - regulator-pm-pd
> > +
> > + power-supply:
> > + description: The regulator used to control the power domain.
>
> I guess there can be more than one?

The proposed implementation currently only uses one.

When I did it I considered more than one regulator a rare use case and
I was under the impression that the generic power domain code
can handle multiple power domains. With that in mind I assumed that
one would create multiple regulator-pm-pd instances each controlling
one regulator and add all of them to the power-domains property of
the power domain consumer.

But it seems the implementation requires the power domain consumer
to handle that case in its code rather than relying on the generic code. [1]

Do you see a real world use case to handle multiple regulators?

Max

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/power/domain.c?id=8cb1cbd644d5bba5b72eedd632f249c1c677b792#n2290


>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds