From 3e57ad907caa55bab8ba52ef87ddbc5130aede2c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 7 Aug 2021 07:24:11 -0600 Subject: 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 --- drivers/misc/irq-uclass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'drivers/misc/irq-uclass.c') 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 -- cgit v1.2.3