From cf6e4ca3e53f734f8fcb253a686c1fdbb6a50e85 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 6 Sep 2016 00:45:33 +0100 Subject: [PATCH] ARM: sa1111: add sa1111_get_irq() Add a helper function to get the irq number for a device. Signed-off-by: Russell King --- arch/arm/common/sa1111.c | 8 ++++++++ arch/arm/include/asm/hardware/sa1111.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 7f232ce50944..3c722a4143fe 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -1357,6 +1357,14 @@ void sa1111_disable_device(struct sa1111_dev *sadev) } EXPORT_SYMBOL(sa1111_disable_device); +int sa1111_get_irq(struct sa1111_dev *sadev, unsigned num) +{ + if (num >= ARRAY_SIZE(sadev->irq)) + return -EINVAL; + return sadev->irq[num]; +} +EXPORT_SYMBOL_GPL(sa1111_get_irq); + /* * SA1111 "Register Access Bus." * diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h index 7c2bbc7f0be1..267e43b5225f 100644 --- a/arch/arm/include/asm/hardware/sa1111.h +++ b/arch/arm/include/asm/hardware/sa1111.h @@ -446,6 +446,8 @@ struct sa1111_driver { int sa1111_enable_device(struct sa1111_dev *); void sa1111_disable_device(struct sa1111_dev *); +int sa1111_get_irq(struct sa1111_dev *, unsigned num); + unsigned int sa1111_pll_clock(struct sa1111_dev *); #define SA1111_AUDIO_ACLINK 0 -- 2.20.1