• Home
  • Raw
  • Download

Lines Matching +full:interrupt +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <linux/dma/ipu-dma.h>
20 * Register read / write - shall be inlined by the compiler
24 return __raw_readl(ipu->reg_ipu + reg); in ipu_read_reg()
29 __raw_writel(value, ipu->reg_ipu + reg); in ipu_write_reg()
95 struct ipu_irq_map *map = irq_data_get_irq_chip_data(d); in ipu_irq_unmask() local
102 bank = map->bank; in ipu_irq_unmask()
105 pr_err("IPU: %s(%u) - unmapped!\n", __func__, d->irq); in ipu_irq_unmask()
109 reg = ipu_read_reg(bank->ipu, bank->control); in ipu_irq_unmask()
110 reg |= (1UL << (map->source & 31)); in ipu_irq_unmask()
111 ipu_write_reg(bank->ipu, reg, bank->control); in ipu_irq_unmask()
118 struct ipu_irq_map *map = irq_data_get_irq_chip_data(d); in ipu_irq_mask() local
125 bank = map->bank; in ipu_irq_mask()
128 pr_err("IPU: %s(%u) - unmapped!\n", __func__, d->irq); in ipu_irq_mask()
132 reg = ipu_read_reg(bank->ipu, bank->control); in ipu_irq_mask()
133 reg &= ~(1UL << (map->source & 31)); in ipu_irq_mask()
134 ipu_write_reg(bank->ipu, reg, bank->control); in ipu_irq_mask()
141 struct ipu_irq_map *map = irq_data_get_irq_chip_data(d); in ipu_irq_ack() local
147 bank = map->bank; in ipu_irq_ack()
150 pr_err("IPU: %s(%u) - unmapped!\n", __func__, d->irq); in ipu_irq_ack()
154 ipu_write_reg(bank->ipu, 1UL << (map->source & 31), bank->status); in ipu_irq_ack()
159 * ipu_irq_status() - returns the current interrupt status of the specified IRQ.
160 * @irq: interrupt line to get status for.
161 * @return: true if the interrupt is pending/asserted or false if the
162 * interrupt is not pending.
166 struct ipu_irq_map *map = irq_get_chip_data(irq); in ipu_irq_status() local
172 bank = map->bank; in ipu_irq_status()
173 ret = bank && ipu_read_reg(bank->ipu, bank->status) & in ipu_irq_status()
174 (1UL << (map->source & 31)); in ipu_irq_status()
181 * ipu_irq_map() - map an IPU interrupt source to an IRQ number
182 * @source: interrupt source bit position (see below)
186 * sources, they are broken down in 5 32-bit registers, like 32, 32, 24, 32, 17.
188 * the possible IRQ, but rather its bit position. So, first interrupt in fourth
191 * with any interrupt bit assignments.
195 int i, ret = -ENOMEM; in ipu_irq_map()
196 struct ipu_irq_map *map; in ipu_irq_map() local
201 map = src2map(source); in ipu_irq_map()
202 if (map) { in ipu_irq_map()
203 pr_err("IPU: Source %u already mapped to IRQ %u\n", source, map->irq); in ipu_irq_map()
204 ret = -EBUSY; in ipu_irq_map()
227 pr_err("IPU: couldn't map source %u: %d\n", source, ret); in ipu_irq_map()
233 * ipu_irq_map() - map an IPU interrupt source to an IRQ number
234 * @source: interrupt source bit position (see ipu_irq_map())
239 int i, ret = -EINVAL; in ipu_irq_unmap()
252 irq_map[i].source = -EINVAL; in ipu_irq_unmap()
265 /* Chained IRQ handler for IPU function and error interrupt */
276 status = ipu_read_reg(ipu, bank->status); in ipu_irq_handler()
279 * be acked by ->handle_irq() (handle_level_irq). However, we in ipu_irq_handler()
282 status &= ipu_read_reg(ipu, bank->control); in ipu_irq_handler()
285 struct ipu_irq_map *map; in ipu_irq_handler() local
288 line--; in ipu_irq_handler()
292 map = src2map(32 * i + line); in ipu_irq_handler()
293 if (!map) { in ipu_irq_handler()
295 pr_err("IPU: Interrupt on unmapped source %u bank %d\n", in ipu_irq_handler()
299 irq = map->irq; in ipu_irq_handler()
317 int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS, in ipu_irq_attach_irq()
338 irq_map[i].source = -EINVAL; in ipu_irq_attach_irq()
343 irq_set_chained_handler_and_data(ipu->irq_fn, ipu_irq_handler, ipu); in ipu_irq_attach_irq()
345 irq_set_chained_handler_and_data(ipu->irq_err, ipu_irq_handler, ipu); in ipu_irq_attach_irq()
347 ipu->irq_base = irq_base; in ipu_irq_attach_irq()
356 irq_base = ipu->irq_base; in ipu_irq_detach_irq()
358 irq_set_chained_handler_and_data(ipu->irq_fn, NULL, NULL); in ipu_irq_detach_irq()
360 irq_set_chained_handler_and_data(ipu->irq_err, NULL, NULL); in ipu_irq_detach_irq()