linux-mips
[Top] [All Lists]

Re: [PATCH 2/2] Add GPIO wrappers to Au1x00 boards

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH 2/2] Add GPIO wrappers to Au1x00 boards
From: Florian Fainelli <florian.fainelli@telecomint.eu>
Date: Mon, 21 May 2007 08:10:08 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <200705210130.17957.florian.fainelli@telecomint.eu>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200705192151.39752.florian.fainelli@telecomint.eu> <20070521.002642.108739229.anemo@mba.ocn.ne.jp> <200705210130.17957.florian.fainelli@telecomint.eu>
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.9.6
I forgot adding the GENERIC_GPIO entry in Kconfig. The attached patch selects 
GENERIC_GPIO for CONFIG_AU1X00.

Le lundi 21 mai 2007, Florian Fainelli a écrit :
> Hello Atsushi,
>
> Thank you very much for your comments. Here is an updated version which
> includes implementation for input/output directions and should take your
> comments into account.
>
> Le dimanche 20 mai 2007, Atsushi Nemoto a écrit :
> > On Sat, 19 May 2007 21:51:39 +0200, Florian Fainelli
>
> <florian.fainelli@telecomint.eu> wrote:
> > > diff -urN linux-2.6.21.1/include/asm-mips/mach-au1x00/au1xxx_gpio.h
> > > linux-2.6.21.1.new/include/asm-mips/mach-au1x00/au1xxx_gpio.h ---
> > > linux-2.6.21.1/include/asm-mips/mach-au1x00/au1xxx_gpio.h 2007-04-27
> > > 23:49:26.000000000 +0200 +++
> > > linux-2.6.21.1.new/include/asm-mips/mach-au1x00/au1xxx_gpio.h     
> > > 2007-05-1
> > >9 21:34:27.000000000 +0200 @@ -1,10 +1,7 @@
> >
> > ...
> >
> > > +/* Wrappers for the arch-neutral GPIO API */
> > > +
> > > +static inline int gpio_request(unsigned gpio, const char *label)
> > > +{
> > > + /* Not yet implemented */
> > > + return 0;
> > > +}
> > > +
> > > +static inline void gpio_free(unsigned gpio)
> > > +{
> > > + /* Not yet implemented */
> > > +}
> > > +
> > > +extern int gpio_direction_input(unsigned gpio);
> > > +extern int gpio_direction_output(unsigned gpio, int value);
> > > +
> > > +static inline int gpio_get_value(unsigned gpio)
> > > +{
> > > + return au1xxx_gpio_get_value(gpio);
> > > +}
> > > +
> > > +static inline void gpio_set_value(unsigned gpio, int value)
> > > +{
> > > + au1xxx_gpio_set_value(gpio, value);
> > > +}
> > > +
> > > +static inline int gpio_to_irq(unsigned gpio)
> > > +{
> > > + return gpio;
> > > +}
> > > +
> > > +static inline int irq_to_gpio(unsigned irq)
> > > +{
> > > + return irq;
> > > +}
> > > +
> > > +/* For cansleep */
> > > +#include <asm-generic/gpio.h>
> > > +
> > > +#endif /* _AU1XXX_GPIO_H_ */
> >
> > These APIs should be usable by "#include <asm/gpio.h>".  So move
> > mach-au1x00/au1xxx_gpio.h to mach-au1x00/gpio.h and include it by
> > include/asm-mips/gpio.h (as Youichi said).
> >
> > And it seems gpio_direction_input()/gpio_direction_output() are not
> > implemented.  A user of the GPIO API _should_ use these interfaces.
> >
> > ---
> > Atsushi Nemoto



-- 
Cordialement, Florian Fainelli
---------------------------------------------

Attachment: au1x00-gpio.patch
Description: Text document

Attachment: pgpU2HhMqKR_L.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>