|
@@ -405,6 +405,28 @@ int of_irq_get(struct device_node *dev, int index)
|
|
|
return irq_create_of_mapping(&oirq);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * of_irq_get_byname - Decode a node's IRQ and return it as a Linux irq number
|
|
|
+ * @dev: pointer to device tree node
|
|
|
+ * @name: irq name
|
|
|
+ *
|
|
|
+ * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
|
|
|
+ * is not yet created, or error code in case of any other failure.
|
|
|
+ */
|
|
|
+int of_irq_get_byname(struct device_node *dev, const char *name)
|
|
|
+{
|
|
|
+ int index;
|
|
|
+
|
|
|
+ if (unlikely(!name))
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ index = of_property_match_string(dev, "interrupt-names", name);
|
|
|
+ if (index < 0)
|
|
|
+ return index;
|
|
|
+
|
|
|
+ return of_irq_get(dev, index);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* of_irq_count - Count the number of IRQs a node uses
|
|
|
* @dev: pointer to device tree node
|