[linux-dvb] Avermedia 777 DVB-T
Jose Alberto Reguero
jareguero at telefonica.net
Sun Jan 15 21:22:17 CET 2006
El Domingo, 15 de Enero de 2006 20:29, Ole Reinartz escribió:
> Jose Alberto Reguero schrieb:
> >The adress was 0xf. (I forgot to cc to the list)
>
> Thanks ...
>
> >With this definition composite svideo and audio works.
> >
> > [SAA7134_BOARD_AVERMEDIA_777] = {
> > .name = "AverTV DVB-T 777",
> > .audio_clock = 0x00187de7,
> > .tuner_type = TUNER_PHILIPS_TD1316,
> > .radio_type = UNSET,
> > .tuner_addr = ADDR_UNSET,
> > .radio_addr = ADDR_UNSET,
> > .tda9887_conf = TDA9887_PRESENT,
> > .mpeg = SAA7134_MPEG_DVB,
> > .inputs = {{
> > .name = name_comp1,
> > .vmux = 0,
> > .amux = LINE1,
> > },{
> > .name = name_svideo,
> > .vmux = 8,
> > .amux = LINE1,
> > }},
> > },
>
> Seems like I got a signal through composite at vmux=1. In my case that
> one is associated with name_comp2, and I get a picture with XawTV with
> input set to 'Composite 2'.
> Currently I'm trying to match the current mt352 register file with what
> you sent, and then changing the driver accordingly. How far have you got?
>
> Ole
I try with the below code without succes.
I don't know how to switch to digital mode.
Perhaps that is the problem.
Jose Alberto
static int mt352_aver777_init(struct dvb_frontend* fe)
{
static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x2d };
static u8 reset [] = { RESET, 0x80 };
static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 };
static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 };
struct saa7134_dev *dev= fe->dvb->priv;
printk("%s: %s called\n",dev->name,__FUNCTION__);
mt352_write(fe, clock_config, sizeof(clock_config));
udelay(200);
mt352_write(fe, reset, sizeof(reset));
mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
mt352_write(fe, agc_cfg, sizeof(agc_cfg));
mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
return 0;
}
static struct mt352_config avermedia_777 = {
.demod_address = 0xf,
// .if2 = 36163,
.demod_init = mt352_aver777_init,
.pll_set = mt352_aver777_pll_set,
};
(you can uncoment if2 line but I think is not necesary)
static int mt352_aver777_pll_set(struct dvb_frontend *fe, struct
dvb_frontend_parameters *params, u8* pllbuf)
{
int tuner_frequency = 0;
u8 band, cp, filter;
/* determine charge pump */
tuner_frequency = params->frequency + 36166000;
if (tuner_frequency < 87000000)
return -EINVAL;
else if (tuner_frequency < 130000000)
cp = 3;
else if (tuner_frequency < 160000000)
cp = 5;
else if (tuner_frequency < 200000000)
cp = 6;
else if (tuner_frequency < 290000000)
cp = 3;
else if (tuner_frequency < 420000000)
cp = 5;
else if (tuner_frequency < 480000000)
cp = 6;
else if (tuner_frequency < 620000000)
cp = 3;
else if (tuner_frequency < 830000000)
cp = 5;
else if (tuner_frequency < 895000000)
cp = 7;
else
return -EINVAL;
/* determine band */
if (params->frequency < 49000000)
return -EINVAL;
else if (params->frequency < 161000000)
band = 1;
else if (params->frequency < 444000000)
band = 2;
else if (params->frequency < 861000000)
band = 4;
else
return -EINVAL;
/* setup PLL filter */
switch (params->u.ofdm.bandwidth) {
case BANDWIDTH_6_MHZ:
filter = 0;
break;
case BANDWIDTH_7_MHZ:
filter = 0;
break;
case BANDWIDTH_8_MHZ:
filter = 1;
break;
default:
return -EINVAL;
}
/* calculate divisor
* ((36166000+((1000000/6)/2)) + Finput)/(1000000/6)
*/
tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000;
/* setup tuner buffer */
pllbuf[0] = 0xc2;
pllbuf[1] = (tuner_frequency >> 8) & 0x7f;
pllbuf[2] = tuner_frequency & 0xff;
pllbuf[3] = 0x82;
pllbuf[4] = (cp << 5) | (filter << 3) | band;
msleep(1);
return 0;
}
More information about the linux-dvb
mailing list