From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: David Brownell <david-b@pacbell.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev@ozlabs.org,
Andrew Morton <akpm@linux-foundation.org>,
Li Yang <leoli@freescale.com>, Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH 2/4] powerpc/qe: new call to revert a gpio to a dedicated function
Date: Thu, 25 Sep 2008 03:29:56 +0400 [thread overview]
Message-ID: <20080924232956.GA27533@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <200809241154.25722.david-b@pacbell.net>
On Wed, Sep 24, 2008 at 11:54:24AM -0700, David Brownell wrote:
[...]
> You'd be better off calling something other than of_get_gpio()
> for those three pins in of_fhci_probe() ... call something
> that returns a "qe_pin" structure (e.g. wrapping an instance of
> the misnamed qe_gpio_chip plus an offset) which holds the
> pinmux primitives you need. Like this one to put the pin into
> its normal mode.
The driver anyway will have to call of_get_gpio(), because it
have to use the pins as gpios. At least it have to specify a
direction, luckily for this we have the gpio_set_direction call
already. ;-)
But true, switching a pin to a dedicated function isn't a gpio
controller's job, it is a pinmuxing.
> When I look at patch 4 of this series I observe that only
> two pins are true GPIOs: the optional POWER and SPEED pins.
> (External transceiver support?)
Yes.
[...]
> And in turn, the reason to want this call is so that you can
> have io_port_generate_reset() generate a short reset on the
> single downstream USB port. ("Short" meaning "45 msec below
> USB spec requirements for root hub resets" ...)
>
> And to top it off ... that driver does gpio_request(), runs
> those pins as GPIOs for virtually no time, and then uses
> them as "dedicated functions" the rest of the time (after
> the reset completes)!!
>
>
> Which highlights the fact that these pins are fundamentally
> NOT used as GPIOs.
Well.. they are used as gpios anyway, to signal a reset.
This is host's duty, and we have to support it, otherwise
things won't work. There is no other way to signal a reset
than turning these *pins* to a gpio state, setting the
direction and then reverting them back to a dedicated function.
But true, most of it isn't gpio controller's authority.
[...]
> But there are other requirements for this no-kerneldoc call:
>
> > + struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
>
> ... it must be part of an of_mm_gpio_chip (in <linux/of_gpio.h>,
> which might seem less odd to me if I read its supporting code).
>
> Can you first ensure that it *is* an of_mm_gpio_chip
> instance? When it isn't, this code will oops rudely.
Yeah, unfortunately. The "oops" thought didn't visit my mind though,
because I'm still thinking it terms of this patch:
http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051230.html
^^ with that patch no oops is possible, and we could detect anything
you pointed out here and below in your post. Which doesn't mean that
the patch above was ideologically correct, though.
But you clearly pointed out the issues which ruin the whole approach.
Anyway, just want to thank you for your time and persistence on this
matter, you're forcing others' people brains to *work*. And since you
rejected this approach too, I have no other option but to implement
something else... something better. ;-)
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2008-09-24 23:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 0:02 [PATCH 0/4] FHCI USB Host support patches Anton Vorontsov
2008-09-24 0:03 ` [PATCH 1/4] gpiolib: make gpio_to_chip() public Anton Vorontsov
2008-09-24 0:03 ` [PATCH 2/4] powerpc/qe: new call to revert a gpio to a dedicated function Anton Vorontsov
2008-09-24 4:07 ` Kumar Gala
2008-09-24 11:42 ` Anton Vorontsov
2008-09-24 14:00 ` Kumar Gala
2008-09-24 14:11 ` Anton Vorontsov
2008-09-24 18:54 ` David Brownell
2008-09-24 18:54 ` David Brownell
2008-09-24 23:29 ` Anton Vorontsov [this message]
2008-09-25 4:13 ` David Brownell
2008-09-24 0:03 ` [PATCH 3/4] USB: Protect hcd.h from multiple inclusions Anton Vorontsov
2008-09-24 3:35 ` David Brownell
2008-09-24 0:03 ` [PATCH 4/4] USB: driver for Freescale QUICC Engine USB Host Controller Anton Vorontsov
-- strict thread matches above, loose matches on Subject: below --
2008-09-24 18:20 [PATCH v3 0/4] FHCI USB Host support patches Anton Vorontsov
2008-09-24 18:21 ` [PATCH 2/4] powerpc/qe: new call to revert a gpio to a dedicated function Anton Vorontsov
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=20080924232956.GA27533@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=akpm@linux-foundation.org \
--cc=david-b@pacbell.net \
--cc=greg@kroah.com \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=timur@freescale.com \
/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).