Skip to content

Commit

Permalink
[media] tda827x: improve recection with limit frequencies
Browse files Browse the repository at this point in the history
tda827x is currently taking the demod IF frequency into account while
seeking for the proper tuner range. This is wrong, as the demod IF
frequency has nothing to do with the tuner PLL.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jose Alberto Reguero authored and Mauro Carvalho Chehab committed Aug 7, 2011
1 parent d1520c5 commit 2d84ca2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/common/tuners/tda827x.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
if_freq = 5000000;
break;
}
tuner_freq = params->frequency + if_freq;
tuner_freq = params->frequency;

i = 0;
while (tda827x_table[i].lomax < tuner_freq) {
Expand All @@ -185,6 +185,8 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
i++;
}

tuner_freq += if_freq;

N = ((tuner_freq + 125000) / 250000) << (tda827x_table[i].spd + 2);
buf[0] = 0;
buf[1] = (N>>8) | 0x40;
Expand Down Expand Up @@ -540,7 +542,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
if_freq = 5000000;
break;
}
tuner_freq = params->frequency + if_freq;
tuner_freq = params->frequency;

if (fe->ops.info.type == FE_QAM) {
dprintk("%s select tda827xa_dvbc\n", __func__);
Expand All @@ -554,6 +556,8 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
i++;
}

tuner_freq += if_freq;

N = ((tuner_freq + 31250) / 62500) << frequency_map[i].spd;
buf[0] = 0; // subaddress
buf[1] = N >> 8;
Expand Down

0 comments on commit 2d84ca2

Please sign in to comment.