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
|