Re: [PATCH v3 2/4] gpiolib: Add ability to get GPIO pin direction

From: Peter Tyser
Date: Fri Feb 18 2011 - 15:28:16 EST


On Fri, 2011-02-18 at 19:49 +0100, Uwe Kleine-KÃnig wrote:
> Hello Peter,
>
> On Fri, Feb 18, 2011 at 11:36:26AM -0600, Peter Tyser wrote:
> > On Fri, 2011-02-18 at 09:57 +0100, Uwe Kleine-KÃnig wrote:
> > > On Thu, Feb 17, 2011 at 05:03:17PM -0600, Peter Tyser wrote:
> > > > Add a new get_direction() function to the gpio_chip structure. This is
> > > > useful so that the direction of a pin can be determined when its
> > > > initially exported. Previously, the direction defaulted to "unknown"
> > > > regardless of the actual configuration of the GPIO pin.
> > > >
> > > > If a GPIO driver implements get_direction(), it is called in
> > > > gpio_request() to set the initial direction of the pin accurately.
> > > IMHO the commit log is conceptually wrong, because it talks about a
> > > "pin". Better use gpio here.
> >
> > I don't follow. I used "pin" to make it clear that the get_direction()
> > function operates on a pin-by-pin basis, and to help reduce any
> > ambiguity about if a gpio chip or gpio pin is being referred to. Would
> > you prefer that the "pin" references are clarified to be "GPIO pin"?
> Maybe it's just that we use different terms. For me a "pin" is an
> entry/exit point into/from a cpu or other chip. A gpio is (hmm, how
> should I say) a concept how to drive a pin. A gpio might or might not
> be "connected" to a pin at a given time.

Ahh, I see... The GPIO subsystem doesn't have the capability to
multiplex a GPIO to different physical pins at the moment, so I always
equate a GPIO with a specific pin, even if its not "connected" all the
time. I'll remove the "pin" references when I resubmit if you think it
is more accurate.

Peter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/