From: Michael Welling <mwelling@emacinc.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Grant Likely <grant.likely@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: GPIO registration for external Ethernet PHY oscillator enable/disable
Date: Tue, 7 Oct 2014 11:30:53 -0500 [thread overview]
Message-ID: <20141007163053.GA6123@sysresccd> (raw)
In-Reply-To: <CACRpkdYL-AQPDOZNrmeOeKbb+DvXBHB+hz37M+v_qKwzPzkApA@mail.gmail.com>
On Tue, Oct 07, 2014 at 04:04:27PM +0200, Linus Walleij wrote:
> On Thu, Sep 25, 2014 at 9:17 PM, Michael Welling <mwelling@emacinc.com> wrote:
>
> > How do I register a GPIO for use in the PHY suspend and resume code?
> > Can it be handled outside of the PHY driver?
>
> Nominally these days you should get a named GPIO using the
> GPIO descriptor abstraction, putting a named GPIO reference in the
> device tree node for the PHY, which should work fine
> if you're using device tree for this system.
> Documentation/gpio/consumer.txt
>
> > If so how do ensure the appropriate suspend and resume sequencing?
>
> AFAICT there is no good answer to this kind of questions. I guess
> my best answer would be something like what has been said for
> DRM drivers: handle all the sequence-sensitive hardware in one big
> composite driver and handle sequencing in the driver.
>
> > For reference, we are using a Micrel KSZ8081 PHY connected to a
> > AT91SAMA5D35 processor.
>
> I don't know how AT91 is progressing on the device tree side or if
> it's strictly required to boot these days. If it is, you should be able
> to proceed as indicated.
AT91 is fairly up to snuff on the device tree implementation.
>
> > Addendum:
> > I ran into another situation where a GPIO enabled oscillator was used.
> > The oscillator in this case drives the master clock for a audio codec.
> > In the old days (before device tree), I could initialize the GPIO in the
> > platform board file. Now with device tree I can setup the pin multipler
> > but the initial state of the GPIO I am not sure how to set.
>
> A driver needs to do this. Like a drivers/clk driver in this case I
> guess?
>
> > Is there a way to directly change the state of a GPIO pin from a
> > devicetree entry?
>
> I have suggested mechanisms like GPIO hogs to replace the need
> for very basic drivers that would just take a GPIO during init,
> set it and never do anything with it.
>
> Like the gpiochip node should have some hog entries:
>
> gpio-hog-high = <0>, <1>, <2>...;
> gpio-hog-low = <...>;
>
> Then they would be taken away from other consumers and not
> possible to use for anything.
>
> This has so far not been implemented though.
I was thinking less of a hog and more of an initial configuration.
Specifically for GPIO unregistered otherwise until exported via the GPIO
class.
>
> Yours,
> Linus Walleij
prev parent reply other threads:[~2014-10-07 16:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 21:52 GPIO registration for external Ethernet PHY oscillator enable/disable Michael Welling
2014-09-25 19:17 ` Michael Welling
2014-09-25 19:56 ` Florian Fainelli
2014-09-26 16:59 ` Michael Welling
2014-09-26 17:16 ` Florian Fainelli
2014-09-26 17:32 ` Michael Welling
2014-09-26 20:04 ` Michael Welling
2014-10-07 14:09 ` Linus Walleij
2014-10-07 16:38 ` Michael Welling
2014-10-07 14:04 ` Linus Walleij
2014-10-07 16:30 ` Michael Welling [this message]
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=20141007163053.GA6123@sysresccd \
--to=mwelling@emacinc.com \
--cc=f.fainelli@gmail.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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