aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/cavium-octeon/octeon-irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/cavium-octeon/octeon-irq.c')
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 25fbfae06c1f..c2bb4f896ce7 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -975,10 +975,6 @@ static int octeon_irq_ciu_xlat(struct irq_domain *d,
975 if (ciu > 1 || bit > 63) 975 if (ciu > 1 || bit > 63)
976 return -EINVAL; 976 return -EINVAL;
977 977
978 /* These are the GPIO lines */
979 if (ciu == 0 && bit >= 16 && bit < 32)
980 return -EINVAL;
981
982 *out_hwirq = (ciu << 6) | bit; 978 *out_hwirq = (ciu << 6) | bit;
983 *out_type = 0; 979 *out_type = 0;
984 980
@@ -1007,6 +1003,10 @@ static int octeon_irq_ciu_map(struct irq_domain *d,
1007 if (!octeon_irq_virq_in_range(virq)) 1003 if (!octeon_irq_virq_in_range(virq))
1008 return -EINVAL; 1004 return -EINVAL;
1009 1005
1006 /* Don't map irq if it is reserved for GPIO. */
1007 if (line == 0 && bit >= 16 && bit <32)
1008 return 0;
1009
1010 if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0) 1010 if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0)
1011 return -EINVAL; 1011 return -EINVAL;
1012 1012
@@ -1525,10 +1525,6 @@ static int octeon_irq_ciu2_xlat(struct irq_domain *d,
1525 ciu = intspec[0]; 1525 ciu = intspec[0];
1526 bit = intspec[1]; 1526 bit = intspec[1];
1527 1527
1528 /* Line 7 are the GPIO lines */
1529 if (ciu > 6 || bit > 63)
1530 return -EINVAL;
1531
1532 *out_hwirq = (ciu << 6) | bit; 1528 *out_hwirq = (ciu << 6) | bit;
1533 *out_type = 0; 1529 *out_type = 0;
1534 1530
@@ -1570,8 +1566,14 @@ static int octeon_irq_ciu2_map(struct irq_domain *d,
1570 if (!octeon_irq_virq_in_range(virq)) 1566 if (!octeon_irq_virq_in_range(virq))
1571 return -EINVAL; 1567 return -EINVAL;
1572 1568
1573 /* Line 7 are the GPIO lines */ 1569 /*
1574 if (line > 6 || octeon_irq_ciu_to_irq[line][bit] != 0) 1570 * Don't map irq if it is reserved for GPIO.
1571 * (Line 7 are the GPIO lines.)
1572 */
1573 if (line == 7)
1574 return 0;
1575
1576 if (line > 7 || octeon_irq_ciu_to_irq[line][bit] != 0)
1575 return -EINVAL; 1577 return -EINVAL;
1576 1578
1577 if (octeon_irq_ciu2_is_edge(line, bit)) 1579 if (octeon_irq_ciu2_is_edge(line, bit))