Re: [PATCH] regulator: Support different config and dev of_nodes in regulator_register

From: Tim Bird
Date: Thu Feb 05 2015 - 12:33:46 EST




On 02/04/2015 05:59 PM, Mark Brown wrote:
> On Wed, Feb 04, 2015 at 03:19:57PM -0800, Tim Bird wrote:
>
>> Support calling regulator_register with a dev node and a config node
>> with different of_nodes. This is useful when a single driver
>> wishes to register multiple child regulators.
>
>> Without this you get silent failures allocating a supply
>> for a regulator which is registered using the device node of the
>> regulator's DT parent (but it's own DT node).
>
> This is explicitly not supported; such bindings are invariably attempts
> to encode the Linux MFD structure into the device tree (which isn't a
> wonderful idea as the way we split things into subsystems can and does
> change) or...

Sorry - what is the "Linux MFD structure"?

>
>> charger@1000 {
>> compatible = "qcom,pm8941-charger";
>> reg = <0x1000 0x700>;
>> ....
>> chg_otg {
>> regulator_name = "chg_otg";
>> otg-supply = <&pm8941_mvs1>;
>> ...
>> }
>> }
>
> ...this which just looks like the supply has been placed in the wrong
> place, it should be in the parent node. Supplies are always defined at
> the package level, that way we can consistently define the bindings for
> supplies for a device without having to completely support it and we
> don't have to bind the same supply multiple times. It should really be
> possible to wire up the supplies based only on the schematics.
>
Well, the above DT node is not complete. Let me give some more
context. I eventually want to have the charger driver support 2
regulators - one for the OTG vbus output (shown above) and one
for a boost hardware device, which controls voltage for this and
other parts of the system. These are both for IP blocks that are
in the register range of this charger hardware (and hence belong, IMHO
in this driver). I can easily move the otg-supply to the charger DT node,
as you request, but what do I do about other regulator attributes,
if I need to specify them for both the chg_otg and boost regulators
provided by this driver? How would this be handled? I can't put them
all in the charger DT node.

Thanks,
-- Tim


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/