backports: add irq_get_trigger_type()
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 31 May 2014 15:19:48 +0000 (17:19 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 1 Jun 2014 22:16:18 +0000 (00:16 +0200)
This function is needed by some drivers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/irq.h [new file with mode: 0644]

diff --git a/backport/backport-include/linux/irq.h b/backport/backport-include/linux/irq.h
new file mode 100644 (file)
index 0000000..8b2804d
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_LINUX_IRQ_H
+#define __BACKPORT_LINUX_IRQ_H
+#include_next <linux/irq.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
+static inline u32 irq_get_trigger_type(unsigned int irq)
+{
+       struct irq_data *d = irq_get_irq_data(irq);
+       return d ? irqd_get_trigger_type(d) : 0;
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_IRQ_H */