Lines Matching +full:ext +full:- +full:irq +full:- +full:range
1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <linux/irq.h>
71 return chip_data->base + chip_data->offsets[idx]; in mtk_cirq_reg()
83 struct mtk_cirq_chip_data *chip_data = data->chip_data; in mtk_cirq_write_mask()
84 unsigned int cirq_num = data->hwirq; in mtk_cirq_write_mask()
127 data = data->parent_data; in mtk_cirq_set_type()
128 ret = data->chip->irq_set_type(data, type); in mtk_cirq_set_type()
149 if (is_of_node(fwspec->fwnode)) { in mtk_cirq_domain_translate()
150 if (fwspec->param_count != 3) in mtk_cirq_domain_translate()
151 return -EINVAL; in mtk_cirq_domain_translate()
154 if (fwspec->param[0] != 0) in mtk_cirq_domain_translate()
155 return -EINVAL; in mtk_cirq_domain_translate()
157 /* cirq support irq number check */ in mtk_cirq_domain_translate()
158 if (fwspec->param[1] < cirq_data->ext_irq_start || in mtk_cirq_domain_translate()
159 fwspec->param[1] > cirq_data->ext_irq_end) in mtk_cirq_domain_translate()
160 return -EINVAL; in mtk_cirq_domain_translate()
162 *hwirq = fwspec->param[1] - cirq_data->ext_irq_start; in mtk_cirq_domain_translate()
163 *type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK; in mtk_cirq_domain_translate()
167 return -EINVAL; in mtk_cirq_domain_translate()
184 return -EINVAL; in mtk_cirq_domain_alloc()
188 domain->host_data); in mtk_cirq_domain_alloc()
190 parent_fwspec.fwnode = domain->parent->fwnode; in mtk_cirq_domain_alloc()
206 unsigned int irq, hwirq_num; in mtk_cirq_suspend() local
221 * - Iterate over all the CIRQ supported interrupts; in mtk_cirq_suspend()
222 * - For each interrupt, inspect its pending and masked status at GIC in mtk_cirq_suspend()
224 * - If pending and unmasked, it happened between in mtk_cirq_suspend()
228 hwirq_num = cirq_data->ext_irq_end - cirq_data->ext_irq_start + 1; in mtk_cirq_suspend()
230 irq = irq_find_mapping(cirq_data->domain, i); in mtk_cirq_suspend()
231 if (irq) { in mtk_cirq_suspend()
232 pendret = irq_get_irqchip_state(irq, in mtk_cirq_suspend()
236 maskret = irq_get_irqchip_state(irq, in mtk_cirq_suspend()
250 /* set edge_only mode, record edge-triggerd interrupts */ in mtk_cirq_suspend()
289 { .compatible = "mediatek,mt2701-cirq", .data = &mtk_cirq_regoffs_v1 },
290 { .compatible = "mediatek,mt8135-cirq", .data = &mtk_cirq_regoffs_v1 },
291 { .compatible = "mediatek,mt8173-cirq", .data = &mtk_cirq_regoffs_v1 },
292 { .compatible = "mediatek,mt8192-cirq", .data = &mtk_cirq_regoffs_v2 },
306 pr_err("mtk_cirq: interrupt-parent not found\n"); in mtk_cirq_of_init()
307 return -EINVAL; in mtk_cirq_of_init()
312 return -ENOMEM; in mtk_cirq_of_init()
314 cirq_data->base = of_iomap(node, 0); in mtk_cirq_of_init()
315 if (!cirq_data->base) { in mtk_cirq_of_init()
317 ret = -ENXIO; in mtk_cirq_of_init()
321 ret = of_property_read_u32_index(node, "mediatek,ext-irq-range", 0, in mtk_cirq_of_init()
322 &cirq_data->ext_irq_start); in mtk_cirq_of_init()
326 ret = of_property_read_u32_index(node, "mediatek,ext-irq-range", 1, in mtk_cirq_of_init()
327 &cirq_data->ext_irq_end); in mtk_cirq_of_init()
333 ret = -ENODEV; in mtk_cirq_of_init()
336 cirq_data->offsets = match->data; in mtk_cirq_of_init()
338 irq_num = cirq_data->ext_irq_end - cirq_data->ext_irq_start + 1; in mtk_cirq_of_init()
343 ret = -ENOMEM; in mtk_cirq_of_init()
346 cirq_data->domain = domain; in mtk_cirq_of_init()
353 iounmap(cirq_data->base); in mtk_cirq_of_init()
359 IRQCHIP_DECLARE(mtk_cirq, "mediatek,mtk-cirq", mtk_cirq_of_init);