linux-mips
[Top] [All Lists]

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

To: florian.fainelli@telecomint.eu
Subject: Re: [PATCH 2/2] Add GPIO wrappers to Au1x00 boards
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Mon, 21 May 2007 00:26:42 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <200705192151.39752.florian.fainelli@telecomint.eu>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200705192151.39752.florian.fainelli@telecomint.eu>
Sender: linux-mips-bounce@linux-mips.org
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-19 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

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