diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-10-02 06:43:40 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-10-02 06:43:40 -0400 |
commit | 742759eae6b58a172d8f79ff0938d1e25dc9abc5 (patch) | |
tree | 455f25ce9eb3a15ba4d35b7f45140d5506a81b45 /arch/sh/kernel/cpu | |
parent | 720a6bd785f92782921a1d0f00f15d60997f4037 (diff) |
sh: Handle pinmux for SH-X3 proto IRQ/IRL modes.
The SH-X3 proto CPU has all of the external IRQ and IRL pins muxed, make
sure that we're able to grab them before attempting to register their
respective IRQ controllers.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-shx3.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index 04a487445aa6..f159ea2cebc7 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c | |||
@@ -12,7 +12,9 @@ | |||
12 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
13 | #include <linux/serial_sci.h> | 13 | #include <linux/serial_sci.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/gpio.h> | ||
15 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
17 | #include <cpu/shx3.h> | ||
16 | #include <asm/mmzone.h> | 18 | #include <asm/mmzone.h> |
17 | 19 | ||
18 | /* | 20 | /* |
@@ -440,11 +442,33 @@ static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups, | |||
440 | 442 | ||
441 | void __init plat_irq_setup_pins(int mode) | 443 | void __init plat_irq_setup_pins(int mode) |
442 | { | 444 | { |
445 | int ret = 0; | ||
446 | |||
443 | switch (mode) { | 447 | switch (mode) { |
444 | case IRQ_MODE_IRQ: | 448 | case IRQ_MODE_IRQ: |
449 | ret |= gpio_request(GPIO_FN_IRQ3, intc_desc_irq.name); | ||
450 | ret |= gpio_request(GPIO_FN_IRQ2, intc_desc_irq.name); | ||
451 | ret |= gpio_request(GPIO_FN_IRQ1, intc_desc_irq.name); | ||
452 | ret |= gpio_request(GPIO_FN_IRQ0, intc_desc_irq.name); | ||
453 | |||
454 | if (unlikely(ret)) { | ||
455 | pr_err("Failed to set IRQ mode\n"); | ||
456 | return; | ||
457 | } | ||
458 | |||
445 | register_intc_controller(&intc_desc_irq); | 459 | register_intc_controller(&intc_desc_irq); |
446 | break; | 460 | break; |
447 | case IRQ_MODE_IRL3210: | 461 | case IRQ_MODE_IRL3210: |
462 | ret |= gpio_request(GPIO_FN_IRL3, intc_desc_irl.name); | ||
463 | ret |= gpio_request(GPIO_FN_IRL2, intc_desc_irl.name); | ||
464 | ret |= gpio_request(GPIO_FN_IRL1, intc_desc_irl.name); | ||
465 | ret |= gpio_request(GPIO_FN_IRL0, intc_desc_irl.name); | ||
466 | |||
467 | if (unlikely(ret)) { | ||
468 | pr_err("Failed to set IRL mode\n"); | ||
469 | return; | ||
470 | } | ||
471 | |||
448 | register_intc_controller(&intc_desc_irl); | 472 | register_intc_controller(&intc_desc_irl); |
449 | break; | 473 | break; |
450 | default: | 474 | default: |