diff options
-rw-r--r-- | arch/arm/mach-orion/gpio.c | 19 | ||||
-rw-r--r-- | include/asm-arm/arch-orion/gpio.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-orion/gpio.c b/arch/arm/mach-orion/gpio.c index af8553ccd230..0418f5b1ebe7 100644 --- a/arch/arm/mach-orion/gpio.c +++ b/arch/arm/mach-orion/gpio.c | |||
@@ -76,6 +76,7 @@ int gpio_direction_output(unsigned pin, int value) | |||
76 | gpio_label[pin] = "?"; | 76 | gpio_label[pin] = "?"; |
77 | 77 | ||
78 | mask = 1 << pin; | 78 | mask = 1 << pin; |
79 | orion_clrbits(GPIO_BLINK_EN, mask); | ||
79 | if (value) | 80 | if (value) |
80 | orion_setbits(GPIO_OUT, mask); | 81 | orion_setbits(GPIO_OUT, mask); |
81 | else | 82 | else |
@@ -107,6 +108,7 @@ void gpio_set_value(unsigned pin, int value) | |||
107 | 108 | ||
108 | spin_lock_irqsave(&gpio_lock, flags); | 109 | spin_lock_irqsave(&gpio_lock, flags); |
109 | 110 | ||
111 | orion_clrbits(GPIO_BLINK_EN, mask); | ||
110 | if (value) | 112 | if (value) |
111 | orion_setbits(GPIO_OUT, mask); | 113 | orion_setbits(GPIO_OUT, mask); |
112 | else | 114 | else |
@@ -116,6 +118,23 @@ void gpio_set_value(unsigned pin, int value) | |||
116 | } | 118 | } |
117 | EXPORT_SYMBOL(gpio_set_value); | 119 | EXPORT_SYMBOL(gpio_set_value); |
118 | 120 | ||
121 | void orion_gpio_set_blink(unsigned pin, int blink) | ||
122 | { | ||
123 | unsigned long flags; | ||
124 | int mask = 1 << pin; | ||
125 | |||
126 | spin_lock_irqsave(&gpio_lock, flags); | ||
127 | |||
128 | orion_clrbits(GPIO_OUT, mask); | ||
129 | if (blink) | ||
130 | orion_setbits(GPIO_BLINK_EN, mask); | ||
131 | else | ||
132 | orion_clrbits(GPIO_BLINK_EN, mask); | ||
133 | |||
134 | spin_unlock_irqrestore(&gpio_lock, flags); | ||
135 | } | ||
136 | EXPORT_SYMBOL(orion_gpio_set_blink); | ||
137 | |||
119 | int gpio_request(unsigned pin, const char *label) | 138 | int gpio_request(unsigned pin, const char *label) |
120 | { | 139 | { |
121 | int ret = 0; | 140 | int ret = 0; |
diff --git a/include/asm-arm/arch-orion/gpio.h b/include/asm-arm/arch-orion/gpio.h index 6d5848ed9a39..d66284f9a14c 100644 --- a/include/asm-arm/arch-orion/gpio.h +++ b/include/asm-arm/arch-orion/gpio.h | |||
@@ -12,6 +12,7 @@ extern int gpio_direction_input(unsigned pin); | |||
12 | extern int gpio_direction_output(unsigned pin, int value); | 12 | extern int gpio_direction_output(unsigned pin, int value); |
13 | extern int gpio_get_value(unsigned pin); | 13 | extern int gpio_get_value(unsigned pin); |
14 | extern void gpio_set_value(unsigned pin, int value); | 14 | extern void gpio_set_value(unsigned pin, int value); |
15 | extern void orion_gpio_set_blink(unsigned pin, int blink); | ||
15 | extern void gpio_display(void); /* debug */ | 16 | extern void gpio_display(void); /* debug */ |
16 | 17 | ||
17 | static inline int gpio_to_irq(int pin) | 18 | static inline int gpio_to_irq(int pin) |