@@ -160,6 +160,16 @@ struct dma_interleaved_template {
160160 struct data_chunk sgl [];
161161};
162162
163+ /**
164+ * struct dma_vec - DMA vector
165+ * @addr: Bus address of the start of the vector
166+ * @len: Length in bytes of the DMA vector
167+ */
168+ struct dma_vec {
169+ dma_addr_t addr ;
170+ size_t len ;
171+ };
172+
163173/**
164174 * enum dma_ctrl_flags - DMA flags to augment operation preparation,
165175 * control completion, and communicate status.
@@ -910,6 +920,10 @@ struct dma_device {
910920 struct dma_async_tx_descriptor * (* device_prep_dma_interrupt )(
911921 struct dma_chan * chan , unsigned long flags );
912922
923+ struct dma_async_tx_descriptor * (* device_prep_peripheral_dma_vec )(
924+ struct dma_chan * chan , const struct dma_vec * vecs ,
925+ size_t nents , enum dma_transfer_direction direction ,
926+ unsigned long flags );
913927 struct dma_async_tx_descriptor * (* device_prep_slave_sg )(
914928 struct dma_chan * chan , struct scatterlist * sgl ,
915929 unsigned int sg_len , enum dma_transfer_direction direction ,
@@ -973,6 +987,25 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
973987 dir , flags , NULL );
974988}
975989
990+ /**
991+ * dmaengine_prep_peripheral_dma_vec() - Prepare a DMA scatter-gather descriptor
992+ * @chan: The channel to be used for this descriptor
993+ * @vecs: The array of DMA vectors that should be transferred
994+ * @nents: The number of DMA vectors in the array
995+ * @dir: Specifies the direction of the data transfer
996+ * @flags: DMA engine flags
997+ */
998+ static inline struct dma_async_tx_descriptor * dmaengine_prep_peripheral_dma_vec (
999+ struct dma_chan * chan , const struct dma_vec * vecs , size_t nents ,
1000+ enum dma_transfer_direction dir , unsigned long flags )
1001+ {
1002+ if (!chan || !chan -> device || !chan -> device -> device_prep_peripheral_dma_vec )
1003+ return NULL ;
1004+
1005+ return chan -> device -> device_prep_peripheral_dma_vec (chan , vecs , nents ,
1006+ dir , flags );
1007+ }
1008+
9761009static inline struct dma_async_tx_descriptor * dmaengine_prep_slave_sg (
9771010 struct dma_chan * chan , struct scatterlist * sgl , unsigned int sg_len ,
9781011 enum dma_transfer_direction dir , unsigned long flags )
0 commit comments