From d2d9fbfd732f49999a2a94f2479934488fe3ea9d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 17 Apr 2008 21:38:53 -0300 Subject: [PATCH] V4L/DVB (7600): em28xx: Sets frequency when changing to analog mode This will make tuner-xc2028 to change to analog, if needed. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-video.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 362251838d..72a7633b64 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -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; } -- 2.39.5