Lines Matching +full:case +full:- +full:sensitive

1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
4 * Author Mark-PK Tsai <mark-pk.tsai@mediatek.com>
49 raw_spin_lock_irqsave(&cd->lock, flags); in mst_set_irq()
50 val = readw_relaxed(cd->base + offset) | mask; in mst_set_irq()
51 writew_relaxed(val, cd->base + offset); in mst_set_irq()
52 raw_spin_unlock_irqrestore(&cd->lock, flags); in mst_set_irq()
65 raw_spin_lock_irqsave(&cd->lock, flags); in mst_clear_irq()
66 val = readw_relaxed(cd->base + offset) & ~mask; in mst_clear_irq()
67 writew_relaxed(val, cd->base + offset); in mst_clear_irq()
68 raw_spin_unlock_irqrestore(&cd->lock, flags); in mst_clear_irq()
87 if (!cd->no_eoi) in mst_intc_eoi_irq()
96 case IRQ_TYPE_LEVEL_LOW: in mst_irq_chip_set_type()
97 case IRQ_TYPE_EDGE_FALLING: in mst_irq_chip_set_type()
100 case IRQ_TYPE_LEVEL_HIGH: in mst_irq_chip_set_type()
101 case IRQ_TYPE_EDGE_RISING: in mst_irq_chip_set_type()
105 return -EINVAL; in mst_irq_chip_set_type()
112 .name = "mst-intc",
131 void __iomem *addr = cd->base + INTC_REV_POLARITY; in mst_intc_polarity_save()
133 for (i = 0; i < DIV_ROUND_UP(cd->nr_irqs, 16); i++) in mst_intc_polarity_save()
134 cd->saved_polarity_conf[i] = readw_relaxed(addr + i * 4); in mst_intc_polarity_save()
140 void __iomem *addr = cd->base + INTC_REV_POLARITY; in mst_intc_polarity_restore()
142 for (i = 0; i < DIV_ROUND_UP(cd->nr_irqs, 16); i++) in mst_intc_polarity_restore()
143 writew_relaxed(cd->saved_polarity_conf[i], addr + i * 4); in mst_intc_polarity_restore()
181 struct mst_intc_chip_data *cd = d->host_data; in mst_intc_domain_translate()
183 if (is_of_node(fwspec->fwnode)) { in mst_intc_domain_translate()
184 if (fwspec->param_count != 3) in mst_intc_domain_translate()
185 return -EINVAL; in mst_intc_domain_translate()
188 if (fwspec->param[0] != 0) in mst_intc_domain_translate()
189 return -EINVAL; in mst_intc_domain_translate()
191 if (fwspec->param[1] >= cd->nr_irqs) in mst_intc_domain_translate()
192 return -EINVAL; in mst_intc_domain_translate()
194 *hwirq = fwspec->param[1]; in mst_intc_domain_translate()
195 *type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK; in mst_intc_domain_translate()
199 return -EINVAL; in mst_intc_domain_translate()
208 struct mst_intc_chip_data *cd = domain->host_data; in mst_intc_domain_alloc()
211 if (fwspec->param_count != 3) in mst_intc_domain_alloc()
212 return -EINVAL; in mst_intc_domain_alloc()
215 if (fwspec->param[0]) in mst_intc_domain_alloc()
216 return -EINVAL; in mst_intc_domain_alloc()
218 hwirq = fwspec->param[1]; in mst_intc_domain_alloc()
222 domain->host_data); in mst_intc_domain_alloc()
225 parent_fwspec.fwnode = domain->parent->fwnode; in mst_intc_domain_alloc()
226 parent_fwspec.param[1] = cd->irq_start + hwirq; in mst_intc_domain_alloc()
229 * mst-intc latch the interrupt request if it's edge triggered, in mst_intc_domain_alloc()
230 * so the output signal to parent GIC is always level sensitive. in mst_intc_domain_alloc()
254 pr_err("mst-intc: interrupt-parent not found\n"); in mst_intc_of_init()
255 return -EINVAL; in mst_intc_of_init()
258 if (of_property_read_u32_index(dn, "mstar,irqs-map-range", 0, &irq_start) || in mst_intc_of_init()
259 of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end)) in mst_intc_of_init()
260 return -EINVAL; in mst_intc_of_init()
264 return -ENOMEM; in mst_intc_of_init()
266 cd->base = of_iomap(dn, 0); in mst_intc_of_init()
267 if (!cd->base) { in mst_intc_of_init()
269 return -ENOMEM; in mst_intc_of_init()
272 cd->no_eoi = of_property_read_bool(dn, "mstar,intc-no-eoi"); in mst_intc_of_init()
273 raw_spin_lock_init(&cd->lock); in mst_intc_of_init()
274 cd->irq_start = irq_start; in mst_intc_of_init()
275 cd->nr_irqs = irq_end - irq_start + 1; in mst_intc_of_init()
276 domain = irq_domain_add_hierarchy(domain_parent, 0, cd->nr_irqs, dn, in mst_intc_of_init()
279 iounmap(cd->base); in mst_intc_of_init()
281 return -ENOMEM; in mst_intc_of_init()
285 INIT_LIST_HEAD(&cd->entry); in mst_intc_of_init()
286 list_add_tail(&cd->entry, &mst_intc_list); in mst_intc_of_init()
291 IRQCHIP_DECLARE(mst_intc, "mstar,mst-intc", mst_intc_of_init);