diff options
author | Graf Yang <graf.yang@analog.com> | 2008-11-18 17:48:22 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-11-18 17:48:22 +0800 |
commit | 8eb3e3bfd5544c4549a52e3cfc3df2be0b224dbd (patch) | |
tree | e84d647b8d29fe6cf9fdc22e6ab1fe877164067a /arch/blackfin/mach-common/ints-priority.c | |
parent | 30af6d490427b49af5beca5824e22b00e468c951 (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/blackfin/mach-common/ints-priority.c')
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index efa27cb1b72..a0bfca92171 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) static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) { + int ret; + char buf[16]; u32 gpionr = irq_to_gpio(irq); + snprintf(buf, 16, "gpio-irq%d", irq); + ret = bfin_gpio_request(gpionr, buf); + if (ret) + return ret; + if (type == IRQ_TYPE_PROBE) { /* only probe unenabled GPIO interrupt lines */ if (__test_bit(gpionr, gpio_enabled)) @@ -738,7 +745,8 @@ static void bfin_gpio_irq_shutdown(unsigned int irq) static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) { - + int ret; + char buf[16]; u32 gpionr = irq_to_gpio(irq); u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; u32 pintbit = PINT_BIT(pint_val); @@ -747,6 +755,11 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) if (pint_val == IRQ_NOT_AVAIL) return -ENODEV; + snprintf(buf, 16, "gpio-irq%d", irq); + ret = bfin_gpio_request(gpionr, buf); + if (ret) + return ret; + if (type == IRQ_TYPE_PROBE) { /* only probe unenabled GPIO interrupt lines */ if (__test_bit(gpionr, gpio_enabled)) |