hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/dma/dmaengine.h
....@@ -77,6 +77,7 @@
7777 state->last = complete;
7878 state->used = used;
7979 state->residue = 0;
80
+ state->in_flight_bytes = 0;
8081 }
8182 return dma_async_is_complete(cookie, complete, used);
8283 }
....@@ -85,6 +86,13 @@
8586 {
8687 if (state)
8788 state->residue = residue;
89
+}
90
+
91
+static inline void dma_set_in_flight_bytes(struct dma_tx_state *state,
92
+ u32 in_flight_bytes)
93
+{
94
+ if (state)
95
+ state->in_flight_bytes = in_flight_bytes;
8896 }
8997
9098 struct dmaengine_desc_callback {
....@@ -171,4 +179,23 @@
171179 return cb->callback || cb->callback_result;
172180 }
173181
182
+struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
183
+struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
184
+
185
+#ifdef CONFIG_DEBUG_FS
186
+#include <linux/debugfs.h>
187
+
188
+static inline struct dentry *
189
+dmaengine_get_debugfs_root(struct dma_device *dma_dev) {
190
+ return dma_dev->dbg_dev_root;
191
+}
192
+#else
193
+struct dentry;
194
+static inline struct dentry *
195
+dmaengine_get_debugfs_root(struct dma_device *dma_dev)
196
+{
197
+ return NULL;
198
+}
199
+#endif /* CONFIG_DEBUG_FS */
200
+
174201 #endif