aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-sa1100/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-sa1100/gpio.h')
-rw-r--r--include/asm-arm/arch-sa1100/gpio.h34
1 files changed, 14 insertions, 20 deletions
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h
index a331fe3f6e48..da7575b0e5d0 100644
--- a/include/asm-arm/arch-sa1100/gpio.h
+++ b/include/asm-arm/arch-sa1100/gpio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h 2 * linux/include/asm-arm/arch-sa1100/gpio.h
3 * 3 *
4 * SA1100 GPIO wrappers for arch-neutral GPIO calls 4 * SA1100 GPIO wrappers for arch-neutral GPIO calls
5 * 5 *
@@ -24,11 +24,8 @@
24#ifndef __ASM_ARCH_SA1100_GPIO_H 24#ifndef __ASM_ARCH_SA1100_GPIO_H
25#define __ASM_ARCH_SA1100_GPIO_H 25#define __ASM_ARCH_SA1100_GPIO_H
26 26
27#include <asm/arch/SA-1100.h> 27#include <asm/hardware.h>
28#include <asm/arch/irqs.h> 28#include <asm/irq.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32 29
33static inline int gpio_request(unsigned gpio, const char *label) 30static inline int gpio_request(unsigned gpio, const char *label)
34{ 31{
@@ -40,26 +37,23 @@ static inline void gpio_free(unsigned gpio)
40 return; 37 return;
41} 38}
42 39
43static inline int gpio_direction_input(unsigned gpio) 40extern int gpio_direction_input(unsigned gpio);
41extern int gpio_direction_output(unsigned gpio);
42
43
44static inline int gpio_get_value(unsigned gpio)
44{ 45{
45 if (gpio > GPIO_MAX) 46 return GPLR & GPIO_GPIO(gpio);
46 return -EINVAL;
47 GPDR = (GPDR_In << gpio) 0
48} 47}
49 48
50static inline int gpio_direction_output(unsigned gpio) 49static inline void gpio_set_value(unsigned gpio, int value)
51{ 50{
52 if (gpio > GPIO_MAX) 51 if (value)
53 return -EINVAL; 52 GPSR = GPIO_GPIO(gpio);
54 GPDR = (GPDR_Out << gpio) 0 53 else
54 GPCR = GPIO_GPIO(gpio);
55} 55}
56 56
57#define gpio_get_value(gpio) \
58 (GPLR & GPIO_GPIO(gpio))
59
60#define gpio_set_value(gpio,value) \
61 ((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio)))
62
63#include <asm-generic/gpio.h> /* cansleep wrappers */ 57#include <asm-generic/gpio.h> /* cansleep wrappers */
64 58
65static inline unsigned gpio_to_irq(unsigned gpio) 59static inline unsigned gpio_to_irq(unsigned gpio)