ARM: sa1111: add sa1111_get_irq()
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 5 Sep 2016 23:45:33 +0000 (00:45 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 20 Sep 2016 13:21:08 +0000 (14:21 +0100)
Add a helper function to get the irq number for a device.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/common/sa1111.c
arch/arm/include/asm/hardware/sa1111.h

index 7f232ce5094441e37a66801f9be0da2888041fc2..3c722a4143feff42b6a62b0ada81389dedfc5198 100644 (file)
@@ -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."
  *
index 7c2bbc7f0be168693a674df1f4f86142b25d5e25..267e43b5225f4e6d8c278149026217603f77373b 100644 (file)
@@ -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