aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h43
1 files changed, 35 insertions, 8 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index bae1568416f8..c5c92d59e531 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -257,7 +257,7 @@ struct dma_chan_percpu {
257 * @dev: class device for sysfs 257 * @dev: class device for sysfs
258 * @device_node: used to add this to the device chan list 258 * @device_node: used to add this to the device chan list
259 * @local: per-cpu pointer to a struct dma_chan_percpu 259 * @local: per-cpu pointer to a struct dma_chan_percpu
260 * @client-count: how many clients are using this channel 260 * @client_count: how many clients are using this channel
261 * @table_count: number of appearances in the mem-to-mem allocation table 261 * @table_count: number of appearances in the mem-to-mem allocation table
262 * @private: private data for certain client-channel associations 262 * @private: private data for certain client-channel associations
263 */ 263 */
@@ -279,10 +279,10 @@ struct dma_chan {
279 279
280/** 280/**
281 * struct dma_chan_dev - relate sysfs device node to backing channel device 281 * struct dma_chan_dev - relate sysfs device node to backing channel device
282 * @chan - driver channel device 282 * @chan: driver channel device
283 * @device - sysfs device 283 * @device: sysfs device
284 * @dev_id - parent dma_device dev_id 284 * @dev_id: parent dma_device dev_id
285 * @idr_ref - reference count to gate release of dma_device dev_id 285 * @idr_ref: reference count to gate release of dma_device dev_id
286 */ 286 */
287struct dma_chan_dev { 287struct dma_chan_dev {
288 struct dma_chan *chan; 288 struct dma_chan *chan;
@@ -306,9 +306,8 @@ enum dma_slave_buswidth {
306/** 306/**
307 * struct dma_slave_config - dma slave channel runtime config 307 * struct dma_slave_config - dma slave channel runtime config
308 * @direction: whether the data shall go in or out on this slave 308 * @direction: whether the data shall go in or out on this slave
309 * channel, right now. DMA_TO_DEVICE and DMA_FROM_DEVICE are 309 * channel, right now. DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are
310 * legal values, DMA_BIDIRECTIONAL is not acceptable since we 310 * legal values.
311 * need to differentiate source and target addresses.
312 * @src_addr: this is the physical address where DMA slave data 311 * @src_addr: this is the physical address where DMA slave data
313 * should be read (RX), if the source is memory this argument is 312 * should be read (RX), if the source is memory this argument is
314 * ignored. 313 * ignored.
@@ -364,6 +363,32 @@ struct dma_slave_config {
364 unsigned int slave_id; 363 unsigned int slave_id;
365}; 364};
366 365
366/**
367 * enum dma_residue_granularity - Granularity of the reported transfer residue
368 * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The
369 * DMA channel is only able to tell whether a descriptor has been completed or
370 * not, which means residue reporting is not supported by this channel. The
371 * residue field of the dma_tx_state field will always be 0.
372 * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully
373 * completed segment of the transfer (For cyclic transfers this is after each
374 * period). This is typically implemented by having the hardware generate an
375 * interrupt after each transferred segment and then the drivers updates the
376 * outstanding residue by the size of the segment. Another possibility is if
377 * the hardware supports scatter-gather and the segment descriptor has a field
378 * which gets set after the segment has been completed. The driver then counts
379 * the number of segments without the flag set to compute the residue.
380 * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred
381 * burst. This is typically only supported if the hardware has a progress
382 * register of some sort (E.g. a register with the current read/write address
383 * or a register with the amount of bursts/beats/bytes that have been
384 * transferred or still need to be transferred).
385 */
386enum dma_residue_granularity {
387 DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0,
388 DMA_RESIDUE_GRANULARITY_SEGMENT = 1,
389 DMA_RESIDUE_GRANULARITY_BURST = 2,
390};
391
367/* struct dma_slave_caps - expose capabilities of a slave channel only 392/* struct dma_slave_caps - expose capabilities of a slave channel only
368 * 393 *
369 * @src_addr_widths: bit mask of src addr widths the channel supports 394 * @src_addr_widths: bit mask of src addr widths the channel supports
@@ -374,6 +399,7 @@ struct dma_slave_config {
374 * should be checked by controller as well 399 * should be checked by controller as well
375 * @cmd_pause: true, if pause and thereby resume is supported 400 * @cmd_pause: true, if pause and thereby resume is supported
376 * @cmd_terminate: true, if terminate cmd is supported 401 * @cmd_terminate: true, if terminate cmd is supported
402 * @residue_granularity: granularity of the reported transfer residue
377 */ 403 */
378struct dma_slave_caps { 404struct dma_slave_caps {
379 u32 src_addr_widths; 405 u32 src_addr_widths;
@@ -381,6 +407,7 @@ struct dma_slave_caps {
381 u32 directions; 407 u32 directions;
382 bool cmd_pause; 408 bool cmd_pause;
383 bool cmd_terminate; 409 bool cmd_terminate;
410 enum dma_residue_granularity residue_granularity;
384}; 411};
385 412
386static inline const char *dma_chan_name(struct dma_chan *chan) 413static inline const char *dma_chan_name(struct dma_chan *chan)