aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2016-06-24 16:26:33 +0200
committerZoltan HERPAI <wigyori@uid0.hu>2016-06-24 16:26:33 +0200
commit9f716901fa38d73b0848da568da4bcd75b0d6782 (patch)
tree21bb2a046c7716ea664fdcd1ec668b1c0331981e /target/linux
parentbb7bcc20eb92325c316ab6d4739385cb77851686 (diff)
downloadmaster-187ad058-9f716901fa38d73b0848da568da4bcd75b0d6782.tar.gz
master-187ad058-9f716901fa38d73b0848da568da4bcd75b0d6782.tar.bz2
master-187ad058-9f716901fa38d73b0848da568da4bcd75b0d6782.zip
lantiq: fix a regression in the eiu irq loading code
this worked in 3.18 but broke at some point. the old code that loaded a irq table was incorrewct anyhow as it mapped the irqs int he domain which should really be done when the driver using them loads them and not the irq driver itself. Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/lantiq/patches-4.4/0047-irq-fixes.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-4.4/0047-irq-fixes.patch b/target/linux/lantiq/patches-4.4/0047-irq-fixes.patch
new file mode 100644
index 0000000000..f11e057a80
--- /dev/null
+++ b/target/linux/lantiq/patches-4.4/0047-irq-fixes.patch
@@ -0,0 +1,78 @@
+--- a/arch/mips/lantiq/irq.c
++++ b/arch/mips/lantiq/irq.c
+@@ -67,7 +67,7 @@
+ #endif
+
+ static int exin_avail;
+-static struct resource ltq_eiu_irq[MAX_EIU];
++static u32 ltq_eiu_irq[MAX_EIU];
+ static void __iomem *ltq_icu_membase[MAX_IM];
+ static void __iomem *ltq_eiu_membase;
+ static struct irq_domain *ltq_domain;
+@@ -76,7 +76,7 @@
+ int ltq_eiu_get_irq(int exin)
+ {
+ if (exin < exin_avail)
+- return ltq_eiu_irq[exin].start;
++ return ltq_eiu_irq[exin];
+ return -1;
+ }
+
+@@ -128,7 +128,7 @@
+ int i;
+
+ for (i = 0; i < MAX_EIU; i++) {
+- if (d->hwirq == ltq_eiu_irq[i].start) {
++ if (d->hwirq == ltq_eiu_irq[i]) {
+ int val = 0;
+ int edge = 0;
+
+@@ -176,7 +176,7 @@
+
+ ltq_enable_irq(d);
+ for (i = 0; i < MAX_EIU; i++) {
+- if (d->hwirq == ltq_eiu_irq[i].start) {
++ if (d->hwirq == ltq_eiu_irq[i]) {
+ /* by default we are low level triggered */
+ ltq_eiu_settype(d, IRQF_TRIGGER_LOW);
+ /* clear all pending */
+@@ -198,7 +198,7 @@
+
+ ltq_disable_irq(d);
+ for (i = 0; i < MAX_EIU; i++) {
+- if (d->hwirq == ltq_eiu_irq[i].start) {
++ if (d->hwirq == ltq_eiu_irq[i]) {
+ /* disable */
+ ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i),
+ LTQ_EIU_EXIN_INEN);
+@@ -343,10 +343,10 @@
+ return 0;
+
+ for (i = 0; i < exin_avail; i++)
+- if (hw == ltq_eiu_irq[i].start)
++ if (hw == ltq_eiu_irq[i])
+ chip = &ltq_eiu_type;
+
+- irq_set_chip_and_handler(hw, chip, handle_level_irq);
++ irq_set_chip_and_handler(irq, chip, handle_level_irq);
+
+ return 0;
+ }
+@@ -441,14 +441,14 @@
+ eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
+ if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
+ /* find out how many external irq sources we have */
+- exin_avail = of_irq_count(eiu_node);
++ exin_avail = of_property_count_u32_elems(eiu_node, "lantiq,eiu-irqs");
+
+ if (exin_avail > MAX_EIU)
+ exin_avail = MAX_EIU;
+
+- ret = of_irq_to_resource_table(eiu_node,
++ ret = of_property_read_u32_array(eiu_node, "lantiq,eiu-irqs",
+ ltq_eiu_irq, exin_avail);
+- if (ret != exin_avail)
++ if (ret)
+ panic("failed to load external irq resources");
+
+ if (!request_mem_region(res.start, resource_size(&res),