aboutsummaryrefslogtreecommitdiff
path: root/include/irq.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-08-07 07:24:11 -0600
committerSimon Glass <sjg@chromium.org>2021-09-25 09:46:15 -0600
commit3e57ad907caa55bab8ba52ef87ddbc5130aede2c (patch)
treee06d04c0dbb964ec388ca885aa4544da2398963d /include/irq.h
parentf521be6083db98e8e17b5b05626bfa6a0d5acf9b (diff)
downloadu-boot-3e57ad907caa55bab8ba52ef87ddbc5130aede2c.zip
u-boot-3e57ad907caa55bab8ba52ef87ddbc5130aede2c.tar.gz
u-boot-3e57ad907caa55bab8ba52ef87ddbc5130aede2c.tar.bz2
irq: Tidy up of-platdata irq support
This function is available but not exported. More generally it does not really work as intended. Reimplement it and add a sandbox test too. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/irq.h')
-rw-r--r--include/irq.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/irq.h b/include/irq.h
index 8527e4d..a0965e4 100644
--- a/include/irq.h
+++ b/include/irq.h
@@ -200,6 +200,35 @@ int irq_restore_polarities(struct udevice *dev);
*/
int irq_read_and_clear(struct irq *irq);
+struct phandle_2_arg;
+/**
+ * irq_get_by_phandle() - Get an irq by its phandle information (of-platadata)
+ *
+ * This function is used when of-platdata is enabled.
+ *
+ * This looks up an irq using the phandle info. With dtoc, each phandle in the
+ * 'interrupts-extended ' property is transformed into an idx representing the
+ * device. For example:
+ *
+ * interrupts-extended = <&acpi_gpe 0x3c 0>;
+ *
+ * might result in:
+ *
+ * .interrupts_extended = {6, {0x3c, 0}},},
+ *
+ * indicating that the irq is udevice idx 6 in dt-plat.c with a arguments of
+ * 0x3c and 0.This function can return a valid irq given the above
+ * information. In this example it would return an irq containing the
+ * 'acpi_gpe' device and the irq ID 0x3c.
+ *
+ * @dev: Device containing the phandle
+ * @cells: Phandle info
+ * @irq: A pointer to a irq struct to initialise
+ * @return 0 if OK, or a negative error code
+ */
+int irq_get_by_phandle(struct udevice *dev, const struct phandle_2_arg *cells,
+ struct irq *irq);
+
/**
* irq_get_by_index - Get/request an irq by integer index.
*