From 22fe67837614469f8e86c97e9e43d46270701b33 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 26 Jul 2011 11:04:51 +0100 Subject: ARM: gpio: consolidate trivial gpiolib implementations Consolidate 24 trivial gpiolib implementions out of mach/gpio.h into asm/gpio.h. This is basically the include of asm-generic/gpio.h and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep as described in Documentation/gpio.txt Acked-by: H Hartley Sweeten Tested-by: David Brown Acked-by: David Brown Tested-by: Linus Walleij Acked-by: Kukjin Kim Tested-by: Shawn Guo Signed-off-by: Russell King --- arch/arm/mach-mxs/include/mach/gpio.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'arch/arm/mach-mxs') diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h index 828ccccb6aa..bb44c8dcf31 100644 --- a/arch/arm/mach-mxs/include/mach/gpio.h +++ b/arch/arm/mach-mxs/include/mach/gpio.h @@ -20,14 +20,10 @@ #ifndef __MACH_MXS_GPIO_H__ #define __MACH_MXS_GPIO_H__ -#include - #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) /* use gpiolib dispatchers */ -#define gpio_get_value __gpio_get_value -#define gpio_set_value __gpio_set_value -#define gpio_cansleep __gpio_cansleep +#define __ARM_GPIOLIB_TRIVIAL #define gpio_to_irq __gpio_to_irq #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) -- cgit v1.2.3-70-g09d2 From 01e7dc89d060413fd639635618de506093730964 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 26 Jul 2011 11:29:42 +0100 Subject: ARM: gpio: consolidate gpio_to_irq Many of the gpio_to_irq implementations use the gpiolib version of this function. Provide the standard gpiolib gpio_to_irq() for everyone, but allow platforms to override it if they wish. Add the neccessary overrides for those platforms which do not use the standard definition. Acked-by: Kukjin Kim Signed-off-by: Russell King --- arch/arm/include/asm/gpio.h | 9 +++++++++ arch/arm/mach-davinci/include/mach/gpio.h | 5 ----- arch/arm/mach-exynos4/include/mach/gpio.h | 2 -- arch/arm/mach-ixp4xx/include/mach/gpio.h | 1 + arch/arm/mach-ks8695/include/mach/gpio.h | 2 -- arch/arm/mach-lpc32xx/include/mach/gpio.h | 5 ----- arch/arm/mach-msm/include/mach/gpio.h | 2 -- arch/arm/mach-mxs/include/mach/gpio.h | 1 - arch/arm/mach-realview/include/mach/gpio.h | 1 - arch/arm/mach-s3c2410/include/mach/gpio.h | 1 - arch/arm/mach-s3c64xx/include/mach/gpio.h | 1 - arch/arm/mach-s5p64x0/include/mach/gpio.h | 1 - arch/arm/mach-s5pc100/include/mach/gpio.h | 1 - arch/arm/mach-s5pv210/include/mach/gpio.h | 1 - arch/arm/mach-shmobile/include/mach/gpio.h | 5 ----- arch/arm/mach-tegra/include/mach/gpio.h | 1 + arch/arm/mach-u300/include/mach/gpio.h | 1 + arch/arm/mach-versatile/include/mach/gpio.h | 1 - arch/arm/mach-vt8500/include/mach/gpio.h | 1 - arch/arm/mach-w90x900/include/mach/gpio.h | 1 + arch/arm/plat-nomadik/include/plat/gpio.h | 1 - arch/arm/plat-omap/include/plat/gpio.h | 5 ----- arch/arm/plat-orion/include/plat/gpio.h | 5 ----- arch/arm/plat-spear/include/plat/gpio.h | 1 - 24 files changed, 13 insertions(+), 42 deletions(-) (limited to 'arch/arm/mach-mxs') diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h index 15e8970f20f..5032224eec3 100644 --- a/arch/arm/include/asm/gpio.h +++ b/arch/arm/include/asm/gpio.h @@ -14,4 +14,13 @@ #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 */ diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h index fbece126c2b..73fc7a087f8 100644 --- a/arch/arm/mach-davinci/include/mach/gpio.h +++ b/arch/arm/mach-davinci/include/mach/gpio.h @@ -147,11 +147,6 @@ static inline int gpio_cansleep(unsigned gpio) return __gpio_cansleep(gpio); } -static inline int gpio_to_irq(unsigned gpio) -{ - return __gpio_to_irq(gpio); -} - static inline int irq_to_gpio(unsigned irq) { /* don't support the reverse mapping */ diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h index b2e3595ae94..b91e8b2782b 100644 --- a/arch/arm/mach-exynos4/include/mach/gpio.h +++ b/arch/arm/mach-exynos4/include/mach/gpio.h @@ -13,8 +13,6 @@ #ifndef __ASM_ARCH_GPIO_H #define __ASM_ARCH_GPIO_H __FILE__ -#define gpio_to_irq __gpio_to_irq - /* Practically, GPIO banks up to GPZ are the configurable gpio banks */ /* GPIO bank sizes */ diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h index a5f87ded2f2..19009bf98a0 100644 --- a/arch/arm/mach-ixp4xx/include/mach/gpio.h +++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h @@ -70,6 +70,7 @@ static inline void gpio_set_value(unsigned gpio, int value) #include /* cansleep wrappers */ extern int gpio_to_irq(int gpio); +#define gpio_to_irq gpio_to_irq extern int irq_to_gpio(unsigned int irq); #endif diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index c13952c22a3..59d6b53d27c 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -40,8 +40,6 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); */ extern int irq_to_gpio(unsigned int irq); -#define gpio_to_irq __gpio_to_irq - #define __ARM_GPIOLIB_TRIVIAL /* Register the GPIOs */ diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio.h b/arch/arm/mach-lpc32xx/include/mach/gpio.h index 0ca6c2778aa..b01cd24715d 100644 --- a/arch/arm/mach-lpc32xx/include/mach/gpio.h +++ b/arch/arm/mach-lpc32xx/include/mach/gpio.h @@ -51,9 +51,4 @@ #define __ARM_GPIOLIB_TRIVIAL -static inline int gpio_to_irq(unsigned gpio) -{ - return __gpio_to_irq(gpio); -} - #endif diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h index bc75e204114..10197a9e9d9 100644 --- a/arch/arm/mach-msm/include/mach/gpio.h +++ b/arch/arm/mach-msm/include/mach/gpio.h @@ -18,6 +18,4 @@ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq - #endif /* __ASM_ARCH_MSM_GPIO_H */ diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h index bb44c8dcf31..bf28a1f8dc4 100644 --- a/arch/arm/mach-mxs/include/mach/gpio.h +++ b/arch/arm/mach-mxs/include/mach/gpio.h @@ -24,7 +24,6 @@ /* use gpiolib dispatchers */ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h index bd11dc503cc..910974bbd83 100644 --- a/arch/arm/mach-realview/include/mach/gpio.h +++ b/arch/arm/mach-realview/include/mach/gpio.h @@ -1,2 +1 @@ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h index 998ef4c41de..d502d17d46b 100644 --- a/arch/arm/mach-s3c2410/include/mach/gpio.h +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h @@ -12,7 +12,6 @@ */ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq /* some boards require extra gpio capacity to support external * devices that need GPIO. diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h index 6958b3fe525..3a8857c68e4 100644 --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h +++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h @@ -13,7 +13,6 @@ */ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq /* GPIO bank sizes */ #define S3C64XX_GPIO_A_NR (8) diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h index a25160b426d..c3a6aa0c472 100644 --- a/arch/arm/mach-s5p64x0/include/mach/gpio.h +++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h @@ -14,7 +14,6 @@ #define __ASM_ARCH_GPIO_H __FILE__ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq /* GPIO bank sizes */ diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h index f515bfb964a..0e75641249c 100644 --- a/arch/arm/mach-s5pc100/include/mach/gpio.h +++ b/arch/arm/mach-s5pc100/include/mach/gpio.h @@ -16,7 +16,6 @@ #define __ASM_ARCH_GPIO_H __FILE__ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq /* GPIO bank sizes */ #define S5PC100_GPIO_A0_NR (8) diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h index 27f2139df31..d348ee2cb0a 100644 --- a/arch/arm/mach-s5pv210/include/mach/gpio.h +++ b/arch/arm/mach-s5pv210/include/mach/gpio.h @@ -14,7 +14,6 @@ #define __ASM_ARCH_GPIO_H __FILE__ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq /* Practically, GPIO banks up to MP03 are the configurable gpio banks */ diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index e8feff014d9..95e11cfe4e4 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h @@ -20,11 +20,6 @@ #define __ARM_GPIOLIB_TRIVIAL -static inline int gpio_to_irq(unsigned gpio) -{ - return __gpio_to_irq(gpio); -} - static inline int irq_to_gpio(unsigned int irq) { return -ENOSYS; diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h index d51be09fe3a..51072238d85 100644 --- a/arch/arm/mach-tegra/include/mach/gpio.h +++ b/arch/arm/mach-tegra/include/mach/gpio.h @@ -36,6 +36,7 @@ static inline int gpio_to_irq(unsigned int gpio) return INT_GPIO_BASE + gpio; return -EINVAL; } +#define gpio_to_irq gpio_to_irq static inline int irq_to_gpio(unsigned int irq) { diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h index d5a71abcbae..3d7b7d1291e 100644 --- a/arch/arm/mach-u300/include/mach/gpio.h +++ b/arch/arm/mach-u300/include/mach/gpio.h @@ -281,6 +281,7 @@ static inline unsigned gpio_to_irq(unsigned gpio) { return PIN_TO_PORT(gpio) + IRQ_U300_GPIO_PORT0; } +#define gpio_to_irq gpio_to_irq static inline unsigned irq_to_gpio(unsigned irq) { diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h index bd11dc503cc..910974bbd83 100644 --- a/arch/arm/mach-versatile/include/mach/gpio.h +++ b/arch/arm/mach-versatile/include/mach/gpio.h @@ -1,2 +1 @@ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h index bd11dc503cc..910974bbd83 100644 --- a/arch/arm/mach-vt8500/include/mach/gpio.h +++ b/arch/arm/mach-vt8500/include/mach/gpio.h @@ -1,2 +1 @@ #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h index 60c784619b2..e7d4ed15680 100644 --- a/arch/arm/mach-w90x900/include/mach/gpio.h +++ b/arch/arm/mach-w90x900/include/mach/gpio.h @@ -22,6 +22,7 @@ static inline int gpio_to_irq(unsigned gpio) { return gpio; } +#define gpio_to_irq gpio_to_irq static inline int irq_to_gpio(unsigned irq) { diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h index c804c3474c8..d2c4290317d 100644 --- a/arch/arm/plat-nomadik/include/plat/gpio.h +++ b/arch/arm/plat-nomadik/include/plat/gpio.h @@ -15,7 +15,6 @@ #include #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq /* * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h index 20eedbbcdcb..f1fdfa5a9cf 100644 --- a/arch/arm/plat-omap/include/plat/gpio.h +++ b/arch/arm/plat-omap/include/plat/gpio.h @@ -224,11 +224,6 @@ extern void omap_gpio_restore_context(void); #define __ARM_GPIOLIB_TRIVIAL -static inline int gpio_to_irq(unsigned gpio) -{ - return __gpio_to_irq(gpio); -} - static inline int irq_to_gpio(unsigned irq) { int tmp; diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h index 71c4c6c28e5..985c197aecc 100644 --- a/arch/arm/plat-orion/include/plat/gpio.h +++ b/arch/arm/plat-orion/include/plat/gpio.h @@ -15,11 +15,6 @@ #define __ARM_GPIOLIB_TRIVIAL -/* - * GENERIC_GPIO primitives. - */ -#define gpio_to_irq __gpio_to_irq - /* * Orion-specific GPIO API extensions. */ diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h index 3c6f04403d9..22d9e0fc1fc 100644 --- a/arch/arm/plat-spear/include/plat/gpio.h +++ b/arch/arm/plat-spear/include/plat/gpio.h @@ -15,6 +15,5 @@ #define __PLAT_GPIO_H #define __ARM_GPIOLIB_TRIVIAL -#define gpio_to_irq __gpio_to_irq #endif /* __PLAT_GPIO_H */ -- cgit v1.2.3-70-g09d2 From 8f3c4537bb08001c4772d66ad3fcfcf24d8d180d Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 8 Aug 2011 13:58:28 +0100 Subject: ARM: gpio: make trivial GPIOLIB implementation the default Rather than marking the mach/gpio.h header files which want to use the trivial GPIOLIB implementation, mark those which do not want to use it instead. This means that by default, you get the trivial implementation and only have to do something extra if you need to. This should encourage the use of the trivial default implementation. As an additional bonus, several gpio.h header files become empty. Acked-by: H Hartley Sweeten Tested-by: Jamie Iles Acked-by: Kukjin Kim Signed-off-by: Russell King --- arch/arm/include/asm/gpio.h | 2 +- arch/arm/include/asm/hardware/iop3xx-gpio.h | 2 ++ arch/arm/mach-at91/include/mach/gpio.h | 2 -- arch/arm/mach-davinci/include/mach/gpio.h | 2 ++ arch/arm/mach-ep93xx/include/mach/gpio.h | 3 --- arch/arm/mach-exynos4/include/mach/gpio.h | 2 -- arch/arm/mach-gemini/include/mach/gpio.h | 2 -- arch/arm/mach-ixp4xx/include/mach/gpio.h | 2 ++ arch/arm/mach-ks8695/include/mach/gpio.h | 2 -- arch/arm/mach-lpc32xx/include/mach/gpio.h | 2 -- arch/arm/mach-msm/include/mach/gpio.h | 22 +--------------------- arch/arm/mach-mxs/include/mach/gpio.h | 3 --- arch/arm/mach-realview/include/mach/gpio.h | 2 +- arch/arm/mach-s3c2410/include/mach/gpio.h | 2 -- arch/arm/mach-s3c64xx/include/mach/gpio.h | 2 -- arch/arm/mach-s5p64x0/include/mach/gpio.h | 2 -- arch/arm/mach-s5pc100/include/mach/gpio.h | 2 -- arch/arm/mach-s5pv210/include/mach/gpio.h | 2 -- arch/arm/mach-sa1100/include/mach/gpio.h | 2 ++ arch/arm/mach-shmobile/include/mach/gpio.h | 6 ++++-- arch/arm/mach-tegra/include/mach/gpio.h | 2 -- arch/arm/mach-u300/include/mach/gpio.h | 2 ++ arch/arm/mach-versatile/include/mach/gpio.h | 2 +- arch/arm/mach-vt8500/include/mach/gpio.h | 2 +- arch/arm/mach-w90x900/include/mach/gpio.h | 2 -- arch/arm/plat-mxc/include/mach/gpio.h | 3 --- arch/arm/plat-nomadik/include/plat/gpio.h | 2 -- arch/arm/plat-omap/include/plat/gpio.h | 2 -- arch/arm/plat-orion/include/plat/gpio.h | 2 -- arch/arm/plat-pxa/include/plat/gpio.h | 2 ++ arch/arm/plat-spear/include/plat/gpio.h | 20 +------------------- 31 files changed, 22 insertions(+), 85 deletions(-) (limited to 'arch/arm/mach-mxs') diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h index 5032224eec3..11ad0bfbb0a 100644 --- a/arch/arm/include/asm/gpio.h +++ b/arch/arm/include/asm/gpio.h @@ -4,7 +4,7 @@ /* not all ARM platforms necessarily support this API ... */ #include -#ifdef __ARM_GPIOLIB_TRIVIAL +#ifndef __ARM_GPIOLIB_COMPLEX /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ #include diff --git a/arch/arm/include/asm/hardware/iop3xx-gpio.h b/arch/arm/include/asm/hardware/iop3xx-gpio.h index b69d972b1f7..9eda7dc92ad 100644 --- a/arch/arm/include/asm/hardware/iop3xx-gpio.h +++ b/arch/arm/include/asm/hardware/iop3xx-gpio.h @@ -28,6 +28,8 @@ #include #include +#define __ARM_GPIOLIB_COMPLEX + #define IOP3XX_N_GPIOS 8 static inline int gpio_get_value(unsigned gpio) diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h index 6ddc1a628b7..2b9a1f51210 100644 --- a/arch/arm/mach-at91/include/mach/gpio.h +++ b/arch/arm/mach-at91/include/mach/gpio.h @@ -215,8 +215,6 @@ extern void at91_gpio_resume(void); #include -#define __ARM_GPIOLIB_TRIVIAL - #define gpio_to_irq(gpio) (gpio) #define irq_to_gpio(irq) (irq) diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h index 73fc7a087f8..14e7bb20a33 100644 --- a/arch/arm/mach-davinci/include/mach/gpio.h +++ b/arch/arm/mach-davinci/include/mach/gpio.h @@ -21,6 +21,8 @@ #include #include +#define __ARM_GPIOLIB_COMPLEX + #define DAVINCI_GPIO_BASE 0x01C67000 enum davinci_gpio_type { diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h index fbc770e3e0c..071f676c6e0 100644 --- a/arch/arm/mach-ep93xx/include/mach/gpio.h +++ b/arch/arm/mach-ep93xx/include/mach/gpio.h @@ -99,9 +99,6 @@ /* maximum value for irq capable line identifiers */ #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) -/* new generic GPIO API - see Documentation/gpio.txt */ -#define __ARM_GPIOLIB_TRIVIAL - /* * Map GPIO A0..A7 (0..7) to irq 64..71, * B0..B7 (7..15) to irq 72..79, and diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h index b91e8b2782b..80523ca9bb4 100644 --- a/arch/arm/mach-exynos4/include/mach/gpio.h +++ b/arch/arm/mach-exynos4/include/mach/gpio.h @@ -146,6 +146,4 @@ enum s5p_gpio_number { #define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \ CONFIG_SAMSUNG_GPIO_EXTRA + 1) -#define __ARM_GPIOLIB_TRIVIAL - #endif /* __ASM_ARCH_GPIO_H */ diff --git a/arch/arm/mach-gemini/include/mach/gpio.h b/arch/arm/mach-gemini/include/mach/gpio.h index 20c0a362377..40a0527bada 100644 --- a/arch/arm/mach-gemini/include/mach/gpio.h +++ b/arch/arm/mach-gemini/include/mach/gpio.h @@ -14,8 +14,6 @@ #include -#define __ARM_GPIOLIB_TRIVIAL - #define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE) #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE) diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h index 19009bf98a0..83d6b4ed60b 100644 --- a/arch/arm/mach-ixp4xx/include/mach/gpio.h +++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h @@ -28,6 +28,8 @@ #include #include +#define __ARM_GPIOLIB_COMPLEX + static inline int gpio_request(unsigned gpio, const char *label) { return 0; diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 59d6b53d27c..994267b02af 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -40,8 +40,6 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); */ extern int irq_to_gpio(unsigned int irq); -#define __ARM_GPIOLIB_TRIVIAL - /* Register the GPIOs */ extern void ks8695_register_gpios(void); diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio.h b/arch/arm/mach-lpc32xx/include/mach/gpio.h index b01cd24715d..66d31f615eb 100644 --- a/arch/arm/mach-lpc32xx/include/mach/gpio.h +++ b/arch/arm/mach-lpc32xx/include/mach/gpio.h @@ -49,6 +49,4 @@ */ #define LPC32XX_GPIO(x, y) ((x) + (y)) -#define __ARM_GPIOLIB_TRIVIAL - #endif diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h index 10197a9e9d9..40a8c178f10 100644 --- a/arch/arm/mach-msm/include/mach/gpio.h +++ b/arch/arm/mach-msm/include/mach/gpio.h @@ -1,21 +1 @@ -/* - * Copyright (C) 2007 Google, Inc. - * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. - * Author: Mike Lockwood - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ -#ifndef __ASM_ARCH_MSM_GPIO_H -#define __ASM_ARCH_MSM_GPIO_H - -#define __ARM_GPIOLIB_TRIVIAL - -#endif /* __ASM_ARCH_MSM_GPIO_H */ +/* empty */ diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h index bf28a1f8dc4..bb11e63261e 100644 --- a/arch/arm/mach-mxs/include/mach/gpio.h +++ b/arch/arm/mach-mxs/include/mach/gpio.h @@ -22,9 +22,6 @@ #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) -/* use gpiolib dispatchers */ -#define __ARM_GPIOLIB_TRIVIAL - #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) #endif /* __MACH_MXS_GPIO_H__ */ diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h index 910974bbd83..40a8c178f10 100644 --- a/arch/arm/mach-realview/include/mach/gpio.h +++ b/arch/arm/mach-realview/include/mach/gpio.h @@ -1 +1 @@ -#define __ARM_GPIOLIB_TRIVIAL +/* empty */ diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h index d502d17d46b..6fac70f3484 100644 --- a/arch/arm/mach-s3c2410/include/mach/gpio.h +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h @@ -11,8 +11,6 @@ * published by the Free Software Foundation. */ -#define __ARM_GPIOLIB_TRIVIAL - /* some boards require extra gpio capacity to support external * devices that need GPIO. */ diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h index 3a8857c68e4..6e34c2f6e67 100644 --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h +++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h @@ -12,8 +12,6 @@ * published by the Free Software Foundation. */ -#define __ARM_GPIOLIB_TRIVIAL - /* GPIO bank sizes */ #define S3C64XX_GPIO_A_NR (8) #define S3C64XX_GPIO_B_NR (7) diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h index c3a6aa0c472..06cd3c9b16a 100644 --- a/arch/arm/mach-s5p64x0/include/mach/gpio.h +++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h @@ -13,8 +13,6 @@ #ifndef __ASM_ARCH_GPIO_H #define __ASM_ARCH_GPIO_H __FILE__ -#define __ARM_GPIOLIB_TRIVIAL - /* GPIO bank sizes */ #define S5P6440_GPIO_A_NR (6) diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h index 0e75641249c..5e1a924b595 100644 --- a/arch/arm/mach-s5pc100/include/mach/gpio.h +++ b/arch/arm/mach-s5pc100/include/mach/gpio.h @@ -15,8 +15,6 @@ #ifndef __ASM_ARCH_GPIO_H #define __ASM_ARCH_GPIO_H __FILE__ -#define __ARM_GPIOLIB_TRIVIAL - /* GPIO bank sizes */ #define S5PC100_GPIO_A0_NR (8) #define S5PC100_GPIO_A1_NR (5) diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h index d348ee2cb0a..6c8b903c02e 100644 --- a/arch/arm/mach-s5pv210/include/mach/gpio.h +++ b/arch/arm/mach-s5pv210/include/mach/gpio.h @@ -13,8 +13,6 @@ #ifndef __ASM_ARCH_GPIO_H #define __ASM_ARCH_GPIO_H __FILE__ -#define __ARM_GPIOLIB_TRIVIAL - /* Practically, GPIO banks up to MP03 are the configurable gpio banks */ /* GPIO bank sizes */ diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h index 7befc104e9a..ab45b436b04 100644 --- a/arch/arm/mach-sa1100/include/mach/gpio.h +++ b/arch/arm/mach-sa1100/include/mach/gpio.h @@ -28,6 +28,8 @@ #include #include +#define __ARM_GPIOLIB_COMPLEX + static inline int gpio_get_value(unsigned gpio) { if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX)) diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index 95e11cfe4e4..7bf0890e16b 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h @@ -18,13 +18,15 @@ #ifdef CONFIG_GPIOLIB -#define __ARM_GPIOLIB_TRIVIAL - static inline int irq_to_gpio(unsigned int irq) { return -ENOSYS; } +#else + +#define __ARM_GPIOLIB_COMPLEX + #endif /* CONFIG_GPIOLIB */ #endif /* __ASM_ARCH_GPIO_H */ diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h index 51072238d85..e3538055f40 100644 --- a/arch/arm/mach-tegra/include/mach/gpio.h +++ b/arch/arm/mach-tegra/include/mach/gpio.h @@ -25,8 +25,6 @@ #define TEGRA_NR_GPIOS INT_GPIO_NR -#define __ARM_GPIOLIB_TRIVIAL - #define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) #define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE) diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h index 3d7b7d1291e..9a890e2b74c 100644 --- a/arch/arm/mach-u300/include/mach/gpio.h +++ b/arch/arm/mach-u300/include/mach/gpio.h @@ -18,6 +18,8 @@ #include #include +#define __ARM_GPIOLIB_COMPLEX + /* Switch type depending on platform/chip variant */ #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) #define U300_COH901335 diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h index 910974bbd83..40a8c178f10 100644 --- a/arch/arm/mach-versatile/include/mach/gpio.h +++ b/arch/arm/mach-versatile/include/mach/gpio.h @@ -1 +1 @@ -#define __ARM_GPIOLIB_TRIVIAL +/* empty */ diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h index 910974bbd83..40a8c178f10 100644 --- a/arch/arm/mach-vt8500/include/mach/gpio.h +++ b/arch/arm/mach-vt8500/include/mach/gpio.h @@ -1 +1 @@ -#define __ARM_GPIOLIB_TRIVIAL +/* empty */ diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h index e7d4ed15680..5385a420327 100644 --- a/arch/arm/mach-w90x900/include/mach/gpio.h +++ b/arch/arm/mach-w90x900/include/mach/gpio.h @@ -16,8 +16,6 @@ #include #include -#define __ARM_GPIOLIB_TRIVIAL - static inline int gpio_to_irq(unsigned gpio) { return gpio; diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h index 4398edd0378..3e1ffc8b8f0 100644 --- a/arch/arm/plat-mxc/include/mach/gpio.h +++ b/arch/arm/plat-mxc/include/mach/gpio.h @@ -27,9 +27,6 @@ /* range e.g. GPIO_1_5 is gpio 5 under linux */ #define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) -/* use gpiolib dispatchers */ -#define __ARM_GPIOLIB_TRIVIAL - #define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio)) #define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START) diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h index d2c4290317d..b894a531f32 100644 --- a/arch/arm/plat-nomadik/include/plat/gpio.h +++ b/arch/arm/plat-nomadik/include/plat/gpio.h @@ -14,8 +14,6 @@ #include -#define __ARM_GPIOLIB_TRIVIAL - /* * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving * the "gpio" namespace for generic and cross-machine functions diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h index f1fdfa5a9cf..9e86ee0aed0 100644 --- a/arch/arm/plat-omap/include/plat/gpio.h +++ b/arch/arm/plat-omap/include/plat/gpio.h @@ -222,8 +222,6 @@ extern void omap_gpio_restore_context(void); #include #include -#define __ARM_GPIOLIB_TRIVIAL - static inline int irq_to_gpio(unsigned irq) { int tmp; diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h index 985c197aecc..f7d76308603 100644 --- a/arch/arm/plat-orion/include/plat/gpio.h +++ b/arch/arm/plat-orion/include/plat/gpio.h @@ -13,8 +13,6 @@ #include -#define __ARM_GPIOLIB_TRIVIAL - /* * Orion-specific GPIO API extensions. */ diff --git a/arch/arm/plat-pxa/include/plat/gpio.h b/arch/arm/plat-pxa/include/plat/gpio.h index 1ddd2b97a72..6fc41db93e1 100644 --- a/arch/arm/plat-pxa/include/plat/gpio.h +++ b/arch/arm/plat-pxa/include/plat/gpio.h @@ -1,6 +1,8 @@ #ifndef __PLAT_GPIO_H #define __PLAT_GPIO_H +#define __ARM_GPIOLIB_COMPLEX + struct irq_data; /* diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h index 22d9e0fc1fc..40a8c178f10 100644 --- a/arch/arm/plat-spear/include/plat/gpio.h +++ b/arch/arm/plat-spear/include/plat/gpio.h @@ -1,19 +1 @@ -/* - * arch/arm/plat-spear/include/plat/gpio.h - * - * GPIO macros for SPEAr platform - * - * Copyright (C) 2009 ST Microelectronics - * Viresh Kumar - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef __PLAT_GPIO_H -#define __PLAT_GPIO_H - -#define __ARM_GPIOLIB_TRIVIAL - -#endif /* __PLAT_GPIO_H */ +/* empty */ -- cgit v1.2.3-70-g09d2