Skip to content

Commit

Permalink
mfd: db8500-prcmu: Fix irqdomain usage
Browse files Browse the repository at this point in the history
This fixes two issues with the DB8500 PRCMU irqdomain:
- You have to state the irq base 0 to get a linear domain
  for the DT case from irq_domain_add_simple()
- The irqdomain was not used to translate the initial irq
  request using irq_create_mapping() making the linear
  case fail as it was lacking a proper descriptor.

I took this opportunity to fix two lines of whitespace
errors in related code as I was anyway messing around with
it.

Cc: stable@kernel.org
Acked-by Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Linus Walleij authored and Samuel Ortiz committed Jan 22, 2013
1 parent ee48711 commit 89d9b1c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/mfd/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ static bool read_mailbox_0(void)

for (n = 0; n < NUM_PRCMU_WAKEUPS; n++) {
if (ev & prcmu_irq_bit[n])
generic_handle_irq(IRQ_PRCMU_BASE + n);
generic_handle_irq(irq_find_mapping(db8500_irq_domain, n));
}
r = true;
break;
Expand Down Expand Up @@ -2737,13 +2737,14 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
}

static struct irq_domain_ops db8500_irq_ops = {
.map = db8500_irq_map,
.xlate = irq_domain_xlate_twocell,
.map = db8500_irq_map,
.xlate = irq_domain_xlate_twocell,
};

static int db8500_irq_init(struct device_node *np)
{
int irq_base = -1;
int irq_base = 0;
int i;

/* In the device tree case, just take some IRQs */
if (!np)
Expand All @@ -2758,6 +2759,10 @@ static int db8500_irq_init(struct device_node *np)
return -ENOSYS;
}

/* All wakeups will be used, so create mappings for all */
for (i = 0; i < NUM_PRCMU_WAKEUPS; i++)
irq_create_mapping(db8500_irq_domain, i);

return 0;
}

Expand Down

0 comments on commit 89d9b1c

Please sign in to comment.