forked from Minki/linux
01464226ac
Most platforms don't need mach/gpio.h and it prevents multi-platform kernel images. Add CONFIG_NEED_MACH_GPIO_H and make platforns select it if they need gpio.h. This is platforms that define __GPIOLIB_COMPLEX or have lots of implicit includes pulled in by mach/gpio.h. at91 and omap have gpio clean-up pending and can drop CONFIG_NEED_MACH_GPIO_H once that is in. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Acked-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Linus Walleij <linus.walleij@linaro.org>
33 lines
814 B
C
33 lines
814 B
C
#ifndef _ARCH_ARM_GPIO_H
|
|
#define _ARCH_ARM_GPIO_H
|
|
|
|
#if CONFIG_ARCH_NR_GPIO > 0
|
|
#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
|
|
#endif
|
|
|
|
/* not all ARM platforms necessarily support this API ... */
|
|
#ifdef CONFIG_NEED_MACH_GPIO_H
|
|
#include <mach/gpio.h>
|
|
#endif
|
|
|
|
#ifndef __ARM_GPIOLIB_COMPLEX
|
|
/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
|
|
#include <asm-generic/gpio.h>
|
|
|
|
/* The trivial gpiolib dispatchers */
|
|
#define gpio_get_value __gpio_get_value
|
|
#define gpio_set_value __gpio_set_value
|
|
#define gpio_cansleep __gpio_cansleep
|
|
#endif
|
|
|
|
/*
|
|
* Provide a default gpio_to_irq() which should satisfy every case.
|
|
* However, some platforms want to do this differently, so allow them
|
|
* to override it.
|
|
*/
|
|
#ifndef gpio_to_irq
|
|
#define gpio_to_irq __gpio_to_irq
|
|
#endif
|
|
|
|
#endif /* _ARCH_ARM_GPIO_H */
|