forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/mips/include/asm/dma-coherence.h
....@@ -20,6 +20,12 @@
2020 #elif defined(CONFIG_DMA_MAYBE_COHERENT)
2121 extern enum coherent_io_user_state coherentio;
2222 extern int hw_coherentio;
23
+
24
+static inline bool dev_is_dma_coherent(struct device *dev)
25
+{
26
+ return coherentio == IO_COHERENCE_ENABLED ||
27
+ (coherentio == IO_COHERENCE_DEFAULT && hw_coherentio);
28
+}
2329 #else
2430 #ifdef CONFIG_DMA_NONCOHERENT
2531 #define coherentio IO_COHERENCE_DISABLED