]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/ivtv/ivtv-driver.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6-omap-h63xx.git] / drivers / media / video / ivtv / ivtv-driver.c
index 4afc7ea07e86ec16866862c4c4e118367dd8116a..d36485023b68a91b9244af8776c38f028474aaa5 100644 (file)
 #include "tuner-xc2028.h"
 
 /* var to keep track of the number of array elements in use */
-int ivtv_cards_active = 0;
+int ivtv_cards_active;
 
 /* If you have already X v4l cards, then set this to X. This way
    the device numbers stay matched. Example: you have a WinTV card
    without radio and a PVR-350 with. Normally this would give a
    video1 device together with a radio0 device for the PVR. By
    setting this to 1 you ensure that radio0 is now also radio1. */
-int ivtv_first_minor = 0;
+int ivtv_first_minor;
 
 /* Master variable for all ivtv info */
 struct ivtv *ivtv_cards[IVTV_MAX_CARDS];
@@ -251,7 +251,7 @@ MODULE_PARM_DESC(newi2c,
                 "\t\t\t-1 is autodetect, 0 is off, 1 is on\n"
                 "\t\t\tDefault is autodetect");
 
-MODULE_PARM_DESC(ivtv_first_minor, "Set minor assigned to first card");
+MODULE_PARM_DESC(ivtv_first_minor, "Set kernel number assigned to first card");
 
 MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil");
 MODULE_DESCRIPTION("CX23415/CX23416 driver");
@@ -655,9 +655,9 @@ done:
 
        if (itv->card == NULL) {
                itv->card = ivtv_get_card(IVTV_CARD_PVR_150);
-               IVTV_ERR("Unknown card: vendor/device: %04x/%04x\n",
+               IVTV_ERR("Unknown card: vendor/device: [%04x:%04x]\n",
                     itv->dev->vendor, itv->dev->device);
-               IVTV_ERR("              subsystem vendor/device: %04x/%04x\n",
+               IVTV_ERR("              subsystem vendor/device: [%04x:%04x]\n",
                     itv->dev->subsystem_vendor, itv->dev->subsystem_device);
                IVTV_ERR("              %s based\n", chipname);
                IVTV_ERR("Defaulting to %s card\n", itv->card->name);
@@ -720,7 +720,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
        itv->speed = 1000;
 
        /* VBI */
-       itv->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
+       itv->vbi.in.type = V4L2_BUF_TYPE_VBI_CAPTURE;
        itv->vbi.sliced_in = &itv->vbi.in.fmt.sliced;
 
        /* Init the sg table for osd/yuv output */
@@ -1211,6 +1211,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
 
        if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
                ivtv_call_i2c_clients(itv, VIDIOC_INT_S_STD_OUTPUT, &itv->std);
+               /* Turn off the output signal. The mpeg decoder is not yet
+                  active so without this you would get a green image until the
+                  mpeg decoder becomes active. */
+               ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
        }
 
        /* clear interrupt mask, effectively disabling interrupts */
@@ -1330,6 +1334,10 @@ int ivtv_init_on_first_open(struct ivtv *itv)
        ivtv_s_frequency(NULL, &fh, &vf);
 
        if (itv->card->v4l2_capabilities & V4L2_CAP_VIDEO_OUTPUT) {
+               /* Turn on the TV-out: ivtv_init_mpeg_decoder() initializes
+                  the mpeg decoder so now the saa7127 receives a proper
+                  signal. */
+               ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
                ivtv_init_mpeg_decoder(itv);
        }
        ivtv_s_std(NULL, &fh, &itv->tuner_std);
@@ -1366,6 +1374,10 @@ static void ivtv_remove(struct pci_dev *pci_dev)
 
                /* Stop all decoding */
                IVTV_DEBUG_INFO("Stopping decoding\n");
+
+               /* Turn off the TV-out */
+               if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)
+                       ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
                if (atomic_read(&itv->decoding) > 0) {
                        int type;