summaryrefslogtreecommitdiff
path: root/drivers/media/video/bt8xx/bttv-cards.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 21:32:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:42:47 -0300
commit5221e21e5ecd3aebd2e8e3234bd18883ce720945 (patch)
tree28ba523ee7bf7ac90f892958e3fdf6e50dbc5c94 /drivers/media/video/bt8xx/bttv-cards.c
parent4c548d4b28c0c65938914b2790fd2ca2e9c61d63 (diff)
V4L/DVB (10562): bttv: rework the way digital inputs are indicated
The code was using a muxsel value of -1U to indicate a digital input. A couple places in were checking of muxsel < 0 to detect this, which doesn't work of course because muxsel is unsigned and can't be negative. Only a couple cards had digital inputs and it was always the last one, so for the card database create a one bit field that indicates the last input is digital. On init, this is used to set a new field in the bttv struct to the digital input's number or UNSET for none. This makes it easier to check if the current input is digital. 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-cards.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index f49e6e686628..d545d48fac58 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -633,8 +633,9 @@ struct tvcard bttv_tvcards[] = {
.video_inputs = 3,
/* .audio_inputs= 1, */
.svhs = NO_SVHS,
+ .has_dig_in = 1,
.gpiomask = 7,
- .muxsel = { 2, 3, -1 },
+ .muxsel = { 2, 3, 0 }, /* input 2 is digital */
/* .digital_mode= DIGITAL_MODE_CAMERA, */
.gpiomux = { 0, 0, 0, 0 },
.no_msp34xx = 1,
@@ -1069,8 +1070,9 @@ struct tvcard bttv_tvcards[] = {
.video_inputs = 5,
/* .audio_inputs= 1, */
.svhs = 3,
+ .has_dig_in = 1,
.gpiomask = 0xAA0000,
- .muxsel = { 2, 3, 1, 1, -1 },
+ .muxsel = { 2, 3, 1, 1, 0 }, /* input 4 is digital */
/* .digital_mode= DIGITAL_MODE_CAMERA, */
.gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
.gpiomute = 0xa8000,
@@ -2539,8 +2541,9 @@ struct tvcard bttv_tvcards[] = {
.video_inputs = 5,
/* .audio_inputs= 1, */
.svhs = 3,
+ .has_dig_in = 1,
.gpiomask = 0x01fe00,
- .muxsel = { 2, 3, 1, 1, -1 },
+ .muxsel = { 2, 3, 1, 1, 0 }, /* in 4 is digital */
/* .digital_mode= DIGITAL_MODE_CAMERA, */
.gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
.gpiomute = 0x12400,
@@ -3417,6 +3420,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg);
}
+ btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
+ bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
UNSET : bttv_tvcards[btv->c.type].svhs;
if (svhs[btv->c.nr] != UNSET)