Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22fe6783 authored by Russell King's avatar Russell King
Browse files

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: default avatarDavid Brown <davidb@codeaurora.org>
Acked-by: default avatarDavid Brown <davidb@codeaurora.org>
Tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Tested-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 50ac01fb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -4,4 +4,14 @@
/* not all ARM platforms necessarily support this API ... */
#include <mach/gpio.h>

#ifdef __ARM_GPIOLIB_TRIVIAL
/* 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

#endif /* _ARCH_ARM_GPIO_H */
+1 −4
Original line number Diff line number Diff line
@@ -214,11 +214,8 @@ extern void at91_gpio_resume(void);
 */

#include <asm/errno.h>
#include <asm-generic/gpio.h>		/* cansleep wrappers */

#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) (gpio)
#define irq_to_gpio(irq)  (irq)
+1 −6
Original line number Diff line number Diff line
@@ -100,12 +100,7 @@
#define EP93XX_GPIO_LINE_MAX_IRQ	EP93XX_GPIO_LINE_F(7)

/* new generic GPIO API - see Documentation/gpio.txt */

#include <asm-generic/gpio.h>

#define gpio_get_value	__gpio_get_value
#define gpio_set_value	__gpio_set_value
#define gpio_cansleep	__gpio_cansleep
#define __ARM_GPIOLIB_TRIVIAL

/*
 * Map GPIO A0..A7  (0..7)  to irq 64..71,
+1 −4
Original line number Diff line number Diff line
@@ -13,9 +13,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__

#define gpio_get_value	__gpio_get_value
#define gpio_set_value	__gpio_set_value
#define gpio_cansleep	__gpio_cansleep
#define gpio_to_irq	__gpio_to_irq

/* Practically, GPIO banks up to GPZ are the configurable gpio banks */
@@ -151,6 +148,6 @@ enum s5p_gpio_number {
#define ARCH_NR_GPIOS		(EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) +	\
				 CONFIG_SAMSUNG_GPIO_EXTRA + 1)

#include <asm-generic/gpio.h>
#define __ARM_GPIOLIB_TRIVIAL

#endif /* __ASM_ARCH_GPIO_H */
+1 −4
Original line number Diff line number Diff line
@@ -13,11 +13,8 @@
#define __MACH_GPIO_H__

#include <mach/irqs.h>
#include <asm-generic/gpio.h>

#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(x)	((x) + GPIO_IRQ_BASE)
#define irq_to_gpio(x)	((x) - GPIO_IRQ_BASE)
Loading