ARM: gpio: make trivial GPIOLIB implementation the default
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 8 Aug 2011 12:58:28 +0000 (13:58 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 12 Aug 2011 07:54:19 +0000 (08:54 +0100)
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 <hsweeten@visionengravers.com>
Tested-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
31 files changed:
arch/arm/include/asm/gpio.h
arch/arm/include/asm/hardware/iop3xx-gpio.h
arch/arm/mach-at91/include/mach/gpio.h
arch/arm/mach-davinci/include/mach/gpio.h
arch/arm/mach-ep93xx/include/mach/gpio.h
arch/arm/mach-exynos4/include/mach/gpio.h
arch/arm/mach-gemini/include/mach/gpio.h
arch/arm/mach-ixp4xx/include/mach/gpio.h
arch/arm/mach-ks8695/include/mach/gpio.h
arch/arm/mach-lpc32xx/include/mach/gpio.h
arch/arm/mach-msm/include/mach/gpio.h
arch/arm/mach-mxs/include/mach/gpio.h
arch/arm/mach-realview/include/mach/gpio.h
arch/arm/mach-s3c2410/include/mach/gpio.h
arch/arm/mach-s3c64xx/include/mach/gpio.h
arch/arm/mach-s5p64x0/include/mach/gpio.h
arch/arm/mach-s5pc100/include/mach/gpio.h
arch/arm/mach-s5pv210/include/mach/gpio.h
arch/arm/mach-sa1100/include/mach/gpio.h
arch/arm/mach-shmobile/include/mach/gpio.h
arch/arm/mach-tegra/include/mach/gpio.h
arch/arm/mach-u300/include/mach/gpio.h
arch/arm/mach-versatile/include/mach/gpio.h
arch/arm/mach-vt8500/include/mach/gpio.h
arch/arm/mach-w90x900/include/mach/gpio.h
arch/arm/plat-mxc/include/mach/gpio.h
arch/arm/plat-nomadik/include/plat/gpio.h
arch/arm/plat-omap/include/plat/gpio.h
arch/arm/plat-orion/include/plat/gpio.h
arch/arm/plat-pxa/include/plat/gpio.h
arch/arm/plat-spear/include/plat/gpio.h

index 5032224eec3db85d05dcb154510a4253a2318eba..11ad0bfbb0ad67ca3c3865d25a216b22a13c10f5 100644 (file)
@@ -4,7 +4,7 @@
 /* not all ARM platforms necessarily support this API ... */
 #include <mach/gpio.h>
 
-#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 <asm-generic/gpio.h>
 
index b69d972b1f7d21987c2ca86c7119cb101767f75d..9eda7dc92ad8d79c2214ac1ba472fa9e29c2357f 100644 (file)
@@ -28,6 +28,8 @@
 #include <mach/hardware.h>
 #include <asm-generic/gpio.h>
 
+#define __ARM_GPIOLIB_COMPLEX
+
 #define IOP3XX_N_GPIOS 8
 
 static inline int gpio_get_value(unsigned gpio)
index 6ddc1a628b7e6f5645e3e3c3dedd91b785480fa1..2b9a1f51210f0cc048048410bd9e801883e04bc9 100644 (file)
@@ -215,8 +215,6 @@ extern void at91_gpio_resume(void);
 
 #include <asm/errno.h>
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 #define gpio_to_irq(gpio) (gpio)
 #define irq_to_gpio(irq)  (irq)
 
index 73fc7a087f8351da197a44b14740ef112ade40b3..14e7bb20a33a8b6b72725f651a58734d05dd297b 100644 (file)
@@ -21,6 +21,8 @@
 #include <mach/irqs.h>
 #include <mach/common.h>
 
+#define __ARM_GPIOLIB_COMPLEX
+
 #define DAVINCI_GPIO_BASE 0x01C67000
 
 enum davinci_gpio_type {
index fbc770e3e0cf69f1ace188fa0640b12f9fa1b017..071f676c6e090cfa8debc5f24fd756e0da587029 100644 (file)
@@ -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
index b91e8b2782bcbd529cdd11d500081f2ff051cfb3..80523ca9bb49b87030220b9725e3c58b4922ed53 100644 (file)
@@ -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 */
index 20c0a3623779bf5893f68418109b7509a25edaa2..40a0527bada7a969d1bb366fe5bf7e150ace2256 100644 (file)
@@ -14,8 +14,6 @@
 
 #include <mach/irqs.h>
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 #define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE)
 #define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE)
 
index 19009bf98a0effac1c8de9eb23db775389b3bd1b..83d6b4ed60bbd42f3e912d68611205d720ad98a1 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/kernel.h>
 #include <mach/hardware.h>
 
+#define __ARM_GPIOLIB_COMPLEX
+
 static inline int gpio_request(unsigned gpio, const char *label)
 {
        return 0;
index 59d6b53d27c03a5d05fa0a5e8a40aba024493021..994267b02af885ff191ee5855eb8503b86a971b2 100644 (file)
@@ -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);
 
index b01cd24715dc27b5029f2e79bd888943471b915c..66d31f615eb95d639cd3f7d1cb038b2cf0b69e88 100644 (file)
@@ -49,6 +49,4 @@
  */
 #define LPC32XX_GPIO(x, y) ((x) + (y))
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 #endif
index 10197a9e9d90e485231be2bbe66afed1d4477aa9..40a8c178f10d9e85a2873c83247c3f2fe553f408 100644 (file)
@@ -1,21 +1 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- * Author: Mike Lockwood <lockwood@android.com>
- *
- * 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 */
index bf28a1f8dc4824789625436a160c50afea034f4d..bb11e63261e491fb36c750787487c23bce2dc313 100644 (file)
@@ -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__ */
index 910974bbd83b64911b9d4522ee97ebc41c46139b..40a8c178f10d9e85a2873c83247c3f2fe553f408 100644 (file)
@@ -1 +1 @@
-#define __ARM_GPIOLIB_TRIVIAL
+/* empty */
index d502d17d46bf4540ebb3c7d7e6cebd1af000a221..6fac70f3484e5b7f1733eb889916e20c69bda9a9 100644 (file)
@@ -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.
  */
index 3a8857c68e4d9df4fd5c35504b1bf6afe6417306..6e34c2f6e670394ac6437662af481af2bfaa7e79 100644 (file)
@@ -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)
index c3a6aa0c472fae7603c44b874e855b999b42fe24..06cd3c9b16ac14708831cffaf516f8d430b0a80b 100644 (file)
@@ -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)
index 0e75641249c780e62cd2fe626326de6ba17d29a7..5e1a924b595f4ca5db5c5901c2111f8ba0af3c3d 100644 (file)
@@ -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)
index d348ee2cb0ac8e5f00c59161732ad7fdc61554e4..6c8b903c02e422f7017a2573c270f413469f2b6f 100644 (file)
@@ -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 */
index 7befc104e9a97a2fef34fae884b32a8cb2d54d38..ab45b436b044055f781f36263199479e400eb798 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/irq.h>
 #include <asm-generic/gpio.h>
 
+#define __ARM_GPIOLIB_COMPLEX
+
 static inline int gpio_get_value(unsigned gpio)
 {
        if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
index 95e11cfe4e414575b973555fbca8f83bbed0dc17..7bf0890e16ba43963171bf5dea4b3345c27e25d8 100644 (file)
 
 #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 */
index 51072238d85a69d4d60f649d402354728485d9a2..e3538055f4095d638b9143386f4ad85406fd3f5b 100644 (file)
@@ -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)
 
index 3d7b7d1291e2b73b36fb167a8b5043a5b8d3c64f..9a890e2b74c749782af138cef84d994e7429043a 100644 (file)
@@ -18,6 +18,8 @@
 #include <mach/hardware.h>
 #include <asm/irq.h>
 
+#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
index 910974bbd83b64911b9d4522ee97ebc41c46139b..40a8c178f10d9e85a2873c83247c3f2fe553f408 100644 (file)
@@ -1 +1 @@
-#define __ARM_GPIOLIB_TRIVIAL
+/* empty */
index 910974bbd83b64911b9d4522ee97ebc41c46139b..40a8c178f10d9e85a2873c83247c3f2fe553f408 100644 (file)
@@ -1 +1 @@
-#define __ARM_GPIOLIB_TRIVIAL
+/* empty */
index e7d4ed1568029f81acc4c557d09dee1d1415d7b7..5385a42032779094043069f005b3e0a9cb8435b2 100644 (file)
@@ -16,8 +16,6 @@
 #include <mach/hardware.h>
 #include <asm/irq.h>
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 static inline int gpio_to_irq(unsigned gpio)
 {
        return gpio;
index 4398edd03780fac9fd75a6b6f61abf06c77b68a9..3e1ffc8b8f0c2d56283bdbc92b476bb07f86196d 100644 (file)
@@ -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)
 
index d2c4290317d928da5b74908d3bfac86d29902657..b894a531f3243b6fd181acf6d85cf28ca654ae70 100644 (file)
@@ -14,8 +14,6 @@
 
 #include <linux/kernel.h>
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 /*
  * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
  * the "gpio" namespace for generic and cross-machine functions
index f1fdfa5a9cf8e16b6ad522479dee01e89388653e..9e86ee0aed0a05fb5ad448d144a84a93e21e5d53 100644 (file)
@@ -222,8 +222,6 @@ extern void omap_gpio_restore_context(void);
 #include <linux/errno.h>
 #include <asm-generic/gpio.h>
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 static inline int irq_to_gpio(unsigned irq)
 {
        int tmp;
index 985c197aecc373645780148aa0e4d1c32291ccef..f7d76308603f541bab6b9274665f44c1c0fc06e8 100644 (file)
@@ -13,8 +13,6 @@
 
 #include <linux/init.h>
 
-#define __ARM_GPIOLIB_TRIVIAL
-
 /*
  * Orion-specific GPIO API extensions.
  */
index 1ddd2b97a72995d90107cb05d0658b1c035236f5..6fc41db93e1c39669354bd591ae62a423229df77 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __PLAT_GPIO_H
 #define __PLAT_GPIO_H
 
+#define __ARM_GPIOLIB_COMPLEX
+
 struct irq_data;
 
 /*
index 22d9e0fc1fccb3aefaa8b3c8783773d02728e499..40a8c178f10d9e85a2873c83247c3f2fe553f408 100644 (file)
@@ -1,19 +1 @@
-/*
- * arch/arm/plat-spear/include/plat/gpio.h
- *
- * GPIO macros for SPEAr platform
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.com>
- *
- * 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 */