aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 19:32:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:46 -0400
commit72134a6d5199c3f5c8efe914e49072bde95948b3 (patch)
treeea12a61c3972a7accbf787b62445e7daf6e372dd /drivers/media/video/bt8xx/bttv-driver.c
parent4ef2ccc2611456667ea78c6f418ce87e1fa9fac5 (diff)
V4L/DVB (10559): bttv: Fix TDA9880 norm setting code
The code to set the norm for the TDA9880 analog demod was comparing btv->norm, an index into the bttv driver's norm array, to V4L2_STD_NTSC, which is a bit flag that's part of the V4L2 API. This doesn't work of course and results in the PAL path always being taken. What's more, it modified the bttv_tvcards[] entries for cards using the TDA9880. This is wrong because changing the norm on one card will also affect other cards of the same type. Writing to bttv_tvcards is also bad because it should be read-only or even devinitdata. Changing the norm would also cause the audio to become unmuted. Have the code get called for both norm setting and audio input setting (which where the gpios are set) to avoid needed to modify bttv_tvcards. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 4ec476a9c0e4..89e0cd191531 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1180,7 +1180,16 @@ audio_mux(struct bttv *btv, int input, int mute)
1180 else 1180 else
1181 gpio_val = bttv_tvcards[btv->c.type].gpiomux[input]; 1181 gpio_val = bttv_tvcards[btv->c.type].gpiomux[input];
1182 1182
1183 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val); 1183 switch (btv->c.type) {
1184 case BTTV_BOARD_VOODOOTV_FM:
1185 case BTTV_BOARD_VOODOOTV_200:
1186 gpio_val = bttv_tda9880_setnorm(btv, gpio_val);
1187 break;
1188
1189 default:
1190 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val);
1191 }
1192
1184 if (bttv_gpio) 1193 if (bttv_gpio)
1185 bttv_gpio_tracking(btv, audio_modes[mute ? 4 : input]); 1194 bttv_gpio_tracking(btv, audio_modes[mute ? 4 : input]);
1186 if (in_interrupt()) 1195 if (in_interrupt())
@@ -1319,7 +1328,7 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
1319 switch (btv->c.type) { 1328 switch (btv->c.type) {
1320 case BTTV_BOARD_VOODOOTV_FM: 1329 case BTTV_BOARD_VOODOOTV_FM:
1321 case BTTV_BOARD_VOODOOTV_200: 1330 case BTTV_BOARD_VOODOOTV_200:
1322 bttv_tda9880_setnorm(btv,norm); 1331 bttv_tda9880_setnorm(btv, gpio_read());
1323 break; 1332 break;
1324 } 1333 }
1325 id = tvnorm->v4l2_id; 1334 id = tvnorm->v4l2_id;