diff options
Diffstat (limited to 'drivers/media/common/tuners/tda827x.c')
-rw-r--r-- | drivers/media/common/tuners/tda827x.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/common/tuners/tda827x.c b/drivers/media/common/tuners/tda827x.c index e0d5b43772b8..a0d176267470 100644 --- a/drivers/media/common/tuners/tda827x.c +++ b/drivers/media/common/tuners/tda827x.c | |||
@@ -152,9 +152,9 @@ static int tuner_transfer(struct dvb_frontend *fe, | |||
152 | return rc; | 152 | return rc; |
153 | } | 153 | } |
154 | 154 | ||
155 | static int tda827xo_set_params(struct dvb_frontend *fe, | 155 | static int tda827xo_set_params(struct dvb_frontend *fe) |
156 | struct dvb_frontend_parameters *params) | ||
157 | { | 156 | { |
157 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
158 | struct tda827x_priv *priv = fe->tuner_priv; | 158 | struct tda827x_priv *priv = fe->tuner_priv; |
159 | u8 buf[14]; | 159 | u8 buf[14]; |
160 | int rc; | 160 | int rc; |
@@ -165,18 +165,16 @@ static int tda827xo_set_params(struct dvb_frontend *fe, | |||
165 | u32 N; | 165 | u32 N; |
166 | 166 | ||
167 | dprintk("%s:\n", __func__); | 167 | dprintk("%s:\n", __func__); |
168 | switch (params->u.ofdm.bandwidth) { | 168 | if (c->bandwidth_hz == 0) { |
169 | case BANDWIDTH_6_MHZ: | 169 | if_freq = 5000000; |
170 | } else if (c->bandwidth_hz <= 6000000) { | ||
170 | if_freq = 4000000; | 171 | if_freq = 4000000; |
171 | break; | 172 | } else if (c->bandwidth_hz <= 7000000) { |
172 | case BANDWIDTH_7_MHZ: | ||
173 | if_freq = 4500000; | 173 | if_freq = 4500000; |
174 | break; | 174 | } else { /* 8 MHz */ |
175 | default: /* 8 MHz or Auto */ | ||
176 | if_freq = 5000000; | 175 | if_freq = 5000000; |
177 | break; | ||
178 | } | 176 | } |
179 | tuner_freq = params->frequency; | 177 | tuner_freq = c->frequency; |
180 | 178 | ||
181 | i = 0; | 179 | i = 0; |
182 | while (tda827x_table[i].lomax < tuner_freq) { | 180 | while (tda827x_table[i].lomax < tuner_freq) { |
@@ -220,8 +218,8 @@ static int tda827xo_set_params(struct dvb_frontend *fe, | |||
220 | if (rc < 0) | 218 | if (rc < 0) |
221 | goto err; | 219 | goto err; |
222 | 220 | ||
223 | priv->frequency = params->frequency; | 221 | priv->frequency = c->frequency; |
224 | priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0; | 222 | priv->bandwidth = c->bandwidth_hz; |
225 | 223 | ||
226 | return 0; | 224 | return 0; |
227 | 225 | ||
@@ -513,9 +511,9 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high, | |||
513 | } | 511 | } |
514 | } | 512 | } |
515 | 513 | ||
516 | static int tda827xa_set_params(struct dvb_frontend *fe, | 514 | static int tda827xa_set_params(struct dvb_frontend *fe) |
517 | struct dvb_frontend_parameters *params) | ||
518 | { | 515 | { |
516 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
519 | struct tda827x_priv *priv = fe->tuner_priv; | 517 | struct tda827x_priv *priv = fe->tuner_priv; |
520 | struct tda827xa_data *frequency_map = tda827xa_dvbt; | 518 | struct tda827xa_data *frequency_map = tda827xa_dvbt; |
521 | u8 buf[11]; | 519 | u8 buf[11]; |
@@ -531,22 +529,25 @@ static int tda827xa_set_params(struct dvb_frontend *fe, | |||
531 | tda827xa_lna_gain(fe, 1, NULL); | 529 | tda827xa_lna_gain(fe, 1, NULL); |
532 | msleep(20); | 530 | msleep(20); |
533 | 531 | ||
534 | switch (params->u.ofdm.bandwidth) { | 532 | if (c->bandwidth_hz == 0) { |
535 | case BANDWIDTH_6_MHZ: | 533 | if_freq = 5000000; |
534 | } else if (c->bandwidth_hz <= 6000000) { | ||
536 | if_freq = 4000000; | 535 | if_freq = 4000000; |
537 | break; | 536 | } else if (c->bandwidth_hz <= 7000000) { |
538 | case BANDWIDTH_7_MHZ: | ||
539 | if_freq = 4500000; | 537 | if_freq = 4500000; |
540 | break; | 538 | } else { /* 8 MHz */ |
541 | default: /* 8 MHz or Auto */ | ||
542 | if_freq = 5000000; | 539 | if_freq = 5000000; |
543 | break; | ||
544 | } | 540 | } |
545 | tuner_freq = params->frequency; | 541 | tuner_freq = c->frequency; |
546 | 542 | ||
547 | if (fe->ops.info.type == FE_QAM) { | 543 | switch (c->delivery_system) { |
544 | case SYS_DVBC_ANNEX_A: | ||
545 | case SYS_DVBC_ANNEX_C: | ||
548 | dprintk("%s select tda827xa_dvbc\n", __func__); | 546 | dprintk("%s select tda827xa_dvbc\n", __func__); |
549 | frequency_map = tda827xa_dvbc; | 547 | frequency_map = tda827xa_dvbc; |
548 | break; | ||
549 | default: | ||
550 | break; | ||
550 | } | 551 | } |
551 | 552 | ||
552 | i = 0; | 553 | i = 0; |
@@ -645,9 +646,8 @@ static int tda827xa_set_params(struct dvb_frontend *fe, | |||
645 | if (rc < 0) | 646 | if (rc < 0) |
646 | goto err; | 647 | goto err; |
647 | 648 | ||
648 | priv->frequency = params->frequency; | 649 | priv->frequency = c->frequency; |
649 | priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0; | 650 | priv->bandwidth = c->bandwidth_hz; |
650 | |||
651 | 651 | ||
652 | return 0; | 652 | return 0; |
653 | 653 | ||