diff options
author | Simon Glass <sjg@chromium.org> | 2021-08-07 07:24:11 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-09-25 09:46:15 -0600 |
commit | 3e57ad907caa55bab8ba52ef87ddbc5130aede2c (patch) | |
tree | e06d04c0dbb964ec388ca885aa4544da2398963d /drivers/misc/irq-uclass.c | |
parent | f521be6083db98e8e17b5b05626bfa6a0d5acf9b (diff) |
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 'drivers/misc/irq-uclass.c')
-rw-r--r-- | drivers/misc/irq-uclass.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/misc/irq-uclass.c b/drivers/misc/irq-uclass.c index 3aa26f61d9e..eb9f3b902f4 100644 --- a/drivers/misc/irq-uclass.c +++ b/drivers/misc/irq-uclass.c @@ -64,8 +64,8 @@ int irq_read_and_clear(struct irq *irq) } #if CONFIG_IS_ENABLED(OF_PLATDATA) -int irq_get_by_driver_info(struct udevice *dev, - struct phandle_1_arg *cells, struct irq *irq) +int irq_get_by_phandle(struct udevice *dev, const struct phandle_2_arg *cells, + struct irq *irq) { int ret; @@ -74,6 +74,12 @@ int irq_get_by_driver_info(struct udevice *dev, return ret; irq->id = cells->arg[0]; + /* + * Note: we could call irq_of_xlate_default() here to do this properly. + * For now, this is good enough for existing cases. + */ + irq->flags = cells->arg[1]; + return 0; } #else |