]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (7600): em28xx: Sets frequency when changing to analog mode
authorMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 18 Apr 2008 00:38:53 +0000 (21:38 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:09:41 +0000 (14:09 -0300)
This will make tuner-xc2028 to change to analog, if needed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/em28xx/em28xx-video.c

index 362251838d4b0f7f4a76f44fc139f9759f5f3162..72a7633b6452c36182468065a749133c52a09c19 100644 (file)
@@ -560,6 +560,8 @@ static int
 buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
 {
        struct em28xx_fh *fh = vq->priv_data;
+       struct em28xx        *dev = fh->dev;
+       struct v4l2_frequency f;
 
        *size = 16 * fh->dev->width * fh->dev->height >> 3;
        if (0 == *count)
@@ -568,6 +570,14 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
        if (*count < EM28XX_MIN_BUF)
                *count = EM28XX_MIN_BUF;
 
+       dev->mode = EM28XX_ANALOG_MODE;
+
+       /* Ask tuner to go to analog mode */
+       memset (&f, 0, sizeof(f));
+       f.frequency = dev->ctl_freq;
+
+       em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f);
+
        return 0;
 }