Lines Matching refs:qe_ic
2 * arch/powerpc/sysdev/qe_lib/qe_ic.c
32 #include <asm/qe_ic.h>
34 #include "qe_ic.h"
190 static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
199 struct qe_ic *qe_ic = qe_ic_from_irq(virq);
206 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].mask_reg);
207 qe_ic_write(qe_ic->regs, qe_ic_info[src].mask_reg,
215 struct qe_ic *qe_ic = qe_ic_from_irq(virq);
222 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].mask_reg);
223 qe_ic_write(qe_ic->regs, qe_ic_info[src].mask_reg,
248 /* Exact match, unless qe_ic node is NULL */
255 struct qe_ic *qe_ic = h->host_data;
263 chip = &qe_ic->hc_irq;
265 set_irq_chip_data(virq, qe_ic);
293 unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic)
297 BUG_ON(qe_ic == NULL);
300 irq = qe_ic_read(qe_ic->regs, QEIC_CIVEC) >> 26;
305 return irq_linear_revmap(qe_ic->irqhost, irq);
309 unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic)
313 BUG_ON(qe_ic == NULL);
316 irq = qe_ic_read(qe_ic->regs, QEIC_CHIVEC) >> 26;
321 return irq_linear_revmap(qe_ic->irqhost, irq);
328 struct qe_ic *qe_ic;
336 qe_ic = kzalloc(sizeof(*qe_ic), GFP_KERNEL);
337 if (qe_ic == NULL)
340 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
342 if (qe_ic->irqhost == NULL) {
343 kfree(qe_ic);
347 qe_ic->regs = ioremap(res.start, res.end - res.start + 1);
349 qe_ic->irqhost->host_data = qe_ic;
350 qe_ic->hc_irq = qe_ic_irq_chip;
352 qe_ic->virq_high = irq_of_parse_and_map(node, 0);
353 qe_ic->virq_low = irq_of_parse_and_map(node, 1);
355 if (qe_ic->virq_low == NO_IRQ) {
357 kfree(qe_ic);
382 qe_ic_write(qe_ic->regs, QEIC_CICR, temp);
384 set_irq_data(qe_ic->virq_low, qe_ic);
385 set_irq_chained_handler(qe_ic->virq_low, low_handler);
387 if (qe_ic->virq_high != NO_IRQ &&
388 qe_ic->virq_high != qe_ic->virq_low) {
389 set_irq_data(qe_ic->virq_high, qe_ic);
390 set_irq_chained_handler(qe_ic->virq_high, high_handler);
396 struct qe_ic *qe_ic = qe_ic_from_irq(virq);
400 temp = qe_ic_read(qe_ic->regs, QEIC_CICR);
408 qe_ic_write(qe_ic->regs, QEIC_CICR, temp);
414 struct qe_ic *qe_ic = qe_ic_from_irq(virq);
425 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].pri_reg);
435 qe_ic_write(qe_ic->regs, qe_ic_info[src].pri_reg, temp);
443 struct qe_ic *qe_ic = qe_ic_from_irq(virq);
476 temp = qe_ic_read(qe_ic->regs, control_reg);
479 qe_ic_write(qe_ic->regs, control_reg, temp);
485 .name = "qe_ic",
497 printk(KERN_DEBUG "Registering qe_ic with sysfs...\n");
501 printk(KERN_ERR "Failed registering qe_ic sys class\n");
506 printk(KERN_ERR "Failed registering qe_ic sys device\n");