Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2acde902301f73e824101e5ca9eb95dc733dc17d
Commit:     2acde902301f73e824101e5ca9eb95dc733dc17d
Parent:     55249e9e3d07617e00cc6c52b83f7d1a7eb7e64d
Author:     Michael Hennerich <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 11 00:24:40 2007 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 00:24:40 2007 +0800

    Blackfin arch: a few things still use bfin_read_PORT_FER()
    
     - Update gpio_request to allow multiple request with the same signature 
(label)
     - Use generic GPIO API where applicable
     - Update generic board support form stamp board
    
    Signed-off-by: Michael Hennerich <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/kernel/bfin_gpio.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 78438d8..b58b0de 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -930,6 +930,8 @@ void peripheral_free(unsigned short per)
 
        reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
 
+       set_label(ident, "free");
+
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(peripheral_free);
@@ -969,6 +971,17 @@ int gpio_request(unsigned short gpio, const char *label)
 
        local_irq_save(flags);
 
+       /*
+        * Allow that the identical GPIO can
+        * be requested from the same driver twice
+        * Do nothing and return -
+        */
+
+       if (cmp_label(gpio, label) == 0) {
+               local_irq_restore(flags);
+               return 0;
+       }
+
        if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
                printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s 
!\n",
                         gpio, get_label(gpio));
@@ -1016,6 +1029,8 @@ void gpio_free(unsigned short gpio)
 
        reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
 
+       set_label(gpio, "free");
+
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(gpio_free);
-
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