Re: [PATCH 2/2] regulator: core: Add the device tree version to the regulator_get family

From: Mark Brown
Date: Mon Dec 29 2014 - 10:50:01 EST


On Fri, Dec 26, 2014 at 06:26:39PM +0100, Gregory CLEMENT wrote:

> This patch adds the device tree version (of_) for each member of the
> regulator_get family: normal, exclusive, optional and all of the
> manageable version.

I'm really not keen on this - this sort of firmware specific interface
is just going to encourage the sort of problematic Linux MFD in DT stuff
people seem so enthusiastic about and needlessly DT specific code.

> The of_regulator_get* functions allow using a device node to get the
> regulator instead using the device object. It is needed for the
> regulator associated to a child node which is not a device, it is the
> case of the SATA ports of an ahci controller for instance.

It would be much better to provide a way of mapping the supplies to the
regulator using the normal APIs, for example by making the child nodes
devices (I'm not seeing anything that says why that's not possible and
it sounds like they're supposed to be physically separate devices which
sound like good candidates for being struct device) or by providing some
other alternative mapping mechanism which isn't DT specific.

Or take another look at what the bindings are doing to avoid the
requirement for this, I'd have expected these new bindings to be part of
the review here...

Attachment: signature.asc
Description: Digital signature