diff options
| author | Michael Hennerich <michael.hennerich@analog.com> | 2008-02-02 03:17:52 -0500 |
|---|---|---|
| committer | Bryan Wu <bryan.wu@analog.com> | 2008-02-02 03:17:52 -0500 |
| commit | f1bceb47b3f385d765acac7fe582cb11034dd759 (patch) | |
| tree | 90f5cb1400acd3913830e98dc04ed96191384eb9 | |
| parent | a8c12385c203ca7fa1cd5af25f910c41f6e4a2b5 (diff) | |
[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 <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
| -rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 6 | ||||
| -rw-r--r-- | 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 0185350feacc..41ec72f8a08c 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 = { | |||
| 423 | #include <linux/gpio_keys.h> | 423 | #include <linux/gpio_keys.h> |
| 424 | 424 | ||
| 425 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | 425 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 426 | {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"}, | 426 | {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"}, |
| 427 | {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"}, | 427 | {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"}, |
| 428 | {BTN_2, GPIO_PF8, 1, "gpio-keys: BTN2"}, | 428 | {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"}, |
| 429 | }; | 429 | }; |
| 430 | 430 | ||
| 431 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | 431 | 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 81d00183ae91..880595afe98d 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) | |||
| 430 | return 0; | 430 | return 0; |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | set_gpio_inen(gpionr, 0); | ||
| 433 | set_gpio_dir(gpionr, 0); | 434 | set_gpio_dir(gpionr, 0); |
| 434 | set_gpio_inen(gpionr, 1); | ||
| 435 | |||
| 436 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { | ||
| 437 | gpio_edge_triggered[gpio_bank(gpionr)] |= gpio_bit(gpionr); | ||
| 438 | set_gpio_edge(gpionr, 1); | ||
| 439 | } else { | ||
| 440 | set_gpio_edge(gpionr, 0); | ||
| 441 | gpio_edge_triggered[gpio_bank(gpionr)] &= ~gpio_bit(gpionr); | ||
| 442 | } | ||
| 443 | 435 | ||
| 444 | if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) | 436 | if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) |
| 445 | == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) | 437 | == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) |
| @@ -452,6 +444,18 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) | |||
| 452 | else | 444 | else |
| 453 | set_gpio_polar(gpionr, 0); /* high or rising edge denoted by zero */ | 445 | set_gpio_polar(gpionr, 0); /* high or rising edge denoted by zero */ |
| 454 | 446 | ||
| 447 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { | ||
| 448 | set_gpio_edge(gpionr, 1); | ||
| 449 | set_gpio_inen(gpionr, 1); | ||
| 450 | gpio_edge_triggered[gpio_bank(gpionr)] |= gpio_bit(gpionr); | ||
| 451 | set_gpio_data(gpionr, 0); | ||
| 452 | |||
| 453 | } else { | ||
| 454 | set_gpio_edge(gpionr, 0); | ||
| 455 | gpio_edge_triggered[gpio_bank(gpionr)] &= ~gpio_bit(gpionr); | ||
| 456 | set_gpio_inen(gpionr, 1); | ||
| 457 | } | ||
| 458 | |||
| 455 | SSYNC(); | 459 | SSYNC(); |
| 456 | 460 | ||
| 457 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) | 461 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) |
