Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285457
b: refs/heads/master
c: 82c0126
h: refs/heads/master
i:
  285455: 86620fc
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent aabd114 commit 3902a7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f1791618a0d0e3c809706df4d4758a828b3ba5f
refs/heads/master: 82c0126ff2e3278ecf1d6c7d0bf71838e189dbdc
25 changes: 14 additions & 11 deletions trunk/drivers/media/common/tuners/mt2266.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static u8 mt2266_vhf[] = { 0x1d, 0xfe, 0x00, 0x00, 0xb4, 0x03, 0xa5, 0xa5,

static int mt2266_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct mt2266_priv *priv;
int ret=0;
u32 freq;
Expand All @@ -135,30 +136,32 @@ static int mt2266_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame

priv = fe->tuner_priv;

freq = params->frequency / 1000; // Hz -> kHz
freq = priv->frequency / 1000; /* Hz -> kHz */
if (freq < 470000 && freq > 230000)
return -EINVAL; /* Gap between VHF and UHF bands */
priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
priv->frequency = freq * 1000;

priv->frequency = c->frequency;
tune = 2 * freq * (8192/16) / (FREF/16);
band = (freq < 300000) ? MT2266_VHF : MT2266_UHF;
if (band == MT2266_VHF)
tune *= 2;

switch (params->u.ofdm.bandwidth) {
case BANDWIDTH_6_MHZ:
switch (c->bandwidth_hz) {
case 6000000:
mt2266_writeregs(priv, mt2266_init_6mhz,
sizeof(mt2266_init_6mhz));
priv->bandwidth = BANDWIDTH_6_MHZ;
break;
case BANDWIDTH_7_MHZ:
mt2266_writeregs(priv, mt2266_init_7mhz,
sizeof(mt2266_init_7mhz));
break;
case BANDWIDTH_8_MHZ:
default:
case 8000000:
mt2266_writeregs(priv, mt2266_init_8mhz,
sizeof(mt2266_init_8mhz));
priv->bandwidth = BANDWIDTH_8_MHZ;
break;
case 7000000:
default:
mt2266_writeregs(priv, mt2266_init_7mhz,
sizeof(mt2266_init_7mhz));
priv->bandwidth = BANDWIDTH_7_MHZ;
break;
}

Expand Down

0 comments on commit 3902a7a

Please sign in to comment.