d44b3068e701debae22e3d2adc9ccd56da21faec
[openwrt/staging/mkresin.git] / target / linux / brcm47xx / patches-3.6 / 183-bcma-mips-show-also-disabled-irqs.patch
1 --- a/drivers/bcma/driver_mips.c
2 +++ b/drivers/bcma/driver_mips.c
3 @@ -75,11 +75,16 @@ static u32 bcma_core_mips_irqflag(struct
4 return dev->core_index;
5 flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30);
6
7 - return flag & 0x1F;
8 + if (flag)
9 + return flag & 0x1F;
10 + else
11 + return 0x3f;
12 }
13
14 /* Get the MIPS IRQ assignment for a specified device.
15 * If unassigned, 0 is returned.
16 + * If disabled, 5 is returned.
17 + * If not supported, 6 is returned.
18 */
19 unsigned int bcma_core_mips_irq(struct bcma_device *dev)
20 {
21 @@ -88,13 +93,15 @@ unsigned int bcma_core_mips_irq(struct b
22 unsigned int irq;
23
24 irqflag = bcma_core_mips_irqflag(dev);
25 + if (irqflag == 0x3f)
26 + return 6;
27
28 - for (irq = 1; irq <= 4; irq++)
29 + for (irq = 0; irq <= 4; irq++)
30 if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) &
31 (1 << irqflag))
32 return irq;
33
34 - return 0;
35 + return 5;
36 }
37 EXPORT_SYMBOL(bcma_core_mips_irq);
38
39 @@ -115,7 +122,7 @@ static void bcma_core_mips_set_irq(struc
40 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0),
41 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &
42 ~(1 << irqflag));
43 - else
44 + else if (oldirq != 5)
45 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0);
46
47 /* assign the new one */
48 @@ -145,7 +152,7 @@ static void bcma_core_mips_set_irq(struc
49 }
50
51 bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n",
52 - dev->id.id, oldirq + 2, irq + 2);
53 + dev->id.id, oldirq <= 4 ? oldirq + 2 : 0, irq + 2);
54 }
55
56 static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,