hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/irqchip/irq-bcm7120-l2.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Broadcom BCM7120 style Level 2 interrupt controller driver
34 *
45 * Copyright (C) 2014 Broadcom Corporation
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.
96 */
107
118 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -146,6 +143,9 @@
146143
147144 irq_set_chained_handler_and_data(parent_irq,
148145 bcm7120_l2_intc_irq_handle, l1_data);
146
+ if (data->can_wake)
147
+ enable_irq_wake(parent_irq);
148
+
149149 return 0;
150150 }
151151
....@@ -250,6 +250,8 @@
250250 if (ret < 0)
251251 goto out_free_l1_data;
252252
253
+ data->can_wake = of_property_read_bool(dn, "brcm,irq-can-wake");
254
+
253255 for (irq = 0; irq < data->num_parent_irqs; irq++) {
254256 ret = bcm7120_l2_intc_init_one(dn, data, irq, valid_mask);
255257 if (ret)
....@@ -271,14 +273,12 @@
271273 flags |= IRQ_GC_BE_IO;
272274
273275 ret = irq_alloc_domain_generic_chips(data->domain, IRQS_PER_WORD, 1,
274
- dn->full_name, handle_level_irq, clr, 0, flags);
276
+ dn->full_name, handle_level_irq, clr,
277
+ IRQ_LEVEL, flags);
275278 if (ret) {
276279 pr_err("failed to allocate generic irq chip\n");
277280 goto out_free_domain;
278281 }
279
-
280
- if (of_property_read_bool(dn, "brcm,irq-can-wake"))
281
- data->can_wake = true;
282282
283283 for (idx = 0; idx < data->n_words; idx++) {
284284 irq = idx * IRQS_PER_WORD;
....@@ -310,7 +310,7 @@
310310
311311 if (data->can_wake) {
312312 /* This IRQ chip can wake the system, set all
313
- * relevant child interupts in wake_enabled mask
313
+ * relevant child interrupts in wake_enabled mask
314314 */
315315 gc->wake_enabled = 0xffffffff;
316316 gc->wake_enabled &= ~gc->unused;
....@@ -318,6 +318,9 @@
318318 }
319319 }
320320
321
+ pr_info("registered %s intc (%pOF, parent IRQ(s): %d)\n",
322
+ intc_name, dn, data->num_parent_irqs);
323
+
321324 return 0;
322325
323326 out_free_domain: