aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/cxusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index c58365005ac1..720fcd1c3c1d 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -23,6 +23,8 @@
23 * 23 *
24 * see Documentation/dvb/README.dvb-usb for more information 24 * see Documentation/dvb/README.dvb-usb for more information
25 */ 25 */
26#include <media/tuner.h>
27
26#include "cxusb.h" 28#include "cxusb.h"
27 29
28#include "cx22702.h" 30#include "cx22702.h"
@@ -31,12 +33,15 @@
31#include "mt352_priv.h" 33#include "mt352_priv.h"
32#include "zl10353.h" 34#include "zl10353.h"
33#include "tuner-xc2028.h" 35#include "tuner-xc2028.h"
34#include "tuner-xc2028-types.h" 36#include "tuner-simple.h"
35 37
36/* debug */ 38/* debug */
37static int dvb_usb_cxusb_debug; 39static int dvb_usb_cxusb_debug;
38module_param_named(debug, dvb_usb_cxusb_debug, int, 0644); 40module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
39MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); 41MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
42
43DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
44
40#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args) 45#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
41#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \ 46#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
42 dprintk(dvb_usb_cxusb_debug,0x01,args) 47 dprintk(dvb_usb_cxusb_debug,0x01,args)
@@ -450,8 +455,9 @@ static struct mt352_config cxusb_mt352_xc3028_config = {
450/* Callbacks for DVB USB */ 455/* Callbacks for DVB USB */
451static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) 456static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
452{ 457{
453 dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, 458 dvb_attach(simple_tuner_attach, adap->fe,
454 DVB_PLL_FMD1216ME); 459 &adap->dev->i2c_adap, 0x61,
460 TUNER_PHILIPS_FMD1216ME_MK3);
455 return 0; 461 return 0;
456} 462}
457 463
@@ -477,8 +483,8 @@ static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
477 483
478static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap) 484static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
479{ 485{
480 dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, 486 dvb_attach(simple_tuner_attach, adap->fe,
481 DVB_PLL_LG_TDVS_H06XF); 487 &adap->dev->i2c_adap, 0x61, TUNER_LG_TDVS_H06XF);
482 return 0; 488 return 0;
483} 489}
484 490
@@ -488,14 +494,14 @@ static int dvico_bluebird_xc2028_callback(void *ptr, int command, int arg)
488 494
489 switch (command) { 495 switch (command) {
490 case XC2028_TUNER_RESET: 496 case XC2028_TUNER_RESET:
491 deb_info("%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg); 497 deb_info("%s: XC2028_TUNER_RESET %d\n", __func__, arg);
492 cxusb_bluebird_gpio_pulse(d, 0x01, 1); 498 cxusb_bluebird_gpio_pulse(d, 0x01, 1);
493 break; 499 break;
494 case XC2028_RESET_CLK: 500 case XC2028_RESET_CLK:
495 deb_info("%s: XC2028_RESET_CLK %d\n", __FUNCTION__, arg); 501 deb_info("%s: XC2028_RESET_CLK %d\n", __func__, arg);
496 break; 502 break;
497 default: 503 default:
498 deb_info("%s: unknown command %d, arg %d\n", __FUNCTION__, 504 deb_info("%s: unknown command %d, arg %d\n", __func__,
499 command, arg); 505 command, arg);
500 return -EINVAL; 506 return -EINVAL;
501 } 507 }
@@ -509,13 +515,12 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
509 struct xc2028_config cfg = { 515 struct xc2028_config cfg = {
510 .i2c_adap = &adap->dev->i2c_adap, 516 .i2c_adap = &adap->dev->i2c_adap,
511 .i2c_addr = 0x61, 517 .i2c_addr = 0x61,
512 .video_dev = adap->dev,
513 .callback = dvico_bluebird_xc2028_callback, 518 .callback = dvico_bluebird_xc2028_callback,
514 }; 519 };
515 static struct xc2028_ctrl ctl = { 520 static struct xc2028_ctrl ctl = {
516 .fname = "xc3028-dvico-au-01.fw", 521 .fname = "xc3028-dvico-au-01.fw",
517 .max_len = 64, 522 .max_len = 64,
518 .scode_table = ZARLINK456, 523 .scode_table = XC3028_FE_ZARLINK456,
519 }; 524 };
520 525
521 fe = dvb_attach(xc2028_attach, adap->fe, &cfg); 526 fe = dvb_attach(xc2028_attach, adap->fe, &cfg);
@@ -720,16 +725,24 @@ static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_prope
720static int cxusb_probe(struct usb_interface *intf, 725static int cxusb_probe(struct usb_interface *intf,
721 const struct usb_device_id *id) 726 const struct usb_device_id *id)
722{ 727{
723 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || 728 if (0 == dvb_usb_device_init(intf, &cxusb_medion_properties,
724 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 || 729 THIS_MODULE, NULL, adapter_nr) ||
725 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 || 730 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgh064f_properties,
726 dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 || 731 THIS_MODULE, NULL, adapter_nr) ||
727 dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 || 732 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dee1601_properties,
728 dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0 || 733 THIS_MODULE, NULL, adapter_nr) ||
729 dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL) == 0 || 734 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgz201_properties,
730 dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL) == 0) { 735 THIS_MODULE, NULL, adapter_nr) ||
736 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dtt7579_properties,
737 THIS_MODULE, NULL, adapter_nr) ||
738 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dualdig4_properties,
739 THIS_MODULE, NULL, adapter_nr) ||
740 0 == dvb_usb_device_init(intf, &cxusb_bluebird_nano2_properties,
741 THIS_MODULE, NULL, adapter_nr) ||
742 0 == dvb_usb_device_init(intf,
743 &cxusb_bluebird_nano2_needsfirmware_properties,
744 THIS_MODULE, NULL, adapter_nr))
731 return 0; 745 return 0;
732 }
733 746
734 return -EINVAL; 747 return -EINVAL;
735} 748}