Thread (1 message) 1 message, 1 author, 2012-03-05

Re: obtaining a regulator from a phandle

From: Thierry Reding <hidden>
Date: 2012-03-05 16:55:14
Also in: linux-devicetree

* Stephen Warren wrote:
Thierry Reding wrote at Monday, March 05, 2012 8:22 AM:
quoted
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:
...
quoted
Within the device node of the PCIe controller, I reference the ldo0 regulator
like so:

	pcie@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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help