V4L/DVB (4792): Add support for the Compro Videomate DVB-T200A

This board has the same PCI ID as the T200, so the exact board type
is determined from the eeprom.
The original patch was provided by Francis Barber <fedora@barber-family.id.au>

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Hartmut Hackmann 2006-10-30 20:00:16 -03:00 committed by Mauro Carvalho Chehab
parent a75ec3f033
commit cbb94521cf
4 changed files with 78 additions and 13 deletions

View File

@ -101,3 +101,4 @@
100 -> Asus Europa2 OEM [1043:4860] 100 -> Asus Europa2 OEM [1043:4860]
101 -> Pinnacle PCTV 310i [11bd:002f] 101 -> Pinnacle PCTV 310i [11bd:002f]
102 -> Avermedia AVerTV Studio 507 [1461:9715] 102 -> Avermedia AVerTV Studio 507 [1461:9715]
103 -> Compro Videomate DVB-T200A

View File

@ -3101,6 +3101,31 @@ struct saa7134_board saa7134_boards[] = {
.gpio = 0x00, .gpio = 0x00,
}, },
}, },
[SAA7134_BOARD_VIDEOMATE_DVBT_200A] = {
/* Francis Barber <fedora@barber-family.id.au> */
.name = "Compro Videomate DVB-T200A",
.audio_clock = 0x00187de7,
.tuner_type = TUNER_ABSENT,
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
.mpeg = SAA7134_MPEG_DVB,
.inputs = {{
.name = name_tv,
.vmux = 3,
.amux = TV,
.tv = 1,
},{
.name = name_comp1,
.vmux = 1,
.amux = LINE2,
},{
.name = name_svideo,
.vmux = 8,
.amux = LINE2,
}},
},
}; };
const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@ -3823,6 +3848,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII: case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII:
case SAA7134_BOARD_VIDEOMATE_DVBT_300: case SAA7134_BOARD_VIDEOMATE_DVBT_300:
case SAA7134_BOARD_VIDEOMATE_DVBT_200: case SAA7134_BOARD_VIDEOMATE_DVBT_200:
case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
case SAA7134_BOARD_MANLI_MTV001: case SAA7134_BOARD_MANLI_MTV001:
case SAA7134_BOARD_MANLI_MTV002: case SAA7134_BOARD_MANLI_MTV002:
case SAA7134_BOARD_BEHOLD_409FM: case SAA7134_BOARD_BEHOLD_409FM:
@ -4064,6 +4090,29 @@ int saa7134_board_init2(struct saa7134_dev *dev)
dev->name, i); dev->name, i);
} }
break; break;
case SAA7134_BOARD_VIDEOMATE_DVBT_200:
case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
/* The T200 and the T200A share the same pci id. Consequently,
* we are going to query eeprom to try to find out which one we
* are actually looking at. */
/* Don't do this if the board was specifically selected with an
* insmod option or if we have the default configuration T200*/
if(!dev->autodetected || (dev->eedata[0x41] == 0xd0))
break;
if(dev->eedata[0x41] == 0x02) {
/* Reconfigure board as T200A */
dev->board = SAA7134_BOARD_VIDEOMATE_DVBT_200A;
dev->tuner_type = saa7134_boards[dev->board].tuner_type;
dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
printk(KERN_INFO "%s: Reconfigured board as %s\n",
dev->name, saa7134_boards[dev->board].name);
} else {
printk(KERN_WARNING "%s: Unexpected tuner type info: %x in eeprom\n",
dev->name, dev->eedata[0x41]);
break;
}
break;
} }
return 0; return 0;
} }

View File

@ -336,7 +336,7 @@ static struct tda1004x_config philips_tu1216_61_config = {
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
static int philips_europa_tuner_init(struct dvb_frontend *fe) static int philips_td1316_tuner_init(struct dvb_frontend *fe)
{ {
struct saa7134_dev *dev = fe->dvb->priv; struct saa7134_dev *dev = fe->dvb->priv;
static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab };
@ -347,18 +347,8 @@ static int philips_europa_tuner_init(struct dvb_frontend *fe)
fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
return -EIO; return -EIO;
msleep(1);
/* switch the board to dvb mode */
init_msg.addr = 0x43;
init_msg.len = 0x02;
msg[0] = 0x00;
msg[1] = 0x40;
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.i2c_gate_ctrl(fe, 0);
if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
return -EIO;
return 0; return 0;
} }
@ -367,6 +357,22 @@ static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
return philips_tda6651_pll_set(0x61, fe, params); return philips_tda6651_pll_set(0x61, fe, params);
} }
static int philips_europa_tuner_init(struct dvb_frontend *fe)
{
struct saa7134_dev *dev = fe->dvb->priv;
static u8 msg[] = { 0x00, 0x40};
struct i2c_msg init_msg = {.addr = 0x43,.flags = 0,.buf = msg,.len = sizeof(msg) };
if (philips_td1316_tuner_init(fe))
return -EIO;
msleep(1);
if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
return -EIO;
return 0;
}
static int philips_europa_tuner_sleep(struct dvb_frontend *fe) static int philips_europa_tuner_sleep(struct dvb_frontend *fe)
{ {
struct saa7134_dev *dev = fe->dvb->priv; struct saa7134_dev *dev = fe->dvb->priv;
@ -1324,7 +1330,15 @@ static int dvb_init(struct saa7134_dev *dev)
dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params; dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
} }
break; break;
case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
dev->dvb.frontend = dvb_attach(tda10046_attach,
&philips_europa_config,
&dev->i2c_adap);
if (dev->dvb.frontend) {
dev->dvb.frontend->ops.tuner_ops.init = philips_td1316_tuner_init;
dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
}
break;
default: default:
printk("%s: Huh? unknown DVB card?\n",dev->name); printk("%s: Huh? unknown DVB card?\n",dev->name);
break; break;

View File

@ -229,6 +229,7 @@ struct saa7134_format {
#define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100 #define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100
#define SAA7134_BOARD_PINNACLE_PCTV_310i 101 #define SAA7134_BOARD_PINNACLE_PCTV_310i 101
#define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102 #define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102
#define SAA7134_BOARD_VIDEOMATE_DVBT_200A 103
#define SAA7134_MAXBOARDS 8 #define SAA7134_MAXBOARDS 8
#define SAA7134_INPUT_MAX 8 #define SAA7134_INPUT_MAX 8