diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 1f0d3e995c8..ae23bdde42a 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -27,8 +27,10 @@ | |||
27 | 27 | ||
28 | #include "cx22702.h" | 28 | #include "cx22702.h" |
29 | #include "lgdt330x.h" | 29 | #include "lgdt330x.h" |
30 | #include "lg_h06xf.h" | ||
30 | #include "mt352.h" | 31 | #include "mt352.h" |
31 | #include "mt352_priv.h" | 32 | #include "mt352_priv.h" |
33 | #include "zl10353.h" | ||
32 | 34 | ||
33 | /* debug */ | 35 | /* debug */ |
34 | int dvb_usb_cxusb_debug; | 36 | int dvb_usb_cxusb_debug; |
@@ -322,32 +324,37 @@ static int cxusb_mt352_demod_init(struct dvb_frontend* fe) | |||
322 | return 0; | 324 | return 0; |
323 | } | 325 | } |
324 | 326 | ||
327 | static int cxusb_lgh064f_tuner_set_params(struct dvb_frontend *fe, | ||
328 | struct dvb_frontend_parameters *fep) | ||
329 | { | ||
330 | struct dvb_usb_device *d = fe->dvb->priv; | ||
331 | return lg_h06xf_pll_set(fe, &d->i2c_adap, fep); | ||
332 | } | ||
333 | |||
325 | static struct cx22702_config cxusb_cx22702_config = { | 334 | static struct cx22702_config cxusb_cx22702_config = { |
326 | .demod_address = 0x63, | 335 | .demod_address = 0x63, |
327 | 336 | ||
328 | .output_mode = CX22702_PARALLEL_OUTPUT, | 337 | .output_mode = CX22702_PARALLEL_OUTPUT, |
329 | |||
330 | .pll_init = dvb_usb_pll_init_i2c, | ||
331 | .pll_set = dvb_usb_pll_set_i2c, | ||
332 | }; | 338 | }; |
333 | 339 | ||
334 | static struct lgdt330x_config cxusb_lgdt3303_config = { | 340 | static struct lgdt330x_config cxusb_lgdt3303_config = { |
335 | .demod_address = 0x0e, | 341 | .demod_address = 0x0e, |
336 | .demod_chip = LGDT3303, | 342 | .demod_chip = LGDT3303, |
337 | .pll_set = dvb_usb_pll_set_i2c, | ||
338 | }; | 343 | }; |
339 | 344 | ||
340 | static struct mt352_config cxusb_dee1601_config = { | 345 | static struct mt352_config cxusb_dee1601_config = { |
341 | .demod_address = 0x0f, | 346 | .demod_address = 0x0f, |
342 | .demod_init = cxusb_dee1601_demod_init, | 347 | .demod_init = cxusb_dee1601_demod_init, |
343 | .pll_set = dvb_usb_pll_set, | ||
344 | }; | 348 | }; |
345 | 349 | ||
346 | struct mt352_config cxusb_mt352_config = { | 350 | static struct zl10353_config cxusb_zl10353_dee1601_config = { |
351 | .demod_address = 0x0f, | ||
352 | }; | ||
353 | |||
354 | static struct mt352_config cxusb_mt352_config = { | ||
347 | /* used in both lgz201 and th7579 */ | 355 | /* used in both lgz201 and th7579 */ |
348 | .demod_address = 0x0f, | 356 | .demod_address = 0x0f, |
349 | .demod_init = cxusb_mt352_demod_init, | 357 | .demod_init = cxusb_mt352_demod_init, |
350 | .pll_set = dvb_usb_pll_set, | ||
351 | }; | 358 | }; |
352 | 359 | ||
353 | /* Callbacks for DVB USB */ | 360 | /* Callbacks for DVB USB */ |
@@ -357,17 +364,10 @@ static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) | |||
357 | d->pll_addr = 0x61; | 364 | d->pll_addr = 0x61; |
358 | memcpy(d->pll_init, bpll, 4); | 365 | memcpy(d->pll_init, bpll, 4); |
359 | d->pll_desc = &dvb_pll_fmd1216me; | 366 | d->pll_desc = &dvb_pll_fmd1216me; |
360 | return 0; | ||
361 | } | ||
362 | 367 | ||
363 | static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d) | 368 | d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; |
364 | { | 369 | d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; |
365 | u8 bpll[4] = { 0x00, 0x00, 0x18, 0x50 }; | 370 | |
366 | /* bpll[2] : unset bit 3, set bits 4&5 | ||
367 | bpll[3] : 0x50 - digital, 0x20 - analog */ | ||
368 | d->pll_addr = 0x61; | ||
369 | memcpy(d->pll_init, bpll, 4); | ||
370 | d->pll_desc = &dvb_pll_tdvs_tua6034; | ||
371 | return 0; | 371 | return 0; |
372 | } | 372 | } |
373 | 373 | ||
@@ -375,6 +375,7 @@ static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d) | |||
375 | { | 375 | { |
376 | d->pll_addr = 0x61; | 376 | d->pll_addr = 0x61; |
377 | d->pll_desc = &dvb_pll_thomson_dtt7579; | 377 | d->pll_desc = &dvb_pll_thomson_dtt7579; |
378 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | ||
378 | return 0; | 379 | return 0; |
379 | } | 380 | } |
380 | 381 | ||
@@ -382,6 +383,7 @@ static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d) | |||
382 | { | 383 | { |
383 | d->pll_addr = 0x61; | 384 | d->pll_addr = 0x61; |
384 | d->pll_desc = &dvb_pll_lg_z201; | 385 | d->pll_desc = &dvb_pll_lg_z201; |
386 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | ||
385 | return 0; | 387 | return 0; |
386 | } | 388 | } |
387 | 389 | ||
@@ -389,6 +391,13 @@ static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d) | |||
389 | { | 391 | { |
390 | d->pll_addr = 0x60; | 392 | d->pll_addr = 0x60; |
391 | d->pll_desc = &dvb_pll_thomson_dtt7579; | 393 | d->pll_desc = &dvb_pll_thomson_dtt7579; |
394 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | ||
395 | return 0; | ||
396 | } | ||
397 | |||
398 | static int cxusb_lgdt3303_tuner_attach(struct dvb_usb_device *d) | ||
399 | { | ||
400 | d->fe->ops.tuner_ops.set_params = cxusb_lgh064f_tuner_set_params; | ||
392 | return 0; | 401 | return 0; |
393 | } | 402 | } |
394 | 403 | ||
@@ -439,7 +448,8 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) | |||
439 | 448 | ||
440 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | 449 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
441 | 450 | ||
442 | if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) | 451 | if (((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) || |
452 | ((d->fe = zl10353_attach(&cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL)) | ||
443 | return 0; | 453 | return 0; |
444 | 454 | ||
445 | return -EIO; | 455 | return -EIO; |
@@ -555,7 +565,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { | |||
555 | .streaming_ctrl = cxusb_streaming_ctrl, | 565 | .streaming_ctrl = cxusb_streaming_ctrl, |
556 | .power_ctrl = cxusb_bluebird_power_ctrl, | 566 | .power_ctrl = cxusb_bluebird_power_ctrl, |
557 | .frontend_attach = cxusb_lgdt3303_frontend_attach, | 567 | .frontend_attach = cxusb_lgdt3303_frontend_attach, |
558 | .tuner_attach = cxusb_lgh064f_tuner_attach, | 568 | .tuner_attach = cxusb_lgdt3303_tuner_attach, |
559 | 569 | ||
560 | .i2c_algo = &cxusb_i2c_algo, | 570 | .i2c_algo = &cxusb_i2c_algo, |
561 | 571 | ||