aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorJose Alberto Reguero <jareguero@telefonica.net>2011-07-16 07:38:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-07 08:32:16 -0400
commit2d84ca215f6d67f9ba7b3d4ab32265e085229662 (patch)
treee1124d71b3d53c164dc591d09cca86013587d810 /drivers/media/common
parentd1520c58eb84ad1ec973a257cd835c948215aab5 (diff)
[media] tda827x: improve recection with limit frequencies
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>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/tda827x.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/common/tuners/tda827x.c b/drivers/media/common/tuners/tda827x.c
index b21b6ea68b25..e0d5b43772b8 100644
--- a/drivers/media/common/tuners/tda827x.c
+++ b/drivers/media/common/tuners/tda827x.c
@@ -176,7 +176,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
176 if_freq = 5000000; 176 if_freq = 5000000;
177 break; 177 break;
178 } 178 }
179 tuner_freq = params->frequency + if_freq; 179 tuner_freq = params->frequency;
180 180
181 i = 0; 181 i = 0;
182 while (tda827x_table[i].lomax < tuner_freq) { 182 while (tda827x_table[i].lomax < tuner_freq) {
@@ -185,6 +185,8 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
185 i++; 185 i++;
186 } 186 }
187 187
188 tuner_freq += if_freq;
189
188 N = ((tuner_freq + 125000) / 250000) << (tda827x_table[i].spd + 2); 190 N = ((tuner_freq + 125000) / 250000) << (tda827x_table[i].spd + 2);
189 buf[0] = 0; 191 buf[0] = 0;
190 buf[1] = (N>>8) | 0x40; 192 buf[1] = (N>>8) | 0x40;
@@ -540,7 +542,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
540 if_freq = 5000000; 542 if_freq = 5000000;
541 break; 543 break;
542 } 544 }
543 tuner_freq = params->frequency + if_freq; 545 tuner_freq = params->frequency;
544 546
545 if (fe->ops.info.type == FE_QAM) { 547 if (fe->ops.info.type == FE_QAM) {
546 dprintk("%s select tda827xa_dvbc\n", __func__); 548 dprintk("%s select tda827xa_dvbc\n", __func__);
@@ -554,6 +556,8 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
554 i++; 556 i++;
555 } 557 }
556 558
559 tuner_freq += if_freq;
560
557 N = ((tuner_freq + 31250) / 62500) << frequency_map[i].spd; 561 N = ((tuner_freq + 31250) / 62500) << frequency_map[i].spd;
558 buf[0] = 0; // subaddress 562 buf[0] = 0; // subaddress
559 buf[1] = N >> 8; 563 buf[1] = N >> 8;