obtaining a regulator from a phandle

Thierry Reding thierry.reding at avionic-design.de
Tue Mar 6 03:55:14 EST 2012


* Stephen Warren wrote:
> Thierry Reding wrote at Monday, March 05, 2012 8:22 AM:
> > I'm working on getting DT support for PCIe on Tegra working. The Tegra PCIe
> > controller needs a specific voltage supplied by a regulator on the board that
> > I use (Harmony-compatible), so what I did was add DT support for the PMU
> > (tps6586x) to provide the corresponding regulator:
> ...
> > Within the device node of the PCIe controller, I reference the ldo0 regulator
> > like so:
> > 
> > 	pcie at 80000000 {
> > 		pex-clk-supply = <&ldo0_reg>;
> > 	};
> > 
> > This all works well, except there seems to be no API to obtain a regulator
> > from the DT phandle.
> 
> regulator_get(pcie_dev, "pex-clk") should work.

Ah, I see. That would call regulator_dev_lookup(), which would call
of_get_regulator() which will lookup the pex-clk-supply property. I
will give that a shot.

> Of course, the PCIe host on Tegra isn't yet a platform device, so would
> have to be converted.

I've already converted that. I was going to send the patch when I've tested
that this works in a DT setup as well. So far I have only tested it on non-
DT Harmony.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20120305/fcddb991/attachment.pgp>


More information about the devicetree-discuss mailing list