Lines Matching full:fdma

64 struct fdma;
79 int (*dataptr_cb)(struct fdma *fdma, int dcb_idx, int db_idx, u64 *ptr);
81 int (*nextptr_cb)(struct fdma *fdma, int dcb_idx, u64 *ptr);
84 struct fdma { struct
108 /* Channel id this FDMA object operates on */
115 static inline void fdma_dcb_advance(struct fdma *fdma) in fdma_dcb_advance() argument
117 fdma->dcb_index++; in fdma_dcb_advance()
118 if (fdma->dcb_index >= fdma->n_dcbs) in fdma_dcb_advance()
119 fdma->dcb_index = 0; in fdma_dcb_advance()
123 static inline void fdma_db_advance(struct fdma *fdma) in fdma_db_advance() argument
125 fdma->db_index++; in fdma_db_advance()
129 static inline void fdma_db_reset(struct fdma *fdma) in fdma_db_reset() argument
131 fdma->db_index = 0; in fdma_db_reset()
135 static inline bool fdma_dcb_is_reusable(struct fdma *fdma) in fdma_dcb_is_reusable() argument
137 return fdma->db_index != fdma->n_dbs; in fdma_dcb_is_reusable()
140 /* Check if the FDMA has marked this DB as done. */
159 static inline struct fdma_db *fdma_db_get(struct fdma *fdma, int dcb_idx, in fdma_db_get() argument
162 return &fdma->dcbs[dcb_idx].db[db_idx]; in fdma_db_get()
166 static inline struct fdma_db *fdma_db_next_get(struct fdma *fdma) in fdma_db_next_get() argument
168 return fdma_db_get(fdma, fdma->dcb_index, fdma->db_index); in fdma_db_next_get()
172 static inline struct fdma_dcb *fdma_dcb_get(struct fdma *fdma, int dcb_idx) in fdma_dcb_get() argument
174 return &fdma->dcbs[dcb_idx]; in fdma_dcb_get()
178 static inline struct fdma_dcb *fdma_dcb_next_get(struct fdma *fdma) in fdma_dcb_next_get() argument
180 return fdma_dcb_get(fdma, fdma->dcb_index); in fdma_dcb_next_get()
183 /* Check if the FDMA has frames ready for extraction. */
184 static inline bool fdma_has_frames(struct fdma *fdma) in fdma_has_frames() argument
186 return fdma_db_is_done(fdma_db_next_get(fdma)); in fdma_has_frames()
190 static inline int fdma_nextptr_cb(struct fdma *fdma, int dcb_idx, u64 *nextptr) in fdma_nextptr_cb() argument
192 *nextptr = fdma->dma + (sizeof(struct fdma_dcb) * dcb_idx); in fdma_nextptr_cb()
200 static inline u64 fdma_dataptr_get_contiguous(struct fdma *fdma, int dcb_idx, in fdma_dataptr_get_contiguous() argument
203 return fdma->dma + (sizeof(struct fdma_dcb) * fdma->n_dcbs) + in fdma_dataptr_get_contiguous()
204 (dcb_idx * fdma->n_dbs + db_idx) * fdma->db_size + in fdma_dataptr_get_contiguous()
212 static inline void *fdma_dataptr_virt_get_contiguous(struct fdma *fdma, in fdma_dataptr_virt_get_contiguous() argument
215 return (u8 *)fdma->dcbs + (sizeof(struct fdma_dcb) * fdma->n_dcbs) + in fdma_dataptr_virt_get_contiguous()
216 (dcb_idx * fdma->n_dbs + db_idx) * fdma->db_size + in fdma_dataptr_virt_get_contiguous()
221 static inline bool fdma_is_last(struct fdma *fdma, struct fdma_dcb *dcb) in fdma_is_last() argument
223 return dcb == fdma->last_dcb; in fdma_is_last()
226 int fdma_dcbs_init(struct fdma *fdma, u64 info, u64 status);
227 int fdma_db_add(struct fdma *fdma, int dcb_idx, int db_idx, u64 status);
228 int fdma_dcb_add(struct fdma *fdma, int dcb_idx, u64 info, u64 status);
229 int __fdma_dcb_add(struct fdma *fdma, int dcb_idx, u64 info, u64 status,
230 int (*dcb_cb)(struct fdma *fdma, int dcb_idx, u64 *nextptr),
231 int (*db_cb)(struct fdma *fdma, int dcb_idx, int db_idx,
234 int fdma_alloc_coherent(struct device *dev, struct fdma *fdma);
235 int fdma_alloc_phys(struct fdma *fdma);
237 void fdma_free_coherent(struct device *dev, struct fdma *fdma);
238 void fdma_free_phys(struct fdma *fdma);
240 u32 fdma_get_size(struct fdma *fdma);
241 u32 fdma_get_size_contiguous(struct fdma *fdma);