From: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
To: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: obtaining a regulator from a phandle
Date: Mon, 5 Mar 2012 17:55:14 +0100 [thread overview]
Message-ID: <20120305165514.GA21298@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF17BE861C09-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]
* 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@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
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-03-05 16:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 15:21 obtaining a regulator from a phandle Thierry Reding
[not found] ` <20120305152157.GA12927-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-05 16:44 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BE861C09-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-05 16:55 ` Thierry Reding [this message]
[not found] ` <20120305165514.GA21298-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-03-06 11:39 ` Thierry Reding
[not found] ` <20120306113947.GA22769-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-03-06 17:21 ` Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120305165514.GA21298@avionic-0098.adnet.avionic-design.de \
--to=thierry.reding-rm9k5ik7kjkj5m59nbduvrnah6klmebb@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).