summaryrefslogtreecommitdiff
path: root/drivers/media/pci/tw686x/tw686x-regs.h
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@vanguardiasur.com.ar>2016-06-05 02:47:15 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-06-28 13:47:40 +0300
commitf8afaa8dbc0dcc2995df015ba18164e7c91201fc (patch)
tree0d7daba36f628e62caf1f69f7b278548777d272c /drivers/media/pci/tw686x/tw686x-regs.h
parent068adc457f2a795b871429464dbec15388c6dc57 (diff)
downloadlinux-f8afaa8dbc0dcc2995df015ba18164e7c91201fc.tar.xz
[media] tw686x: Introduce an interface to support multiple DMA modes
Let's set the corner stone to support all the DMA modes available on this device. For stability reasons, the driver is currently setting DMA frame mode, and using single DMA buffers to get the P and B buffers. Each frame is then memcpy'ed into the user buffer. However, other platforms might be interested in avoiding this memcpy, or in taking advantage of the chip's DMA scatter-gather capabilities. To achieve this, this commit introduces a "dma_mode" module parameter, and a tw686x_dma_ops struct. This will allow to define functions to alloc/free DMA buffers, and to return the frames to userspace. The memcpy-based method described above is named as dma_mode="memcpy". Current alloc/free functions are renamed as tw686x_memcpy_xxx, and are now used through a memcpy_dma_ops. 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-regs.h')
-rw-r--r--drivers/media/pci/tw686x/tw686x-regs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/pci/tw686x/tw686x-regs.h b/drivers/media/pci/tw686x/tw686x-regs.h
index fcef586a4c8c..37c39bcd7572 100644
--- a/drivers/media/pci/tw686x/tw686x-regs.h
+++ b/drivers/media/pci/tw686x/tw686x-regs.h
@@ -119,4 +119,9 @@
#define TW686X_STD_PAL_CN 5
#define TW686X_STD_PAL_60 6
+#define TW686X_FIELD_MODE 0x3
+#define TW686X_FRAME_MODE 0x2
+/* 0x1 is reserved */
+#define TW686X_SG_MODE 0x0
+
#define TW686X_FIFO_ERROR(x) (x & ~(0xff))