[PATCH 08/14] mfd: Add IRQ domain support for the AB8500

From
Linus Walleij <hidden>
Date
2012-06-11 21:33:13
Also in
lkml
Reply to
Lee Jones, 2012-06-11
On Mon, Jun 11, 2012 at 5:25 PM, Lee Jones [off-list ref] wrote:
As the AB8500 is an IRQ controller in its own right, here we provide
the AB8500 driver with IRQ domain support. This is required if we wish
to reference any of its IRQs from a platform's Device Tree.
OK..
quoted hunk ↗ jump to hunk
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
(...)
quoted hunk ↗ jump to hunk
-static int ab8500_irq_init(struct ab8500 *ab8500)
+/**
+ * ab8500_irq_get_virq(): Map an interrupt on a chip to a virtual IRQ
+ *
+ * Useful for drivers to request their own IRQs.
Check style against Documentation/kernel-doc-nano-HOWTO.txt
verbos explanation follows argument documentation.
+ *
+ * @ab8500: ab8500_irq controller to operate on.
+ * @irq: index of the interrupt requested in the chip IRQs
+ */
+int ab8500_irq_get_virq(struct ab8500 *ab8500, int irq)
?{
- ? ? ? int base = ab8500->irq_base;
- ? ? ? int irq;
- ? ? ? int num_irqs;
+ ? ? ? if (!ab8500)
+ ? ? ? ? ? ? ? return -EINVAL;

- ? ? ? if (is_ab9540(ab8500))
- ? ? ? ? ? ? ? num_irqs = AB9540_NR_IRQS;
- ? ? ? else if (is_ab8505(ab8500))
- ? ? ? ? ? ? ? num_irqs = AB8505_NR_IRQS;
- ? ? ? else
- ? ? ? ? ? ? ? num_irqs = AB8500_NR_IRQS;
+ ? ? ? return irq_create_mapping(ab8500->domain, irq);
+}
+EXPORT_SYMBOL_GPL(ab8500_irq_get_virq);
(...)
quoted hunk ↗ jump to hunk
@@ -1233,11 +1256,9 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
? ? ? ?if (plat)
? ? ? ? ? ? ? ?ab8500->irq_base = plat->irq_base;
- ? ? ? else if (np)
- ? ? ? ? ? ? ? ret = of_property_read_u32(np, "stericsson,irq-base", &ab8500->irq_base);
So if we're not using the irq base thing anymore, should you also
delete it from the binding document too? (If there is no binding
doc something is wrong and you need to create it I guess...)
quoted hunk ↗ jump to hunk
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 91dd3ef..48f126c 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -227,6 +227,7 @@ enum ab8500_version {
?* @irq_lock: genirq bus lock
?* @transfer_ongoing: 0 if no transfer ongoing
?* @irq: irq line
+ * @irq_domain: irq domain
?* @version: chip version id (e.g. ab8500 or ab9540)
?* @chip_id: chip revision id
?* @write: register write
@@ -247,6 +248,7 @@ struct ab8500 {
? ? ? ?atomic_t ? ? ? ?transfer_ongoing;
? ? ? ?int ? ? ? ? ? ? irq_base;
? ? ? ?int ? ? ? ? ? ? irq;
+ ? ? ? struct irq_domain ?*domain;
Don't you need to forward-declare struct irq_domain?
I think you're just lucky to have it compiling... (Something
else included  <linux/irqdomain.h> on the way here.)

Yours,
Linus Walleij
Thread (92 messages) 92 messages, 9 authors, last reply 2012-07-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help