summaryrefslogtreecommitdiff
path: root/backport-include/linux/of_device.h
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2019-03-04 12:01:54 +0100
committerDominik Sliwa <dominik.sliwa@toradex.com>2019-03-04 12:01:54 +0100
commit348fa3f6871f56a37dcd16c99ca98118c6d79a38 (patch)
tree6fcae7785bae4ffb838fd6549f7d01ba6abf0763 /backport-include/linux/of_device.h
Backports v4.19.24
Backports generated by toradex backports 515a1fa55cda2b1d952872e1786857481bd54fcc against mainline kernel tag v4.19.24 Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/linux/of_device.h')
-rw-r--r--backport-include/linux/of_device.h33
1 files changed, 33 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..827c7fb
--- /dev/null
+++ b/backport-include/linux/of_device.h
@@ -0,0 +1,33 @@
+#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 */
+
+#if LINUX_VERSION_IS_LESS(4,12,0)
+#if LINUX_VERSION_IS_GEQ(4,4,0)
+ssize_t bp_of_device_modalias(struct device *dev, char *str, ssize_t len);
+#define of_device_modalias bp_of_device_modalias
+#endif /* > 4.4.0 */
+#endif /* < 4.12 */
+
+#endif /* __BP_OF_DEVICE_H */