hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/irqchip/irq-brcmstb-l2.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Generic Broadcom Set Top Box Level 2 Interrupt controller driver
34 *
45 * 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.
146 */
157
168 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -169,6 +161,7 @@
169161 *init_params)
170162 {
171163 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
164
+ unsigned int set = 0;
172165 struct brcmstb_l2_intc_data *data;
173166 struct irq_chip_type *ct;
174167 int ret;
....@@ -216,9 +209,12 @@
216209 if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
217210 flags |= IRQ_GC_BE_IO;
218211
212
+ if (init_params->handler == handle_level_irq)
213
+ set |= IRQ_LEVEL;
214
+
219215 /* Allocate a single Generic IRQ chip for this node */
220216 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);
222218 if (ret) {
223219 pr_err("failed to allocate generic irq chip\n");
224220 goto out_free_domain;
....@@ -262,7 +258,10 @@
262258 */
263259 data->gc->wake_enabled = 0xffffffff;
264260 ct->chip.irq_set_wake = irq_gc_set_wake;
261
+ enable_irq_wake(parent_irq);
265262 }
263
+
264
+ pr_info("registered L2 intc (%pOF, parent irq: %d)\n", np, parent_irq);
266265
267266 return 0;
268267
....@@ -275,14 +274,18 @@
275274 return ret;
276275 }
277276
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,
279278 struct device_node *parent)
280279 {
281280 return brcmstb_l2_intc_of_init(np, parent, &l2_edge_intc_init);
282281 }
283282 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);
284287
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,
286289 struct device_node *parent)
287290 {
288291 return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init);