[PATCH RESEND] gpio: mpc8xxx: don't allow input-only pins to be output for MPC5121

Wolfram Sang w.sang at pengutronix.de
Wed Dec 14 05:23:07 EST 2011


On Tue, Dec 13, 2011 at 11:16:59AM -0700, Grant Likely wrote:
> On Tue, Dec 13, 2011 at 10:12:48AM +0100, Wolfram Sang wrote:
> > Add a 5121-custom reject if an input-only pin is requested to be output
> > (see 18.3.1.1 in the refman). Also, rewrite mach-specific quirk setup to
> > consume less lines which scales better.
> > 
> > Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
> > ---
> >  drivers/gpio/gpio-mpc8xxx.c |   17 ++++++++++++-----
> >  1 files changed, 12 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
> > index ec3fcf0..25dc736 100644
> > --- a/drivers/gpio/gpio-mpc8xxx.c
> > +++ b/drivers/gpio/gpio-mpc8xxx.c
> > @@ -115,6 +115,14 @@ static int mpc8xxx_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
> >  	return 0;
> >  }
> >  
> > +static int mpc5121_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
> > +{
> > +	/* GPIO 28..31 are input only on MPC5121 */
> > +	if (gpio >= 28)
> > +		return -EINVAL;
> > +
> > +	return mpc8xxx_gpio_dir_out(gc, gpio, val);
> > +}
> >  static int mpc8xxx_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
> 
> This actually caused a build failure.  mpc8xxx_gpio_dir_out() was used before
> it was declared.  I moved the symbol to immediately below and applied anyway,
> but how did it compile for you?  Should I drop this patch until you retest?

Huh, I am surprised as well. Will investigate tomorrow. Sorry for the
inconvenience.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20111213/3cff8492/attachment.pgp>


More information about the Linuxppc-dev mailing list