From cefe658bca9cf1d4af841c45d170ebd0f881889e Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Mon, 2 Jul 2007 11:45:50 +0800 Subject: Blackfin arch: add BF54x missing GPIO access functions Signed-off-by: Michael Hennerich Signed-off-by: Bryan Wu --- arch/blackfin/mach-bf548/gpio.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/blackfin') 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) { if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 \ || gpio == GPIO_PH14 || gpio == GPIO_PH15 \ + || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 \ || gpio > MAX_BLACKFIN_GPIOS) return -EINVAL; return 0; @@ -173,3 +174,19 @@ void gpio_direction_output(unsigned short gpio) local_irq_restore(flags); } EXPORT_SYMBOL(gpio_direction_output); + +void gpio_set_value(unsigned short gpio, unsigned short arg) +{ + if (arg) + gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio); + else + gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio); + +} +EXPORT_SYMBOL(gpio_set_value); + +unsigned short gpio_get_value(unsigned short gpio) +{ + return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio))); +} +EXPORT_SYMBOL(gpio_get_value); -- cgit v1.2.3