aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2008-11-18 04:48:22 -0500
committerBryan Wu <cooloney@kernel.org>2008-11-18 04:48:22 -0500
commit8eb3e3bfd5544c4549a52e3cfc3df2be0b224dbd (patch)
treee84d647b8d29fe6cf9fdc22e6ab1fe877164067a /arch
parent30af6d490427b49af5beca5824e22b00e468c951 (diff)
Blackfin arch: Request the gpio resource when making it as an irq pin, avoiding override it.
Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c4
-rw-r--r--arch/blackfin/mach-common/ints-priority.c15
2 files changed, 16 insertions, 3 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index f8d666e6741b..de235b8f37a8 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -1257,10 +1257,10 @@ static int gpio_proc_read(char *buf, char **start, off_t offset,
1257 1257
1258 for (c = 0; c < MAX_RESOURCES; c++) { 1258 for (c = 0; c < MAX_RESOURCES; c++) {
1259 if (!check_gpio(c) && (reserved_gpio_map[gpio_bank(c)] & gpio_bit(c))) 1259 if (!check_gpio(c) && (reserved_gpio_map[gpio_bank(c)] & gpio_bit(c)))
1260 len = sprintf(buf, "GPIO_%d: %s \t\tGPIO %s\n", c, 1260 len = sprintf(buf, "GPIO_%d: \t%s \t\tGPIO %s\n", c,
1261 get_label(c), get_gpio_dir(c) ? "OUTPUT" : "INPUT"); 1261 get_label(c), get_gpio_dir(c) ? "OUTPUT" : "INPUT");
1262 else if (reserved_peri_map[gpio_bank(c)] & gpio_bit(c)) 1262 else if (reserved_peri_map[gpio_bank(c)] & gpio_bit(c))
1263 len = sprintf(buf, "GPIO_%d: %s \t\tPeripheral\n", c, get_label(c)); 1263 len = sprintf(buf, "GPIO_%d: \t%s \t\tPeripheral\n", c, get_label(c));
1264 else 1264 else
1265 continue; 1265 continue;
1266 buf += len; 1266 buf += len;
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index efa27cb1b721..a0bfca921712 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -437,8 +437,15 @@ static void bfin_gpio_irq_shutdown(unsigned int irq)
437 437
438static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) 438static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
439{ 439{
440 int ret;
441 char buf[16];
440 u32 gpionr = irq_to_gpio(irq); 442 u32 gpionr = irq_to_gpio(irq);
441 443
444 snprintf(buf, 16, "gpio-irq%d", irq);
445 ret = bfin_gpio_request(gpionr, buf);
446 if (ret)
447 return ret;
448
442 if (type == IRQ_TYPE_PROBE) { 449 if (type == IRQ_TYPE_PROBE) {
443 /* only probe unenabled GPIO interrupt lines */ 450 /* only probe unenabled GPIO interrupt lines */
444 if (__test_bit(gpionr, gpio_enabled)) 451 if (__test_bit(gpionr, gpio_enabled))
@@ -738,7 +745,8 @@ static void bfin_gpio_irq_shutdown(unsigned int irq)
738 745
739static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) 746static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
740{ 747{
741 748 int ret;
749 char buf[16];
742 u32 gpionr = irq_to_gpio(irq); 750 u32 gpionr = irq_to_gpio(irq);
743 u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; 751 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
744 u32 pintbit = PINT_BIT(pint_val); 752 u32 pintbit = PINT_BIT(pint_val);
@@ -747,6 +755,11 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
747 if (pint_val == IRQ_NOT_AVAIL) 755 if (pint_val == IRQ_NOT_AVAIL)
748 return -ENODEV; 756 return -ENODEV;
749 757
758 snprintf(buf, 16, "gpio-irq%d", irq);
759 ret = bfin_gpio_request(gpionr, buf);
760 if (ret)
761 return ret;
762
750 if (type == IRQ_TYPE_PROBE) { 763 if (type == IRQ_TYPE_PROBE) {
751 /* only probe unenabled GPIO interrupt lines */ 764 /* only probe unenabled GPIO interrupt lines */
752 if (__test_bit(gpionr, gpio_enabled)) 765 if (__test_bit(gpionr, gpio_enabled))