diff options
Diffstat (limited to 'include/asm-arm/arch-s3c2410/gpio.h')
-rw-r--r-- | include/asm-arm/arch-s3c2410/gpio.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h index 67b8b9ab22e9..7583895fd336 100644 --- a/include/asm-arm/arch-s3c2410/gpio.h +++ b/include/asm-arm/arch-s3c2410/gpio.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/arch-pxa/gpio.h | 2 | * linux/include/asm-arm/arch-s3c2410/gpio.h |
3 | * | 3 | * |
4 | * S3C2400 GPIO wrappers for arch-neutral GPIO calls | 4 | * S3C2410 GPIO wrappers for arch-neutral GPIO calls |
5 | * | 5 | * |
6 | * Written by Philipp Zabel <philipp.zabel@gmail.com> | 6 | * Written by Philipp Zabel <philipp.zabel@gmail.com> |
7 | * | 7 | * |
@@ -21,14 +21,12 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef __ASM_ARCH_PXA_GPIO_H | 24 | #ifndef __ASM_ARCH_S3C2410_GPIO_H |
25 | #define __ASM_ARCH_PXA_GPIO_H | 25 | #define __ASM_ARCH_S3C2410_GPIO_H |
26 | 26 | ||
27 | #include <asm/arch/pxa-regs.h> | 27 | #include <asm/irq.h> |
28 | #include <asm/arch/irqs.h> | 28 | #include <asm/hardware.h> |
29 | #include <asm/arch/hardware.h> | 29 | #include <asm/arch/regs-gpio.h> |
30 | |||
31 | #include <asm/errno.h> | ||
32 | 30 | ||
33 | static inline int gpio_request(unsigned gpio, const char *label) | 31 | static inline int gpio_request(unsigned gpio, const char *label) |
34 | { | 32 | { |
@@ -46,9 +44,11 @@ static inline int gpio_direction_input(unsigned gpio) | |||
46 | return 0; | 44 | return 0; |
47 | } | 45 | } |
48 | 46 | ||
49 | static inline int gpio_direction_output(unsigned gpio) | 47 | static inline int gpio_direction_output(unsigned gpio, int value) |
50 | { | 48 | { |
51 | s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT); | 49 | s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT); |
50 | /* REVISIT can we write the value first, to avoid glitching? */ | ||
51 | s3c2410_gpio_setpin(gpio, value); | ||
52 | return 0; | 52 | return 0; |
53 | } | 53 | } |
54 | 54 | ||
@@ -57,8 +57,11 @@ static inline int gpio_direction_output(unsigned gpio) | |||
57 | 57 | ||
58 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 58 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |
59 | 59 | ||
60 | /* FIXME or maybe s3c2400_gpio_getirq() ... */ | 60 | #ifdef CONFIG_CPU_S3C2400 |
61 | #define gpio_to_irq(gpio) s3c2400_gpio_getirq(gpio) | ||
62 | #else | ||
61 | #define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio) | 63 | #define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio) |
64 | #endif | ||
62 | 65 | ||
63 | /* FIXME implement irq_to_gpio() */ | 66 | /* FIXME implement irq_to_gpio() */ |
64 | 67 | ||