Commit 6acaba8e authored by Michael Hunold's avatar Michael Hunold Committed by Linus Torvalds

[PATCH] Restore tuning capabilities in V4L2 MXB driver

The behaviour of the all-in-one Video4Linux tuner driver apparently
changed.  It now wants to know the tv standard, otherwise it refuses to
tune.

Restore tuning functionality in my driver for the "Multimedia eXtension
Board".  The all-in-one tuner driver apparently changed its behaviour.
Signed-off-by: default avatarMichael Hunold <hunold@linuxtv.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3cb4f09f
/* /*
mxb - v4l2 driver for the Multimedia eXtension Board mxb - v4l2 driver for the Multimedia eXtension Board
Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de> Copyright (C) 1998-2006 Michael Hunold <michael@mihu.de>
Visit http://www.mihu.de/linux/saa7146/mxb/ Visit http://www.mihu.de/linux/saa7146/mxb/
for further details about this card. for further details about this card.
...@@ -327,6 +327,7 @@ static int mxb_init_done(struct saa7146_dev* dev) ...@@ -327,6 +327,7 @@ static int mxb_init_done(struct saa7146_dev* dev)
struct video_decoder_init init; struct video_decoder_init init;
struct i2c_msg msg; struct i2c_msg msg;
struct tuner_setup tun_setup; struct tuner_setup tun_setup;
v4l2_std_id std = V4L2_STD_PAL_BG;
int i = 0, err = 0; int i = 0, err = 0;
struct tea6415c_multiplex vm; struct tea6415c_multiplex vm;
...@@ -361,6 +362,9 @@ static int mxb_init_done(struct saa7146_dev* dev) ...@@ -361,6 +362,9 @@ static int mxb_init_done(struct saa7146_dev* dev)
mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY,
&mxb->cur_freq); &mxb->cur_freq);
/* set a default video standard */
mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
/* mute audio on tea6420s */ /* mute audio on tea6420s */
mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]);
mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]); mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]);
...@@ -921,17 +925,21 @@ static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) ...@@ -921,17 +925,21 @@ static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
int one = 1; int one = 1;
if(V4L2_STD_PAL_I == std->id ) { if(V4L2_STD_PAL_I == std->id ) {
v4l2_std_id std = V4L2_STD_PAL_I;
DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n"));
/* set the 7146 gpio register -- I don't know what this does exactly */ /* set the 7146 gpio register -- I don't know what this does exactly */
saa7146_write(dev, GPIO_CTRL, 0x00404050); saa7146_write(dev, GPIO_CTRL, 0x00404050);
/* unset the 7111 gpio register -- I don't know what this does exactly */ /* unset the 7111 gpio register -- I don't know what this does exactly */
mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero); mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero);
mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
} else { } else {
v4l2_std_id std = V4L2_STD_PAL_BG;
DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n"));
/* set the 7146 gpio register -- I don't know what this does exactly */ /* set the 7146 gpio register -- I don't know what this does exactly */
saa7146_write(dev, GPIO_CTRL, 0x00404050); saa7146_write(dev, GPIO_CTRL, 0x00404050);
/* set the 7111 gpio register -- I don't know what this does exactly */ /* set the 7111 gpio register -- I don't know what this does exactly */
mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one); mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one);
mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment