diff options
Diffstat (limited to 'arch/arm/mach-pxa/gpio.c')
-rw-r--r-- | arch/arm/mach-pxa/gpio.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/arch/arm/mach-pxa/gpio.c b/arch/arm/mach-pxa/gpio.c index 198246019028..c9d9c702c7d5 100644 --- a/arch/arm/mach-pxa/gpio.c +++ b/arch/arm/mach-pxa/gpio.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <asm/gpio.h> | 21 | #include <asm/gpio.h> |
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/pxa-regs.h> | 23 | #include <mach/pxa-regs.h> |
24 | #include <mach/pxa2xx-gpio.h> | ||
25 | 24 | ||
26 | #include "generic.h" | 25 | #include "generic.h" |
27 | 26 | ||
@@ -45,36 +44,6 @@ struct pxa_gpio_chip { | |||
45 | 44 | ||
46 | int pxa_last_gpio; | 45 | int pxa_last_gpio; |
47 | 46 | ||
48 | /* | ||
49 | * Configure pins for GPIO or other functions | ||
50 | */ | ||
51 | int pxa_gpio_mode(int gpio_mode) | ||
52 | { | ||
53 | unsigned long flags; | ||
54 | int gpio = gpio_mode & GPIO_MD_MASK_NR; | ||
55 | int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8; | ||
56 | int gafr; | ||
57 | |||
58 | if (gpio > pxa_last_gpio) | ||
59 | return -EINVAL; | ||
60 | |||
61 | local_irq_save(flags); | ||
62 | if (gpio_mode & GPIO_DFLT_LOW) | ||
63 | GPCR(gpio) = GPIO_bit(gpio); | ||
64 | else if (gpio_mode & GPIO_DFLT_HIGH) | ||
65 | GPSR(gpio) = GPIO_bit(gpio); | ||
66 | if (gpio_mode & GPIO_MD_MASK_DIR) | ||
67 | GPDR(gpio) |= GPIO_bit(gpio); | ||
68 | else | ||
69 | GPDR(gpio) &= ~GPIO_bit(gpio); | ||
70 | gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2)); | ||
71 | GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2)); | ||
72 | local_irq_restore(flags); | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | EXPORT_SYMBOL(pxa_gpio_mode); | ||
77 | |||
78 | static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 47 | static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
79 | { | 48 | { |
80 | unsigned long flags; | 49 | unsigned long flags; |