Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cefe658bca9cf1d4af841c45d170ebd0f881889e
Commit:     cefe658bca9cf1d4af841c45d170ebd0f881889e
Parent:     e3f2300036b5e0f60cb64063a9686361b6be8555
Author:     Michael Hennerich <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 2 11:45:50 2007 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Mon Jul 2 11:45:50 2007 +0800

    Blackfin arch: add BF54x missing GPIO access functions
    
    Signed-off-by: Michael Hennerich <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/mach-bf548/gpio.c        |   17 +++++++++++++++++
 include/asm-blackfin/gpio.h            |    4 +++-
 include/asm-blackfin/mach-bf548/gpio.h |    4 ++--
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/arch/blackfin/mach-bf548/gpio.c b/arch/blackfin/mach-bf548/gpio.c
index fac7cf3..9b1a00a 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);
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h
index bc0cca0..e679703 100644
--- a/include/asm-blackfin/gpio.h
+++ b/include/asm-blackfin/gpio.h
@@ -234,6 +234,7 @@
 * MODIFICATION HISTORY :
 **************************************************************/
 
+#ifndef BF548_FAMILY
 void set_gpio_dir(unsigned short, unsigned short);
 void set_gpio_inen(unsigned short, unsigned short);
 void set_gpio_polar(unsigned short, unsigned short);
@@ -268,7 +269,6 @@ unsigned short get_gpiop_maska(unsigned short);
 unsigned short get_gpiop_maskb(unsigned short);
 unsigned short get_gpiop_data(unsigned short);
 
-#ifndef BF548_FAMILY
 struct gpio_port_t {
        unsigned short data;
        unsigned short dummy1;
@@ -363,8 +363,10 @@ void gpio_free(unsigned short);
 void gpio_set_value(unsigned short gpio, unsigned short arg);
 unsigned short gpio_get_value(unsigned short gpio);
 
+#ifndef BF548_FAMILY
 #define gpio_get_value(gpio)           get_gpio_data(gpio)
 #define gpio_set_value(gpio, value)    set_gpio_data(gpio, value)
+#endif
 
 void gpio_direction_input(unsigned short gpio);
 void gpio_direction_output(unsigned short gpio);
diff --git a/include/asm-blackfin/mach-bf548/gpio.h 
b/include/asm-blackfin/mach-bf548/gpio.h
index 4528942..8c5847a 100644
--- a/include/asm-blackfin/mach-bf548/gpio.h
+++ b/include/asm-blackfin/mach-bf548/gpio.h
@@ -187,8 +187,8 @@
 #define GPIO_PJ11      155
 #define GPIO_PJ12      156
 #define GPIO_PJ13      157
-#define GPIO_PJ14      158
-#define GPIO_PJ15      159
+#define GPIO_PJ14      158     /* N/A */
+#define GPIO_PJ15      159     /* N/A */
 
 #define MAX_BLACKFIN_GPIOS 160
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to