.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Generic Broadcom Set Top Box Level 2 Interrupt controller driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2014-2017 Broadcom |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, |
---|
11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - * GNU General Public License for more details. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
169 | 161 | *init_params) |
---|
170 | 162 | { |
---|
171 | 163 | unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; |
---|
| 164 | + unsigned int set = 0; |
---|
172 | 165 | struct brcmstb_l2_intc_data *data; |
---|
173 | 166 | struct irq_chip_type *ct; |
---|
174 | 167 | int ret; |
---|
.. | .. |
---|
216 | 209 | if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) |
---|
217 | 210 | flags |= IRQ_GC_BE_IO; |
---|
218 | 211 | |
---|
| 212 | + if (init_params->handler == handle_level_irq) |
---|
| 213 | + set |= IRQ_LEVEL; |
---|
| 214 | + |
---|
219 | 215 | /* Allocate a single Generic IRQ chip for this node */ |
---|
220 | 216 | ret = irq_alloc_domain_generic_chips(data->domain, 32, 1, |
---|
221 | | - np->full_name, init_params->handler, clr, 0, flags); |
---|
| 217 | + np->full_name, init_params->handler, clr, set, flags); |
---|
222 | 218 | if (ret) { |
---|
223 | 219 | pr_err("failed to allocate generic irq chip\n"); |
---|
224 | 220 | goto out_free_domain; |
---|
.. | .. |
---|
262 | 258 | */ |
---|
263 | 259 | data->gc->wake_enabled = 0xffffffff; |
---|
264 | 260 | ct->chip.irq_set_wake = irq_gc_set_wake; |
---|
| 261 | + enable_irq_wake(parent_irq); |
---|
265 | 262 | } |
---|
| 263 | + |
---|
| 264 | + pr_info("registered L2 intc (%pOF, parent irq: %d)\n", np, parent_irq); |
---|
266 | 265 | |
---|
267 | 266 | return 0; |
---|
268 | 267 | |
---|
.. | .. |
---|
275 | 274 | return ret; |
---|
276 | 275 | } |
---|
277 | 276 | |
---|
278 | | -int __init brcmstb_l2_edge_intc_of_init(struct device_node *np, |
---|
| 277 | +static int __init brcmstb_l2_edge_intc_of_init(struct device_node *np, |
---|
279 | 278 | struct device_node *parent) |
---|
280 | 279 | { |
---|
281 | 280 | return brcmstb_l2_intc_of_init(np, parent, &l2_edge_intc_init); |
---|
282 | 281 | } |
---|
283 | 282 | IRQCHIP_DECLARE(brcmstb_l2_intc, "brcm,l2-intc", brcmstb_l2_edge_intc_of_init); |
---|
| 283 | +IRQCHIP_DECLARE(brcmstb_hif_spi_l2_intc, "brcm,hif-spi-l2-intc", |
---|
| 284 | + brcmstb_l2_edge_intc_of_init); |
---|
| 285 | +IRQCHIP_DECLARE(brcmstb_upg_aux_aon_l2_intc, "brcm,upg-aux-aon-l2-intc", |
---|
| 286 | + brcmstb_l2_edge_intc_of_init); |
---|
284 | 287 | |
---|
285 | | -int __init brcmstb_l2_lvl_intc_of_init(struct device_node *np, |
---|
| 288 | +static int __init brcmstb_l2_lvl_intc_of_init(struct device_node *np, |
---|
286 | 289 | struct device_node *parent) |
---|
287 | 290 | { |
---|
288 | 291 | return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init); |
---|