Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f1bceb47b3f385d765acac7fe582cb11034dd759
Commit:     f1bceb47b3f385d765acac7fe582cb11034dd759
Parent:     a8c12385c203ca7fa1cd5af25f910c41f6e4a2b5
Author:     Michael Hennerich <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 2 16:17:52 2008 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Sat Feb 2 16:17:52 2008 +0800

    [Blackfin] arch:Fix BUG [#3876] pfbutton test for BTN3 on bf533 don't show 
complete info
    
     - Buttons on the BF533-STAMP board are not inverted
     - Fix spurious GPIO Interrupt caused during set irq_type for edge 
triggered interrupts
    
    Signed-off-by: Michael Hennerich <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/mach-bf533/boards/stamp.c   |    6 +++---
 arch/blackfin/mach-common/ints-priority.c |   22 +++++++++++++---------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/blackfin/mach-bf533/boards/stamp.c 
b/arch/blackfin/mach-bf533/boards/stamp.c
index 0185350..41ec72f 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -423,9 +423,9 @@ static struct platform_device bfin_pata_device = {
 #include <linux/gpio_keys.h>
 
 static struct gpio_keys_button bfin_gpio_keys_table[] = {
-       {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"},
-       {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"},
-       {BTN_2, GPIO_PF8, 1, "gpio-keys: BTN2"},
+       {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"},
+       {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"},
+       {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"},
 };
 
 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
diff --git a/arch/blackfin/mach-common/ints-priority.c 
b/arch/blackfin/mach-common/ints-priority.c
index 81d0018..880595a 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -430,16 +430,8 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned 
int type)
                return 0;
        }
 
+       set_gpio_inen(gpionr, 0);
        set_gpio_dir(gpionr, 0);
-       set_gpio_inen(gpionr, 1);
-
-       if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
-               gpio_edge_triggered[gpio_bank(gpionr)] |= gpio_bit(gpionr);
-               set_gpio_edge(gpionr, 1);
-       } else {
-               set_gpio_edge(gpionr, 0);
-               gpio_edge_triggered[gpio_bank(gpionr)] &= ~gpio_bit(gpionr);
-       }
 
        if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
            == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
@@ -452,6 +444,18 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned 
int type)
        else
                set_gpio_polar(gpionr, 0);      /* high or rising edge denoted 
by zero */
 
+       if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
+               set_gpio_edge(gpionr, 1);
+               set_gpio_inen(gpionr, 1);
+               gpio_edge_triggered[gpio_bank(gpionr)] |= gpio_bit(gpionr);
+               set_gpio_data(gpionr, 0);
+
+       } else {
+               set_gpio_edge(gpionr, 0);
+               gpio_edge_triggered[gpio_bank(gpionr)] &= ~gpio_bit(gpionr);
+               set_gpio_inen(gpionr, 1);
+       }
+
        SSYNC();
 
        if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
-
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