aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/cxusb.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 16:47:12 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:59:33 -0400
commitb12faeffb179e5397c7c443b0e86e447891125a6 (patch)
tree9272db1e96be3d3d425f91fdd9201ac74294419b /drivers/media/dvb/dvb-usb/cxusb.c
parent56e0314d7bf56ada38f16edc44bec61741975b4d (diff)
V4L/DVB (3888): Convert cxusb to refactored tuner code
Rename pll calls to appropriate tuner calls. Remove pll functions from demod structures. Hook tuner call into tuner_ops. Attach dvb-pll where possible. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 2df6f6f8385b..8559c2cd9a45 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -323,8 +323,8 @@ static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
323 return 0; 323 return 0;
324} 324}
325 325
326static int cxusb_lgh064f_pll_set_i2c(struct dvb_frontend *fe, 326static int cxusb_lgh064f_tuner_set_params(struct dvb_frontend *fe,
327 struct dvb_frontend_parameters *fep) 327 struct dvb_frontend_parameters *fep)
328{ 328{
329 struct dvb_usb_device *d = fe->dvb->priv; 329 struct dvb_usb_device *d = fe->dvb->priv;
330 return lg_h06xf_pll_set(fe, &d->i2c_adap, fep); 330 return lg_h06xf_pll_set(fe, &d->i2c_adap, fep);
@@ -334,28 +334,22 @@ static struct cx22702_config cxusb_cx22702_config = {
334 .demod_address = 0x63, 334 .demod_address = 0x63,
335 335
336 .output_mode = CX22702_PARALLEL_OUTPUT, 336 .output_mode = CX22702_PARALLEL_OUTPUT,
337
338 .pll_init = dvb_usb_pll_init_i2c,
339 .pll_set = dvb_usb_pll_set_i2c,
340}; 337};
341 338
342static struct lgdt330x_config cxusb_lgdt3303_config = { 339static struct lgdt330x_config cxusb_lgdt3303_config = {
343 .demod_address = 0x0e, 340 .demod_address = 0x0e,
344 .demod_chip = LGDT3303, 341 .demod_chip = LGDT3303,
345 .pll_set = cxusb_lgh064f_pll_set_i2c,
346}; 342};
347 343
348static struct mt352_config cxusb_dee1601_config = { 344static struct mt352_config cxusb_dee1601_config = {
349 .demod_address = 0x0f, 345 .demod_address = 0x0f,
350 .demod_init = cxusb_dee1601_demod_init, 346 .demod_init = cxusb_dee1601_demod_init,
351 .pll_set = dvb_usb_pll_set,
352}; 347};
353 348
354static struct mt352_config cxusb_mt352_config = { 349static struct mt352_config cxusb_mt352_config = {
355 /* used in both lgz201 and th7579 */ 350 /* used in both lgz201 and th7579 */
356 .demod_address = 0x0f, 351 .demod_address = 0x0f,
357 .demod_init = cxusb_mt352_demod_init, 352 .demod_init = cxusb_mt352_demod_init,
358 .pll_set = dvb_usb_pll_set,
359}; 353};
360 354
361/* Callbacks for DVB USB */ 355/* Callbacks for DVB USB */
@@ -397,8 +391,11 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
397 391
398 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1); 392 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1);
399 393
400 if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL) 394 if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL) {
395 d->fe->ops->tuner_ops.init = dvb_usb_tuner_init_i2c;
396 d->fe->ops->tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
401 return 0; 397 return 0;
398 }
402 399
403 return -EIO; 400 return -EIO;
404} 401}
@@ -410,8 +407,10 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d)
410 407
411 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 408 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
412 409
413 if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) 410 if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) {
411 d->fe->ops->tuner_ops.set_params = cxusb_lgh064f_tuner_set_params;
414 return 0; 412 return 0;
413 }
415 414
416 return -EIO; 415 return -EIO;
417} 416}
@@ -423,8 +422,10 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
423 422
424 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 423 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
425 424
426 if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) 425 if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) {
426 d->fe->ops->tuner_ops.pllbuf = dvb_usb_tuner_pllbuf;
427 return 0; 427 return 0;
428 }
428 429
429 return -EIO; 430 return -EIO;
430} 431}
@@ -436,8 +437,10 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
436 437
437 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 438 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
438 439
439 if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) 440 if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) {
441 d->fe->ops->tuner_ops.pllbuf = dvb_usb_tuner_pllbuf;
440 return 0; 442 return 0;
443 }
441 444
442 return -EIO; 445 return -EIO;
443} 446}