]> Pileus Git - ~andy/linux/commit
dma: Indicate residue granularity in dma_slave_caps
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 11 Jan 2014 13:02:16 +0000 (14:02 +0100)
committerMark Brown <broonie@linaro.org>
Tue, 14 Jan 2014 21:28:39 +0000 (21:28 +0000)
commit507205632dd12636cfe4af4322dace263dca0c21
treeed4b2e7f36ed073bfe6ccbd1d8e98fedba4c8039
parent8e6714ac6081dc400828c01a8cc78bbd3b2b687a
dma: Indicate residue granularity in dma_slave_caps

This patch adds a new field to the dma_slave_caps struct which indicates the
granularity with which the driver is able to update the residue field of the
dma_tx_state struct. Making this information available to dmaengine users allows
them to make better decisions on how to operate. E.g. for audio certain features
like wakeup less operation or timer based scheduling only make sense and work
correctly if the reported residue is fine-grained enough.

Right now four different levels of granularity are supported:
* DESCRIPTOR: The DMA channel is only able to tell whether a descriptor has
  been completed or not, which means residue reporting is not supported by
  this channel. The residue field of the dma_tx_state field will always be
  0.
* SEGMENT: The DMA channel updates the residue field after each successfully
  completed segment of the transfer (For cyclic transfers this is after each
  period). This is typically implemented by having the hardware generate an
  interrupt after each transferred segment and then the drivers updates the
  outstanding residue by the size of the segment. Another possibility is if
  the hardware supports SG and the segment descriptor has a field which gets
  set after the segment has been completed. The driver then counts the
  number of segments without the flag set to compute the residue.
* BURST: The DMA channel updates the residue field after each transferred
  burst. This is typically only supported if the hardware has a progress
  register of some sort (E.g. a register with the current read/write address
  or a register with the amount of bursts/beats/bytes that have been
  transferred or still need to be transferred).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/linux/dmaengine.h