diff options
author | Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> | 2016-06-05 01:47:17 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-06-28 12:50:09 +0200 |
commit | 34e2acc8df13919d5a1aef450c6905b6329fa5b9 (patch) | |
tree | eedcdb834b1e066ea6b4677c2a6607e20880b56b /drivers/media/pci/tw686x/tw686x.h | |
parent | [media] tw686x: Add support for DMA contiguous interlaced frame mode (diff) | |
download | linux-34e2acc8df13919d5a1aef450c6905b6329fa5b9.tar.xz linux-34e2acc8df13919d5a1aef450c6905b6329fa5b9.zip |
[media] tw686x: Add support for DMA scatter-gather mode
Now that the driver has the infrastructure to support more
DMA modes, let's add the DMA scatter-gather mode.
In this mode, the device delivers sequential top-bottom
frames. The scatter-gather logic is based on staging's
tw686x-kh driver (by Krzysztof Ha?asa).
Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/tw686x/tw686x.h')
-rw-r--r-- | drivers/media/pci/tw686x/tw686x.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/pci/tw686x/tw686x.h b/drivers/media/pci/tw686x/tw686x.h index 5f4c2131ddac..25e3c84331aa 100644 --- a/drivers/media/pci/tw686x/tw686x.h +++ b/drivers/media/pci/tw686x/tw686x.h @@ -34,6 +34,7 @@ #define TW686X_DMA_MODE_MEMCPY 0 #define TW686X_DMA_MODE_CONTIG 1 +#define TW686X_DMA_MODE_SG 2 struct tw686x_format { char *name; @@ -48,6 +49,12 @@ struct tw686x_dma_desc { unsigned int size; }; +struct tw686x_sg_desc { + /* 3 MSBits for flags, 13 LSBits for length */ + __le32 flags_length; + __le32 phys; +}; + struct tw686x_audio_buf { dma_addr_t dma; void *virt; @@ -80,6 +87,7 @@ struct tw686x_video_channel { struct video_device *device; struct tw686x_v4l2_buf *curr_bufs[2]; struct tw686x_dma_desc dma_descs[2]; + struct tw686x_sg_desc *sg_descs[2]; struct v4l2_ctrl_handler ctrl_handler; const struct tw686x_format *format; @@ -154,6 +162,12 @@ static inline unsigned int max_channels(struct tw686x_dev *dev) return dev->type & TYPE_MAX_CHANNELS; /* 4 or 8 channels */ } +static inline unsigned is_second_gen(struct tw686x_dev *dev) +{ + /* each channel has its own DMA SG table */ + return dev->type & TYPE_SECOND_GEN; +} + void tw686x_enable_channel(struct tw686x_dev *dev, unsigned int channel); void tw686x_disable_channel(struct tw686x_dev *dev, unsigned int channel); |