Lines Matching +full:intc +full:- +full:no +full:- +full:eoi
1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
4 * Author Mark-PK Tsai <mark-pk.tsai@mediatek.com>
37 raw_spin_lock_irqsave(&cd->lock, flags); in mst_set_irq()
38 val = readw_relaxed(cd->base + offset) | mask; in mst_set_irq()
39 writew_relaxed(val, cd->base + offset); in mst_set_irq()
40 raw_spin_unlock_irqrestore(&cd->lock, flags); in mst_set_irq()
53 raw_spin_lock_irqsave(&cd->lock, flags); in mst_clear_irq()
54 val = readw_relaxed(cd->base + offset) & ~mask; in mst_clear_irq()
55 writew_relaxed(val, cd->base + offset); in mst_clear_irq()
56 raw_spin_unlock_irqrestore(&cd->lock, flags); in mst_clear_irq()
75 if (!cd->no_eoi) in mst_intc_eoi_irq()
82 .name = "mst-intc",
102 struct mst_intc_chip_data *cd = d->host_data; in mst_intc_domain_translate()
104 if (is_of_node(fwspec->fwnode)) { in mst_intc_domain_translate()
105 if (fwspec->param_count != 3) in mst_intc_domain_translate()
106 return -EINVAL; in mst_intc_domain_translate()
108 /* No PPI should point to this domain */ in mst_intc_domain_translate()
109 if (fwspec->param[0] != 0) in mst_intc_domain_translate()
110 return -EINVAL; in mst_intc_domain_translate()
112 if (fwspec->param[1] >= cd->nr_irqs) in mst_intc_domain_translate()
113 return -EINVAL; in mst_intc_domain_translate()
115 *hwirq = fwspec->param[1]; in mst_intc_domain_translate()
116 *type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK; in mst_intc_domain_translate()
120 return -EINVAL; in mst_intc_domain_translate()
129 struct mst_intc_chip_data *cd = domain->host_data; in mst_intc_domain_alloc()
132 if (fwspec->param_count != 3) in mst_intc_domain_alloc()
133 return -EINVAL; in mst_intc_domain_alloc()
135 /* No PPI should point to this domain */ in mst_intc_domain_alloc()
136 if (fwspec->param[0]) in mst_intc_domain_alloc()
137 return -EINVAL; in mst_intc_domain_alloc()
139 hwirq = fwspec->param[1]; in mst_intc_domain_alloc()
143 domain->host_data); in mst_intc_domain_alloc()
146 parent_fwspec.fwnode = domain->parent->fwnode; in mst_intc_domain_alloc()
147 parent_fwspec.param[1] = cd->irq_start + hwirq; in mst_intc_domain_alloc()
166 pr_err("mst-intc: interrupt-parent not found\n"); in mst_intc_of_init()
167 return -EINVAL; in mst_intc_of_init()
170 if (of_property_read_u32_index(dn, "mstar,irqs-map-range", 0, &irq_start) || in mst_intc_of_init()
171 of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end)) in mst_intc_of_init()
172 return -EINVAL; in mst_intc_of_init()
176 return -ENOMEM; in mst_intc_of_init()
178 cd->base = of_iomap(dn, 0); in mst_intc_of_init()
179 if (!cd->base) { in mst_intc_of_init()
181 return -ENOMEM; in mst_intc_of_init()
184 cd->no_eoi = of_property_read_bool(dn, "mstar,intc-no-eoi"); in mst_intc_of_init()
185 raw_spin_lock_init(&cd->lock); in mst_intc_of_init()
186 cd->irq_start = irq_start; in mst_intc_of_init()
187 cd->nr_irqs = irq_end - irq_start + 1; in mst_intc_of_init()
188 domain = irq_domain_add_hierarchy(domain_parent, 0, cd->nr_irqs, dn, in mst_intc_of_init()
191 iounmap(cd->base); in mst_intc_of_init()
193 return -ENOMEM; in mst_intc_of_init()
199 IRQCHIP_DECLARE(mst_intc, "mstar,mst-intc", mst_intc_of_init);