Commit 89d9b1c99374997d68910ba49d5b7df80e7f2061
Committed by
Samuel Ortiz
1 parent
ee487114f0
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mfd: db8500-prcmu: Fix irqdomain usage
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>
Showing 1 changed file with 9 additions and 4 deletions Side-by-side Diff
drivers/mfd/db8500-prcmu.c
... | ... | @@ -2524,7 +2524,7 @@ |
2524 | 2524 | |
2525 | 2525 | for (n = 0; n < NUM_PRCMU_WAKEUPS; n++) { |
2526 | 2526 | if (ev & prcmu_irq_bit[n]) |
2527 | - generic_handle_irq(IRQ_PRCMU_BASE + n); | |
2527 | + generic_handle_irq(irq_find_mapping(db8500_irq_domain, n)); | |
2528 | 2528 | } |
2529 | 2529 | r = true; |
2530 | 2530 | break; |
2531 | 2531 | |
... | ... | @@ -2737,13 +2737,14 @@ |
2737 | 2737 | } |
2738 | 2738 | |
2739 | 2739 | static struct irq_domain_ops db8500_irq_ops = { |
2740 | - .map = db8500_irq_map, | |
2741 | - .xlate = irq_domain_xlate_twocell, | |
2740 | + .map = db8500_irq_map, | |
2741 | + .xlate = irq_domain_xlate_twocell, | |
2742 | 2742 | }; |
2743 | 2743 | |
2744 | 2744 | static int db8500_irq_init(struct device_node *np) |
2745 | 2745 | { |
2746 | - int irq_base = -1; | |
2746 | + int irq_base = 0; | |
2747 | + int i; | |
2747 | 2748 | |
2748 | 2749 | /* In the device tree case, just take some IRQs */ |
2749 | 2750 | if (!np) |
... | ... | @@ -2757,6 +2758,10 @@ |
2757 | 2758 | pr_err("Failed to create irqdomain\n"); |
2758 | 2759 | return -ENOSYS; |
2759 | 2760 | } |
2761 | + | |
2762 | + /* All wakeups will be used, so create mappings for all */ | |
2763 | + for (i = 0; i < NUM_PRCMU_WAKEUPS; i++) | |
2764 | + irq_create_mapping(db8500_irq_domain, i); | |
2760 | 2765 | |
2761 | 2766 | return 0; |
2762 | 2767 | } |