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-ks8695/include/mach/gpio.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-ks8695/include/mach/gpio.h') diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 86312d476bc..c13952c22a3 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -40,17 +40,10 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); */ extern int irq_to_gpio(unsigned int irq); -#include - -/* If it turns out that we need to optimise GPIO access for the - * Micrel's GPIOs, then these can be changed to check their argument - * directly as static inlines. However for now it's probably not - * worthwhile. - */ -#define gpio_get_value __gpio_get_value -#define gpio_set_value __gpio_set_value #define gpio_to_irq __gpio_to_irq +#define __ARM_GPIOLIB_TRIVIAL + /* Register the GPIOs */ extern void ks8695_register_gpios(void); -- cgit v1.2.2 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/mach-ks8695/include/mach/gpio.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/arm/mach-ks8695/include/mach/gpio.h') 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 */ -- cgit v1.2.2 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/mach-ks8695/include/mach/gpio.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/arm/mach-ks8695/include/mach/gpio.h') 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); -- cgit v1.2.2 From e24e4498cb4930bf785e46f98e7be7becece8b4c Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 22 Aug 2011 08:37:38 +0100 Subject: ARM: 7036/1: mach-ks8695: break out GPIO driver specifics The file is included from upper directories and deal with generic GPIO and gpiolib stuff. Break out the platform and driver specific defines and functions into its own header file. Cc: zeal Cc: Ben Dooks Acked-by: Daniel Silverstone Acked-by: Simtec Linux Team Signed-off-by: Linus Walleij Signed-off-by: Russell King --- arch/arm/mach-ks8695/include/mach/gpio.h | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'arch/arm/mach-ks8695/include/mach/gpio.h') diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 994267b02af..f5fda36e451 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -11,36 +11,9 @@ #ifndef __ASM_ARCH_GPIO_H_ #define __ASM_ARCH_GPIO_H_ -#include - -#define KS8695_GPIO_0 0 -#define KS8695_GPIO_1 1 -#define KS8695_GPIO_2 2 -#define KS8695_GPIO_3 3 -#define KS8695_GPIO_4 4 -#define KS8695_GPIO_5 5 -#define KS8695_GPIO_6 6 -#define KS8695_GPIO_7 7 -#define KS8695_GPIO_8 8 -#define KS8695_GPIO_9 9 -#define KS8695_GPIO_10 10 -#define KS8695_GPIO_11 11 -#define KS8695_GPIO_12 12 -#define KS8695_GPIO_13 13 -#define KS8695_GPIO_14 14 -#define KS8695_GPIO_15 15 - -/* - * Configure GPIO pin as external interrupt source. - */ -extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); - /* * Map IRQ number to GPIO line. */ extern int irq_to_gpio(unsigned int irq); -/* Register the GPIOs */ -extern void ks8695_register_gpios(void); - #endif -- cgit v1.2.2