linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Regulator supplies when using Device Tree
@ 2012-03-23  1:17 Michael Bohan
  2012-03-26 13:00 ` Mark Brown
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Bohan @ 2012-03-23  1:17 UTC (permalink / raw)
  To: rnayak, broonie, lrg; +Cc: LKML, linux-arm-msm

Hi,

I'm curious if there was a reason we didn't standardize on a binding 
name for regulator supplies when using Device Tree. This appears to 
cause duplicated code for regulator drivers that support devices that 
may or may not have supplies specified.

For example, if one were to set rdesc->supply_name to a chosen supply 
name "parent" and that particular device does not exist in the Device 
Tree topology, then regulator_register() will fail. So in the driver, we 
have to first use of_get_property() to verify that "parent-supply" is 
defined. Only then do we set rdesc->supply_name. Since I have multiple 
regulator drivers that may or may not have supplies, each has to 
duplicate this check.

But it seems like if we agreed on a standardized supply name for 
regulators, then we could move that complexity to 
of_get_regulator_init_data(). Having multiple supply names sure makes 
sense for consumers, but for supplies, there can ever only be one.

I guess another alternative is to have the driver unconditionally assign 
rdesc->supply_name, but change the framework to not fail the 
regulator_register() if the supply is not specified in the topology. If 
it is specified but fails either a phandle lookup or the targeted supply 
regulator is not valid, then fail only in those cases.

Also, I'm curious why we need two pointers for the supply name. There's 
currently regulator_desc->supply_name, recently added for Device Tree, 
and then the old init_data->supply_regulator. Is there a need for both?

Thanks,
Mike

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-04-03 12:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23  1:17 Regulator supplies when using Device Tree Michael Bohan
2012-03-26 13:00 ` Mark Brown
2012-03-28  1:38   ` Michael Bohan
2012-03-28 10:09     ` Mark Brown
2012-03-28 19:19       ` Michael Bohan
2012-03-28 19:33         ` Mark Brown
2012-03-29  0:06           ` Michael Bohan
2012-03-29  4:44             ` Rajendra Nayak
2012-03-29 11:08               ` Mark Brown
2012-03-29 11:11             ` Mark Brown
2012-03-30  1:18               ` Michael Bohan
2012-03-30 10:36                 ` Mark Brown
2012-04-02 17:35                   ` Michael Bohan
2012-04-02 21:22                     ` Mark Brown
2012-04-03  1:53                       ` Michael Bohan
2012-04-03 12:25                         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).