[PATCH 01/13] ARM: LPC32XX: Initial architecture header files

Kevin Wells kevin.wells at nxp.com
Mon Feb 22 16:41:01 EST 2010


Hi Uwe,

I'm going to add the pin mux check to a future patch release.
It's a nice feature and may save some GPIO pin issues down
the road, but respectfully, I want to focus on getting the
release out without adding more changes & features at the
moment. I'll add this capbility in with a new pinmux driver
in the future.

thanks,
Kevin

> 2010/2/20 Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> >
> > Hey Kevin,
> >
> > > +/*
> > > + * Note!
> > > + * Muxed GP pins need to be setup to the GP state in the board level
> > > + * code prior to using this driver.
> > This is done by the imx machines, too, and I wonder if it's worth to try
> > to get rid of that or at least let the gpio_direction_... functions fail
> > if the pin isn't muxed as gpio.  Thoughts?
> >
> HI Uwe,
> 
> In the current function of the driver, the assumption is that if an out
> pin
> is used, it has already been muxed correctly, so requesting an output
> for a pin not muxed as a GPI/O will work fine and even setting it's pin
> level will work, but the level won't appear on the external pin. If
> something decides to switch the mux after that state is programmed,
> then the currently programmed output level will show up on that pin.
> 
> For state muxing, I would prefer to not have the GPIO driver change an
> existing mux state to make a GPIO work. I don't return an error now
> when a output state is used and is not muxed for an output state. But
> its painless to add this.
> 
> GPI pins and GPIO pins configured as inputs always work regardless
> of the muxed pin state and would never need to have a fail check, its
> basically a raw pin state read.
> 
> > I didn't check the alternative functionalities for the gpios on lpc32xx,
> > but what happens if any gpio is requested and the direction configured?
> > Does it interfer with system functions?  (E.g. if a pin is used in a
> > dedicated say i2c function, does it make the i2c driver non-functional
> > if I do gpio_direction_output(i2cpin, 1)?)
> >
> 
> Setting a GPIO direction or output state will not effect a peripheral pin
> (on this part) when muxed for the peripheral. (ie, setting a GPIO to
> output
> and switching it to low when its shared with a UART pin and the mux is
> setup for UART).
> 
> thanks,
> Kevin
> 
> > Best regards
> > Uwe
> >
> > --
> > Pengutronix e.K.                           | Uwe Kleine-König
>  |
> > Industrial Linux Solutions                 | http://www.pengutronix.de/
>  |
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list