V4L/DVB (4202): allow selecting CX2341x port mode
authorHans Verkuil <hverkuil@xs4all.nl>
Wed, 21 Jun 2006 20:04:13 +0000 (17:04 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 25 Jun 2006 05:05:23 +0000 (02:05 -0300)
CX2341X port was always set to 'memory', but 'streaming' is also possible

ivtv uses the memory (DMA) interface with the CX2341X, while pvrusb2 and
cx88-blackbird use the streaming interface. This setting is now selectable
by the driver.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Documentation/video4linux/cx2341x/fw-encoder-api.txt
drivers/media/video/cx2341x.c
drivers/media/video/cx88/cx88-blackbird.c
include/media/cx2341x.h

index f74b0ae4a76926a9ad6c1e9b36f232f0271ff211..001c68644b081c7a4f5f620e31af85790acd4902 100644 (file)
@@ -270,11 +270,17 @@ Param[0]
 Name   CX2341X_ENC_SET_OUTPUT_PORT
 Enum   187/0xBB
 Description
-       Assign stream output port (not recommended you change setting from default)
+       Assign stream output port. Normally 0 when the data is copied through
+       the PCI bus (DMA), and 1 when the data is streamed to another chip
+       (pvrusb and cx88-blackbird).
 Param[0]
        0=Memory (default)
        1=Streaming
        2=Serial
+Param[1]
+       Unknown, but leaving this to 0 seems to work best. Indications are that
+       this might have to do with USB support, although passing anything but 0
+       onl breaks things.
 
 -------------------------------------------------------------------------------
 
index 7cd1c4cf5aec71af1154c813f4543ebcf379244e..554813e6f65d351975367bbbf9f1367c4488b1dd 100644 (file)
@@ -639,6 +639,7 @@ void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p)
 {
        static struct cx2341x_mpeg_params default_params = {
        /* misc */
+       .port = CX2341X_PORT_MEMORY,
        .width = 720,
        .height = 480,
        .is_50hz = 0,
@@ -714,7 +715,7 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func,
 
        int err = 0;
 
-       cx2341x_api(priv, func, CX2341X_ENC_SET_OUTPUT_PORT, 1, 0);     /* 0 = Memory */
+       cx2341x_api(priv, func, CX2341X_ENC_SET_OUTPUT_PORT, 2, new->port, 0);
 
        if (old == NULL || old->is_50hz != new->is_50hz) {
                err = cx2341x_api(priv, func, CX2341X_ENC_SET_FRAME_RATE, 1, new->is_50hz);
index 6e945de1f20ab543269a544667bdc800e29d19e8..26aac42ca8bd33c6e67421dc38eea2e45136f299 100644 (file)
@@ -1043,6 +1043,7 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev,
        dev->width = 720;
        dev->height = 576;
        cx2341x_fill_defaults(&dev->params);
+       dev->params.port = CX2341X_PORT_STREAMING;
 
        switch (core->board) {
        case CX88_BOARD_HAUPPAUGE_ROSLYN:
index 0c9292fa5f6de52a8a39ee3d2dcbc434875ac25f..fb170d4b5235e9b6c4fac4aa37ede212e5a79028 100644 (file)
 #ifndef CX2341X_H
 #define CX2341X_H
 
+enum cx2341x_port {
+       CX2341X_PORT_MEMORY,
+       CX2341X_PORT_STREAMING,
+       CX2341X_PORT_SERIAL
+};
+
 struct cx2341x_mpeg_params {
        /* misc */
+       enum cx2341x_port port;
        u16 width;
        u16 height;
        u16 is_50hz;