Commit 742759ea authored by Paul Mundt's avatar Paul Mundt

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: default avatarPaul Mundt <lethal@linux-sh.org>
parent 720a6bd7
...@@ -466,6 +466,7 @@ config CPU_SUBTYPE_SHX3 ...@@ -466,6 +466,7 @@ config CPU_SUBTYPE_SHX3
select CPU_SH4A select CPU_SH4A
select CPU_SHX3 select CPU_SHX3
select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select ARCH_REQUIRE_GPIOLIB
# SH4AL-DSP Processor Support # SH4AL-DSP Processor Support
......
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/gpio.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <cpu/shx3.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
/* /*
...@@ -440,11 +442,33 @@ static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups, ...@@ -440,11 +442,33 @@ static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups,
void __init plat_irq_setup_pins(int mode) void __init plat_irq_setup_pins(int mode)
{ {
int ret = 0;
switch (mode) { switch (mode) {
case IRQ_MODE_IRQ: case IRQ_MODE_IRQ:
ret |= gpio_request(GPIO_FN_IRQ3, intc_desc_irq.name);
ret |= gpio_request(GPIO_FN_IRQ2, intc_desc_irq.name);
ret |= gpio_request(GPIO_FN_IRQ1, intc_desc_irq.name);
ret |= gpio_request(GPIO_FN_IRQ0, intc_desc_irq.name);
if (unlikely(ret)) {
pr_err("Failed to set IRQ mode\n");
return;
}
register_intc_controller(&intc_desc_irq); register_intc_controller(&intc_desc_irq);
break; break;
case IRQ_MODE_IRL3210: case IRQ_MODE_IRL3210:
ret |= gpio_request(GPIO_FN_IRL3, intc_desc_irl.name);
ret |= gpio_request(GPIO_FN_IRL2, intc_desc_irl.name);
ret |= gpio_request(GPIO_FN_IRL1, intc_desc_irl.name);
ret |= gpio_request(GPIO_FN_IRL0, intc_desc_irl.name);
if (unlikely(ret)) {
pr_err("Failed to set IRL mode\n");
return;
}
register_intc_controller(&intc_desc_irl); register_intc_controller(&intc_desc_irl);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment