diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-21 08:21:21 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 05:39:31 -0500 |
commit | cba3f88a6f61fdb03183e98920457e770a9bf887 (patch) | |
tree | 3325b3e454584b4ab144c15c118fb41b0a978a87 /drivers/media | |
parent | 9481f4009c7bc95a03b5553e9174cfd2a0248d57 (diff) |
[media] dvb-bt8xx: use DVBv5 parameters on set_params()
Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 521d69104982..5948601ec809 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -193,11 +193,10 @@ static struct zl10353_config thomson_dtt7579_zl10353_config = { | |||
193 | 193 | ||
194 | static int cx24108_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) | 194 | static int cx24108_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) |
195 | { | 195 | { |
196 | u32 freq = params->frequency; | 196 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
197 | 197 | u32 freq = c->frequency; | |
198 | int i, a, n, pump; | 198 | int i, a, n, pump; |
199 | u32 band, pll; | 199 | u32 band, pll; |
200 | |||
201 | u32 osci[]={950000,1019000,1075000,1178000,1296000,1432000, | 200 | u32 osci[]={950000,1019000,1075000,1178000,1296000,1432000, |
202 | 1576000,1718000,1856000,2036000,2150000}; | 201 | 1576000,1718000,1856000,2036000,2150000}; |
203 | u32 bandsel[]={0,0x00020000,0x00040000,0x00100800,0x00101000, | 202 | u32 bandsel[]={0,0x00020000,0x00040000,0x00100800,0x00101000, |
@@ -269,29 +268,30 @@ static struct cx24110_config pctvsat_config = { | |||
269 | 268 | ||
270 | static int microtune_mt7202dtf_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) | 269 | static int microtune_mt7202dtf_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) |
271 | { | 270 | { |
271 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
272 | struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; | 272 | struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; |
273 | u8 cfg, cpump, band_select; | 273 | u8 cfg, cpump, band_select; |
274 | u8 data[4]; | 274 | u8 data[4]; |
275 | u32 div; | 275 | u32 div; |
276 | struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = sizeof(data) }; | 276 | struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = sizeof(data) }; |
277 | 277 | ||
278 | div = (36000000 + params->frequency + 83333) / 166666; | 278 | div = (36000000 + c->frequency + 83333) / 166666; |
279 | cfg = 0x88; | 279 | cfg = 0x88; |
280 | 280 | ||
281 | if (params->frequency < 175000000) | 281 | if (c->frequency < 175000000) |
282 | cpump = 2; | 282 | cpump = 2; |
283 | else if (params->frequency < 390000000) | 283 | else if (c->frequency < 390000000) |
284 | cpump = 1; | 284 | cpump = 1; |
285 | else if (params->frequency < 470000000) | 285 | else if (c->frequency < 470000000) |
286 | cpump = 2; | 286 | cpump = 2; |
287 | else if (params->frequency < 750000000) | 287 | else if (c->frequency < 750000000) |
288 | cpump = 2; | 288 | cpump = 2; |
289 | else | 289 | else |
290 | cpump = 3; | 290 | cpump = 3; |
291 | 291 | ||
292 | if (params->frequency < 175000000) | 292 | if (c->frequency < 175000000) |
293 | band_select = 0x0e; | 293 | band_select = 0x0e; |
294 | else if (params->frequency < 470000000) | 294 | else if (c->frequency < 470000000) |
295 | band_select = 0x05; | 295 | band_select = 0x05; |
296 | else | 296 | else |
297 | band_select = 0x03; | 297 | band_select = 0x03; |
@@ -463,23 +463,24 @@ static struct or51211_config or51211_config = { | |||
463 | 463 | ||
464 | static int vp3021_alps_tded4_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) | 464 | static int vp3021_alps_tded4_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) |
465 | { | 465 | { |
466 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
466 | struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; | 467 | struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; |
467 | u8 buf[4]; | 468 | u8 buf[4]; |
468 | u32 div; | 469 | u32 div; |
469 | struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf) }; | 470 | struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf) }; |
470 | 471 | ||
471 | div = (params->frequency + 36166667) / 166667; | 472 | div = (c->frequency + 36166667) / 166667; |
472 | 473 | ||
473 | buf[0] = (div >> 8) & 0x7F; | 474 | buf[0] = (div >> 8) & 0x7F; |
474 | buf[1] = div & 0xFF; | 475 | buf[1] = div & 0xFF; |
475 | buf[2] = 0x85; | 476 | buf[2] = 0x85; |
476 | if ((params->frequency >= 47000000) && (params->frequency < 153000000)) | 477 | if ((c->frequency >= 47000000) && (c->frequency < 153000000)) |
477 | buf[3] = 0x01; | 478 | buf[3] = 0x01; |
478 | else if ((params->frequency >= 153000000) && (params->frequency < 430000000)) | 479 | else if ((c->frequency >= 153000000) && (c->frequency < 430000000)) |
479 | buf[3] = 0x02; | 480 | buf[3] = 0x02; |
480 | else if ((params->frequency >= 430000000) && (params->frequency < 824000000)) | 481 | else if ((c->frequency >= 430000000) && (c->frequency < 824000000)) |
481 | buf[3] = 0x0C; | 482 | buf[3] = 0x0C; |
482 | else if ((params->frequency >= 824000000) && (params->frequency < 863000000)) | 483 | else if ((c->frequency >= 824000000) && (c->frequency < 863000000)) |
483 | buf[3] = 0x8C; | 484 | buf[3] = 0x8C; |
484 | else | 485 | else |
485 | return -EINVAL; | 486 | return -EINVAL; |