Skip to content

Commit

Permalink
[media] bttv: Use btv->has_radio rather then the card info when regis…
Browse files Browse the repository at this point in the history
…tering the tuner

bttv_init_card2() sets btv->has_audio to a *default* value from the tvcards
array and then may update it by reading a card specific eeprom or gpio
detection.

After bttv_init_card2(), bttv_init_tuner() gets called, and it should clearly
use the updated, dynamic has_radio value from btv->has_radio, rather then
the const value in the tvcards array.

This fixes the radio not working on my Hauppauge WinTV.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jun 11, 2012
1 parent 40e006a commit 5c16464
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/video/bt8xx/bttv-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -3649,7 +3649,7 @@ void __devinit bttv_init_tuner(struct bttv *btv)
struct tuner_setup tun_setup;

/* Load tuner module before issuing tuner config call! */
if (bttv_tvcards[btv->c.type].has_radio)
if (btv->has_radio)
v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
&btv->c.i2c_adap, "tuner",
0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
Expand All @@ -3664,7 +3664,7 @@ void __devinit bttv_init_tuner(struct bttv *btv)
tun_setup.type = btv->tuner_type;
tun_setup.addr = addr;

if (bttv_tvcards[btv->c.type].has_radio)
if (btv->has_radio)
tun_setup.mode_mask |= T_RADIO;

bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
Expand Down

0 comments on commit 5c16464

Please sign in to comment.