aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2007-07-01 23:45:50 -0400
committerBryan Wu <bryan.wu@analog.com>2007-07-01 23:45:50 -0400
commitcefe658bca9cf1d4af841c45d170ebd0f881889e (patch)
treebddd2bc1f4467ca550d386fdc888baf78be64fcf /arch/blackfin
parente3f2300036b5e0f60cb64063a9686361b6be8555 (diff)
Blackfin arch: add BF54x missing GPIO access functions
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-bf548/gpio.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf548/gpio.c b/arch/blackfin/mach-bf548/gpio.c
index fac7cf3d6791..9b1a00aabf28 100644
--- a/arch/blackfin/mach-bf548/gpio.c
+++ b/arch/blackfin/mach-bf548/gpio.c
@@ -52,6 +52,7 @@ inline int check_gpio(unsigned short gpio)
52{ 52{
53 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 \ 53 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 \
54 || gpio == GPIO_PH14 || gpio == GPIO_PH15 \ 54 || gpio == GPIO_PH14 || gpio == GPIO_PH15 \
55 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 \
55 || gpio > MAX_BLACKFIN_GPIOS) 56 || gpio > MAX_BLACKFIN_GPIOS)
56 return -EINVAL; 57 return -EINVAL;
57 return 0; 58 return 0;
@@ -173,3 +174,19 @@ void gpio_direction_output(unsigned short gpio)
173 local_irq_restore(flags); 174 local_irq_restore(flags);
174} 175}
175EXPORT_SYMBOL(gpio_direction_output); 176EXPORT_SYMBOL(gpio_direction_output);
177
178void gpio_set_value(unsigned short gpio, unsigned short arg)
179{
180 if (arg)
181 gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio);
182 else
183 gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio);
184
185}
186EXPORT_SYMBOL(gpio_set_value);
187
188unsigned short gpio_get_value(unsigned short gpio)
189{
190 return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio)));
191}
192EXPORT_SYMBOL(gpio_get_value);