summaryrefslogtreecommitdiff
path: root/backport-include/linux/of_device.h
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-03-26 12:44:27 +0200
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-03-26 12:46:50 +0200
commit87d308708712ff6075c4dd54b0519b47fdad8816 (patch)
tree2fb6458b1db7dd21be2648f42412dd2485846c76 /backport-include/linux/of_device.h
Backports v5.4.27
Backports generated by toradex backports f6e8852f1ef28e6d3c9bae8400eb6a87a6b0c3e7 against mainline kernel tag v5.4.27 Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'backport-include/linux/of_device.h')
-rw-r--r--backport-include/linux/of_device.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/backport-include/linux/of_device.h b/backport-include/linux/of_device.h
new file mode 100644
index 0000000..cdd366e
--- /dev/null
+++ b/backport-include/linux/of_device.h
@@ -0,0 +1,26 @@
+#ifndef __BP_OF_DEVICE_H
+#define __BP_OF_DEVICE_H
+#include_next <linux/of_device.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(4,18,0)
+static inline int backport_of_dma_configure(struct device *dev,
+ struct device_node *np,
+ bool force_dma)
+{
+#if LINUX_VERSION_IS_GEQ(4,15,0)
+ dev->bus->force_dma = force_dma;
+ return of_dma_configure(dev, np);
+#elif LINUX_VERSION_IS_GEQ(4,12,0)
+ return of_dma_configure(dev, np);
+#elif LINUX_VERSION_IS_GEQ(4,1,0)
+ of_dma_configure(dev, np);
+ return 0;
+#else
+ return 0;
+#endif
+}
+#define of_dma_configure LINUX_BACKPORT(of_dma_configure)
+#endif /* < 4.18 */
+
+#endif /* __BP_OF_DEVICE_H */