aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/irq.c
diff options
context:
space:
mode:
authorMaxime Bizon <mbizon@freebox.fr>2012-07-13 03:46:05 -0400
committerJohn Crispin <blogic@openwrt.org>2012-08-24 14:09:01 -0400
commit58e380afb67aeeb0416f3ea25f0d8007b03cb513 (patch)
treeb2b2686a9ca9f26d5831eedd867d135d850b6e8c /arch/mips/bcm63xx/irq.c
parent6d591805917cbc691e34cb3f8a10fef5997889bf (diff)
MIPS: BCM63XX: use a switch for external irq config
Makes the code a bit more readable and easier to add support for new chips. Signed-off-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Patchwork: http://patchwork.linux-mips.org/patch/4093/ Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/bcm63xx/irq.c')
-rw-r--r--arch/mips/bcm63xx/irq.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index d40169f83259..da24c2bd9b7c 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -438,7 +438,8 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
438 reg = bcm_perf_readl(regaddr); 438 reg = bcm_perf_readl(regaddr);
439 irq %= 4; 439 irq %= 4;
440 440
441 if (BCMCPU_IS_6348()) { 441 switch (bcm63xx_get_cpu_id()) {
442 case BCM6348_CPU_ID:
442 if (levelsense) 443 if (levelsense)
443 reg |= EXTIRQ_CFG_LEVELSENSE_6348(irq); 444 reg |= EXTIRQ_CFG_LEVELSENSE_6348(irq);
444 else 445 else
@@ -451,9 +452,13 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
451 reg |= EXTIRQ_CFG_BOTHEDGE_6348(irq); 452 reg |= EXTIRQ_CFG_BOTHEDGE_6348(irq);
452 else 453 else
453 reg &= ~EXTIRQ_CFG_BOTHEDGE_6348(irq); 454 reg &= ~EXTIRQ_CFG_BOTHEDGE_6348(irq);
454 } 455 break;
455 456
456 if (BCMCPU_IS_6338() || BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 457 case BCM6328_CPU_ID:
458 case BCM6338_CPU_ID:
459 case BCM6345_CPU_ID:
460 case BCM6358_CPU_ID:
461 case BCM6368_CPU_ID:
457 if (levelsense) 462 if (levelsense)
458 reg |= EXTIRQ_CFG_LEVELSENSE(irq); 463 reg |= EXTIRQ_CFG_LEVELSENSE(irq);
459 else 464 else
@@ -466,6 +471,9 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
466 reg |= EXTIRQ_CFG_BOTHEDGE(irq); 471 reg |= EXTIRQ_CFG_BOTHEDGE(irq);
467 else 472 else
468 reg &= ~EXTIRQ_CFG_BOTHEDGE(irq); 473 reg &= ~EXTIRQ_CFG_BOTHEDGE(irq);
474 break;
475 default:
476 BUG();
469 } 477 }
470 478
471 bcm_perf_writel(reg, regaddr); 479 bcm_perf_writel(reg, regaddr);