aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig1
-rw-r--r--drivers/media/dvb/dvb-usb/a800.c6
-rw-r--r--drivers/media/dvb/dvb-usb/af9005.c5
-rw-r--r--drivers/media/dvb/dvb-usb/au6610.c6
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c51
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700.h4
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_core.c9
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c325
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mb.c14
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mc.c5
-rw-r--r--drivers/media/dvb/dvb-usb/digitv.c8
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u.c17
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-common.h3
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-dvb.c9
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h13
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c16
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h5
-rw-r--r--drivers/media/dvb/dvb-usb/gl861.c6
-rw-r--r--drivers/media/dvb/dvb-usb/gp8psk-fe.c4
-rw-r--r--drivers/media/dvb/dvb-usb/gp8psk.c5
-rw-r--r--drivers/media/dvb/dvb-usb/m920x.c34
-rw-r--r--drivers/media/dvb/dvb-usb/nova-t-usb2.c5
-rw-r--r--drivers/media/dvb/dvb-usb/opera1.c8
-rw-r--r--drivers/media/dvb/dvb-usb/ttusb2.c67
-rw-r--r--drivers/media/dvb/dvb-usb/umt-010.c5
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x-fe.c18
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x.c5
-rw-r--r--drivers/media/dvb/dvb-usb/vp7045.c6
28 files changed, 539 insertions, 121 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index d73934dd4c57..3c8493d2026d 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -105,6 +105,7 @@ config DVB_USB_CXUSB
105 select DVB_LGDT330X if !DVB_FE_CUSTOMISE 105 select DVB_LGDT330X if !DVB_FE_CUSTOMISE
106 select DVB_MT352 if !DVB_FE_CUSTOMISE 106 select DVB_MT352 if !DVB_FE_CUSTOMISE
107 select DVB_ZL10353 if !DVB_FE_CUSTOMISE 107 select DVB_ZL10353 if !DVB_FE_CUSTOMISE
108 select TUNER_SIMPLE if !DVB_FE_CUSTOMISE
108 help 109 help
109 Say Y here to support the Conexant USB2.0 hybrid reference design. 110 Say Y here to support the Conexant USB2.0 hybrid reference design.
110 Currently, only DVB and ATSC modes are supported, analog mode 111 Currently, only DVB and ATSC modes are supported, analog mode
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c
index a6c5f19f680d..dc8c8784caa8 100644
--- a/drivers/media/dvb/dvb-usb/a800.c
+++ b/drivers/media/dvb/dvb-usb/a800.c
@@ -18,6 +18,9 @@
18static int debug; 18static int debug;
19module_param(debug, int, 0644); 19module_param(debug, int, 0644);
20MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS); 20MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS);
21
22DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
23
21#define deb_rc(args...) dprintk(debug,0x01,args) 24#define deb_rc(args...) dprintk(debug,0x01,args)
22 25
23static int a800_power_ctrl(struct dvb_usb_device *d, int onoff) 26static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
@@ -94,7 +97,8 @@ static struct dvb_usb_device_properties a800_properties;
94static int a800_probe(struct usb_interface *intf, 97static int a800_probe(struct usb_interface *intf,
95 const struct usb_device_id *id) 98 const struct usb_device_id *id)
96{ 99{
97 return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL); 100 return dvb_usb_device_init(intf, &a800_properties,
101 THIS_MODULE, NULL, adapter_nr);
98} 102}
99 103
100/* do not change the order of the ID table */ 104/* do not change the order of the ID table */
diff --git a/drivers/media/dvb/dvb-usb/af9005.c b/drivers/media/dvb/dvb-usb/af9005.c
index e7f76f515b4f..cfe71feefcad 100644
--- a/drivers/media/dvb/dvb-usb/af9005.c
+++ b/drivers/media/dvb/dvb-usb/af9005.c
@@ -39,6 +39,8 @@ int dvb_usb_af9005_dump_eeprom = 0;
39module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0); 39module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
40MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom."); 40MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom.");
41 41
42DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
43
42/* remote control decoder */ 44/* remote control decoder */
43int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event, 45int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event,
44 int *state); 46 int *state);
@@ -1020,7 +1022,8 @@ static struct dvb_usb_device_properties af9005_properties;
1020static int af9005_usb_probe(struct usb_interface *intf, 1022static int af9005_usb_probe(struct usb_interface *intf,
1021 const struct usb_device_id *id) 1023 const struct usb_device_id *id)
1022{ 1024{
1023 return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL); 1025 return dvb_usb_device_init(intf, &af9005_properties,
1026 THIS_MODULE, NULL, adapter_nr);
1024} 1027}
1025 1028
1026static struct usb_device_id af9005_usb_table[] = { 1029static struct usb_device_id af9005_usb_table[] = {
diff --git a/drivers/media/dvb/dvb-usb/au6610.c b/drivers/media/dvb/dvb-usb/au6610.c
index f3ff81314696..2ccb90fa60c8 100644
--- a/drivers/media/dvb/dvb-usb/au6610.c
+++ b/drivers/media/dvb/dvb-usb/au6610.c
@@ -19,6 +19,8 @@ static int dvb_usb_au6610_debug;
19module_param_named(debug, dvb_usb_au6610_debug, int, 0644); 19module_param_named(debug, dvb_usb_au6610_debug, int, 0644);
20MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); 20MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
21 21
22DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
23
22static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr, 24static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr,
23 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) 25 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
24{ 26{
@@ -163,7 +165,9 @@ static int au6610_probe(struct usb_interface *intf,
163 if (intf->num_altsetting < AU6610_ALTSETTING_COUNT) 165 if (intf->num_altsetting < AU6610_ALTSETTING_COUNT)
164 return -ENODEV; 166 return -ENODEV;
165 167
166 if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d)) == 0) { 168 ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d,
169 adapter_nr);
170 if (ret == 0) {
167 alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING); 171 alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING);
168 172
169 if (alt == NULL) { 173 if (alt == NULL) {
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}
diff --git a/drivers/media/dvb/dvb-usb/dib0700.h b/drivers/media/dvb/dvb-usb/dib0700.h
index 4a903ea95896..66d4dc6ba46f 100644
--- a/drivers/media/dvb/dvb-usb/dib0700.h
+++ b/drivers/media/dvb/dvb-usb/dib0700.h
@@ -37,6 +37,7 @@ struct dib0700_state {
37 u8 channel_state; 37 u8 channel_state;
38 u16 mt2060_if1[2]; 38 u16 mt2060_if1[2];
39 u8 rc_toggle; 39 u8 rc_toggle;
40 u8 rc_counter;
40 u8 is_dib7000pc; 41 u8 is_dib7000pc;
41}; 42};
42 43
@@ -44,12 +45,15 @@ extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8
44extern int dib0700_ctrl_clock(struct dvb_usb_device *d, u32 clk_MHz, u8 clock_out_gp3); 45extern int dib0700_ctrl_clock(struct dvb_usb_device *d, u32 clk_MHz, u8 clock_out_gp3);
45extern int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx, u8 rxlen); 46extern int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx, u8 rxlen);
46extern int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw); 47extern int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw);
48extern int dib0700_rc_setup(struct dvb_usb_device *d);
47extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff); 49extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff);
48extern struct i2c_algorithm dib0700_i2c_algo; 50extern struct i2c_algorithm dib0700_i2c_algo;
49extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, 51extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props,
50 struct dvb_usb_device_description **desc, int *cold); 52 struct dvb_usb_device_description **desc, int *cold);
51 53
52extern int dib0700_device_count; 54extern int dib0700_device_count;
55extern int dvb_usb_dib0700_ir_proto;
53extern struct dvb_usb_device_properties dib0700_devices[]; 56extern struct dvb_usb_device_properties dib0700_devices[];
54extern struct usb_device_id dib0700_usb_id_table[]; 57extern struct usb_device_id dib0700_usb_id_table[];
58
55#endif 59#endif
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index c9857d5c6982..595a04696c87 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -13,10 +13,12 @@ int dvb_usb_dib0700_debug;
13module_param_named(debug,dvb_usb_dib0700_debug, int, 0644); 13module_param_named(debug,dvb_usb_dib0700_debug, int, 0644);
14MODULE_PARM_DESC(debug, "set debugging level (1=info,2=fw,4=fwdata,8=data (or-able))." DVB_USB_DEBUG_STATUS); 14MODULE_PARM_DESC(debug, "set debugging level (1=info,2=fw,4=fwdata,8=data (or-able))." DVB_USB_DEBUG_STATUS);
15 15
16static int dvb_usb_dib0700_ir_proto = 1; 16int dvb_usb_dib0700_ir_proto = 1;
17module_param(dvb_usb_dib0700_ir_proto, int, 0644); 17module_param(dvb_usb_dib0700_ir_proto, int, 0644);
18MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6)."); 18MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
19 19
20DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
21
20/* expecting rx buffer: request data[0] data[1] ... data[2] */ 22/* expecting rx buffer: request data[0] data[1] ... data[2] */
21static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen) 23static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen)
22{ 24{
@@ -261,7 +263,7 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
261 return dib0700_ctrl_wr(adap->dev, b, 4); 263 return dib0700_ctrl_wr(adap->dev, b, 4);
262} 264}
263 265
264static int dib0700_rc_setup(struct dvb_usb_device *d) 266int dib0700_rc_setup(struct dvb_usb_device *d)
265{ 267{
266 u8 rc_setup[3] = {REQUEST_SET_RC, dvb_usb_dib0700_ir_proto, 0}; 268 u8 rc_setup[3] = {REQUEST_SET_RC, dvb_usb_dib0700_ir_proto, 0};
267 int i = dib0700_ctrl_wr(d, rc_setup, 3); 269 int i = dib0700_ctrl_wr(d, rc_setup, 3);
@@ -279,7 +281,8 @@ static int dib0700_probe(struct usb_interface *intf,
279 struct dvb_usb_device *dev; 281 struct dvb_usb_device *dev;
280 282
281 for (i = 0; i < dib0700_device_count; i++) 283 for (i = 0; i < dib0700_device_count; i++)
282 if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev) == 0) 284 if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE,
285 &dev, adapter_nr) == 0)
283 { 286 {
284 dib0700_rc_setup(dev); 287 dib0700_rc_setup(dev);
285 return 0; 288 return 0;
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index e7093826e975..6477fc66cc23 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -13,6 +13,7 @@
13#include "dib7000p.h" 13#include "dib7000p.h"
14#include "mt2060.h" 14#include "mt2060.h"
15#include "mt2266.h" 15#include "mt2266.h"
16#include "tuner-xc2028.h"
16#include "dib0070.h" 17#include "dib0070.h"
17 18
18static int force_lna_activation; 19static int force_lna_activation;
@@ -297,10 +298,156 @@ static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
297 &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;; 298 &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;;
298} 299}
299 300
301/* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
302struct dibx000_agc_config xc3028_agc_config = {
303 BAND_VHF | BAND_UHF, /* band_caps */
304
305 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
306 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
307 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
308 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
309 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
310
311 712, /* inv_gain */
312 21, /* time_stabiliz */
313
314 0, /* alpha_level */
315 118, /* thlock */
316
317 0, /* wbd_inv */
318 2867, /* wbd_ref */
319 0, /* wbd_sel */
320 2, /* wbd_alpha */
321
322 0, /* agc1_max */
323 0, /* agc1_min */
324 39718, /* agc2_max */
325 9930, /* agc2_min */
326 0, /* agc1_pt1 */
327 0, /* agc1_pt2 */
328 0, /* agc1_pt3 */
329 0, /* agc1_slope1 */
330 0, /* agc1_slope2 */
331 0, /* agc2_pt1 */
332 128, /* agc2_pt2 */
333 29, /* agc2_slope1 */
334 29, /* agc2_slope2 */
335
336 17, /* alpha_mant */
337 27, /* alpha_exp */
338 23, /* beta_mant */
339 51, /* beta_exp */
340
341 1, /* perform_agc_softsplit */
342};
343
344/* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
345struct dibx000_bandwidth_config xc3028_bw_config = {
346 60000, 30000, /* internal, sampling */
347 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
348 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc,
349 modulo */
350 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
351 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
352 20452225, /* timf */
353 30000000, /* xtal_hz */
354};
355
356static struct dib7000p_config stk7700ph_dib7700_xc3028_config = {
357 .output_mpeg2_in_188_bytes = 1,
358 .tuner_is_baseband = 1,
359
360 .agc_config_count = 1,
361 .agc = &xc3028_agc_config,
362 .bw = &xc3028_bw_config,
363
364 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
365 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
366 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
367};
368
369static int stk7700ph_xc3028_callback(void *ptr, int command, int arg)
370{
371 struct dvb_usb_adapter *adap = ptr;
372
373 switch (command) {
374 case XC2028_TUNER_RESET:
375 /* Send the tuner in then out of reset */
376 dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10);
377 dib7000p_set_gpio(adap->fe, 8, 0, 1);
378 break;
379 case XC2028_RESET_CLK:
380 break;
381 default:
382 err("%s: unknown command %d, arg %d\n", __func__,
383 command, arg);
384 return -EINVAL;
385 }
386 return 0;
387}
388
389static struct xc2028_ctrl stk7700ph_xc3028_ctrl = {
390 .fname = XC2028_DEFAULT_FIRMWARE,
391 .max_len = 64,
392 .demod = XC3028_FE_DIBCOM52,
393};
394
395static struct xc2028_config stk7700ph_xc3028_config = {
396 .i2c_addr = 0x61,
397 .callback = stk7700ph_xc3028_callback,
398 .ctrl = &stk7700ph_xc3028_ctrl,
399};
400
401static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
402{
403 struct usb_device_descriptor *desc = &adap->dev->udev->descriptor;
404
405 if (desc->idVendor == USB_VID_PINNACLE &&
406 desc->idProduct == USB_PID_PINNACLE_EXPRESSCARD_320CX)
407 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
408 else
409 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
410 msleep(20);
411 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
412 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
413 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
414 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
415 msleep(10);
416 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
417 msleep(20);
418 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
419 msleep(10);
420
421 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
422 &stk7700ph_dib7700_xc3028_config);
423
424 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
425 &stk7700ph_dib7700_xc3028_config);
426
427 return adap->fe == NULL ? -ENODEV : 0;
428}
429
430static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap)
431{
432 struct i2c_adapter *tun_i2c;
433
434 tun_i2c = dib7000p_get_i2c_master(adap->fe,
435 DIBX000_I2C_INTERFACE_TUNER, 1);
436
437 stk7700ph_xc3028_config.i2c_adap = tun_i2c;
438 stk7700ph_xc3028_config.video_dev = adap;
439
440 return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config)
441 == NULL ? -ENODEV : 0;
442}
443
300#define DEFAULT_RC_INTERVAL 150 444#define DEFAULT_RC_INTERVAL 150
301 445
302static u8 rc_request[] = { REQUEST_POLL_RC, 0 }; 446static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
303 447
448/* Number of keypresses to ignore before start repeating */
449#define RC_REPEAT_DELAY 2
450
304static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 451static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
305{ 452{
306 u8 key[4]; 453 u8 key[4];
@@ -314,18 +461,67 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
314 err("RC Query Failed"); 461 err("RC Query Failed");
315 return -1; 462 return -1;
316 } 463 }
464
465 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
317 if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0; 466 if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0;
318 if (key[3-1]!=st->rc_toggle) { 467
468 /* info("%d: %2X %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)key[3-2],(int)key[3-3],(int)key[3-1],(int)key[3]); */
469
470 dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */
471
472 switch (dvb_usb_dib0700_ir_proto) {
473 case 0: {
474 /* NEC protocol sends repeat code as 0 0 0 FF */
475 if ((key[3-2] == 0x00) && (key[3-3] == 0x00) &&
476 (key[3] == 0xFF)) {
477 st->rc_counter++;
478 if (st->rc_counter > RC_REPEAT_DELAY) {
479 *event = d->last_event;
480 *state = REMOTE_KEY_PRESSED;
481 st->rc_counter = RC_REPEAT_DELAY;
482 }
483 return 0;
484 }
319 for (i=0;i<d->props.rc_key_map_size; i++) { 485 for (i=0;i<d->props.rc_key_map_size; i++) {
320 if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) { 486 if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) {
487 st->rc_counter = 0;
488 *event = keymap[i].event;
489 *state = REMOTE_KEY_PRESSED;
490 d->last_event = keymap[i].event;
491 return 0;
492 }
493 }
494 break;
495 }
496 default: {
497 /* RC-5 protocol changes toggle bit on new keypress */
498 for (i = 0; i < d->props.rc_key_map_size; i++) {
499 if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) {
500 if (d->last_event == keymap[i].event &&
501 key[3-1] == st->rc_toggle) {
502 st->rc_counter++;
503 /* prevents unwanted double hits */
504 if (st->rc_counter > RC_REPEAT_DELAY) {
505 *event = d->last_event;
506 *state = REMOTE_KEY_PRESSED;
507 st->rc_counter = RC_REPEAT_DELAY;
508 }
509
510 return 0;
511 }
512 st->rc_counter = 0;
321 *event = keymap[i].event; 513 *event = keymap[i].event;
322 *state = REMOTE_KEY_PRESSED; 514 *state = REMOTE_KEY_PRESSED;
323 st->rc_toggle=key[3-1]; 515 st->rc_toggle = key[3-1];
516 d->last_event = keymap[i].event;
324 return 0; 517 return 0;
325 } 518 }
326 } 519 }
327 err("Unknown remote controller key : %2X %2X",(int)key[3-2],(int)key[3-3]); 520 break;
328 } 521 }
522 }
523 err("Unknown remote controller key: %2X %2X %2X %2X", (int) key[3-2], (int) key[3-3], (int) key[3-1], (int) key[3]);
524 d->last_event = 0;
329 return 0; 525 return 0;
330} 526}
331 527
@@ -794,6 +990,10 @@ static struct dib7000p_config dib7070p_dib7000p_config = {
794/* STK7070P */ 990/* STK7070P */
795static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) 991static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
796{ 992{
993 if (adap->dev->udev->descriptor.idVendor == USB_VID_PINNACLE &&
994 adap->dev->udev->descriptor.idProduct == USB_PID_PINNACLE_PCTV72E)
995 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
996 else
797 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); 997 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
798 msleep(10); 998 msleep(10);
799 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); 999 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
@@ -808,9 +1008,11 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
808 msleep(10); 1008 msleep(10);
809 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); 1009 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
810 1010
811 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, &dib7070p_dib7000p_config); 1011 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
1012 &dib7070p_dib7000p_config);
812 1013
813 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &dib7070p_dib7000p_config); 1014 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
1015 &dib7070p_dib7000p_config);
814 return adap->fe == NULL ? -ENODEV : 0; 1016 return adap->fe == NULL ? -ENODEV : 0;
815} 1017}
816 1018
@@ -878,34 +1080,43 @@ static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
878/* DVB-USB and USB stuff follows */ 1080/* DVB-USB and USB stuff follows */
879struct usb_device_id dib0700_usb_id_table[] = { 1081struct usb_device_id dib0700_usb_id_table[] = {
880/* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, 1082/* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
881 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) }, 1083 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
882 1084 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
883 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) }, 1085 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
884 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, 1086 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
885 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
886/* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, 1087/* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
887 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) }, 1088 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
888 { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) }, 1089 { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
889 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) }, 1090 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
890 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) }, 1091 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
891/* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) }, 1092/* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
892 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) }, 1093 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
893 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) }, 1094 { USB_DEVICE(USB_VID_TERRATEC,
894 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) }, 1095 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
895 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) }, 1096 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
1097 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
896/* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) }, 1098/* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
897 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) }, 1099 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
898 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) }, 1100 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
899 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, 1101 { USB_DEVICE(USB_VID_PINNACLE,
900 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, 1102 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
1103 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
901/* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, 1104/* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
902 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) }, 1105 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
903 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) }, 1106 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
904 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) }, 1107 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
905 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) }, 1108 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
906/* 25 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) }, 1109/* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) },
907 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) }, 1110 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) },
908 { 0 } /* Terminating entry */ 1111 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) },
1112 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) },
1113 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) },
1114/* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) },
1115 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) },
1116 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) },
1117 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) },
1118 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) },
1119 { 0 } /* Terminating entry */
909}; 1120};
910MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); 1121MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
911 1122
@@ -969,7 +1180,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
969 { NULL }, 1180 { NULL },
970 }, 1181 },
971 { "Leadtek Winfast DTV Dongle (STK7700P based)", 1182 { "Leadtek Winfast DTV Dongle (STK7700P based)",
972 { &dib0700_usb_id_table[8], NULL }, 1183 { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] },
973 { NULL }, 1184 { NULL },
974 }, 1185 },
975 { "AVerMedia AVerTV DVB-T Express", 1186 { "AVerMedia AVerTV DVB-T Express",
@@ -1069,12 +1280,16 @@ struct dvb_usb_device_properties dib0700_devices[] = {
1069 }, 1280 },
1070 }, 1281 },
1071 1282
1072 .num_device_descs = 1, 1283 .num_device_descs = 2,
1073 .devices = { 1284 .devices = {
1074 { "ASUS My Cinema U3000 Mini DVBT Tuner", 1285 { "ASUS My Cinema U3000 Mini DVBT Tuner",
1075 { &dib0700_usb_id_table[23], NULL }, 1286 { &dib0700_usb_id_table[23], NULL },
1076 { NULL }, 1287 { NULL },
1077 }, 1288 },
1289 { "Yuan EC372S",
1290 { &dib0700_usb_id_table[31], NULL },
1291 { NULL },
1292 }
1078 } 1293 }
1079 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 1294 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1080 1295
@@ -1090,7 +1305,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
1090 }, 1305 },
1091 }, 1306 },
1092 1307
1093 .num_device_descs = 6, 1308 .num_device_descs = 9,
1094 .devices = { 1309 .devices = {
1095 { "DiBcom STK7070P reference design", 1310 { "DiBcom STK7070P reference design",
1096 { &dib0700_usb_id_table[15], NULL }, 1311 { &dib0700_usb_id_table[15], NULL },
@@ -1116,6 +1331,18 @@ struct dvb_usb_device_properties dib0700_devices[] = {
1116 { &dib0700_usb_id_table[26], NULL }, 1331 { &dib0700_usb_id_table[26], NULL },
1117 { NULL }, 1332 { NULL },
1118 }, 1333 },
1334 { "Pinnacle PCTV 72e",
1335 { &dib0700_usb_id_table[29], NULL },
1336 { NULL },
1337 },
1338 { "Pinnacle PCTV 73e",
1339 { &dib0700_usb_id_table[30], NULL },
1340 { NULL },
1341 },
1342 { "Terratec Cinergy T USB XXS",
1343 { &dib0700_usb_id_table[33], NULL },
1344 { NULL },
1345 },
1119 }, 1346 },
1120 1347
1121 .rc_interval = DEFAULT_RC_INTERVAL, 1348 .rc_interval = DEFAULT_RC_INTERVAL,
@@ -1155,6 +1382,40 @@ struct dvb_usb_device_properties dib0700_devices[] = {
1155 { NULL }, 1382 { NULL },
1156 } 1383 }
1157 } 1384 }
1385 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1386
1387 .num_adapters = 1,
1388 .adapter = {
1389 {
1390 .frontend_attach = stk7700ph_frontend_attach,
1391 .tuner_attach = stk7700ph_tuner_attach,
1392
1393 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1394
1395 .size_of_priv = sizeof(struct
1396 dib0700_adapter_state),
1397 },
1398 },
1399
1400 .num_device_descs = 3,
1401 .devices = {
1402 { "Terratec Cinergy HT USB XE",
1403 { &dib0700_usb_id_table[27], NULL },
1404 { NULL },
1405 },
1406 { "Pinnacle Expresscard 320cx",
1407 { &dib0700_usb_id_table[28], NULL },
1408 { NULL },
1409 },
1410 { "Terratec Cinergy HT Express",
1411 { &dib0700_usb_id_table[32], NULL },
1412 { NULL },
1413 },
1414 },
1415 .rc_interval = DEFAULT_RC_INTERVAL,
1416 .rc_key_map = dib0700_rc_keys,
1417 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1418 .rc_query = dib0700_rc_query
1158 }, 1419 },
1159}; 1420};
1160 1421
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index 043cadae0859..eeef50bff4f9 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -14,6 +14,8 @@
14 */ 14 */
15#include "dibusb.h" 15#include "dibusb.h"
16 16
17DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
18
17static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) 19static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
18{ 20{
19 struct dvb_usb_adapter *adap = fe->dvb->priv; 21 struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -107,10 +109,14 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties;
107static int dibusb_probe(struct usb_interface *intf, 109static int dibusb_probe(struct usb_interface *intf,
108 const struct usb_device_id *id) 110 const struct usb_device_id *id)
109{ 111{
110 if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 0 || 112 if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties,
111 dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 || 113 THIS_MODULE, NULL, adapter_nr) ||
112 dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0 || 114 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
113 dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL) == 0) 115 THIS_MODULE, NULL, adapter_nr) ||
116 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties,
117 THIS_MODULE, NULL, adapter_nr) ||
118 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
119 THIS_MODULE, NULL, adapter_nr))
114 return 0; 120 return 0;
115 121
116 return -EINVAL; 122 return -EINVAL;
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c
index e7ea3e753d6d..059cec955318 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -14,13 +14,16 @@
14 */ 14 */
15#include "dibusb.h" 15#include "dibusb.h"
16 16
17DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
18
17/* USB Driver stuff */ 19/* USB Driver stuff */
18static struct dvb_usb_device_properties dibusb_mc_properties; 20static struct dvb_usb_device_properties dibusb_mc_properties;
19 21
20static int dibusb_mc_probe(struct usb_interface *intf, 22static int dibusb_mc_probe(struct usb_interface *intf,
21 const struct usb_device_id *id) 23 const struct usb_device_id *id)
22{ 24{
23 return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL); 25 return dvb_usb_device_init(intf, &dibusb_mc_properties, THIS_MODULE,
26 NULL, adapter_nr);
24} 27}
25 28
26/* do not change the order of the ID table */ 29/* do not change the order of the ID table */
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c
index 3acbda4aa27e..b545cf3eab2e 100644
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -20,6 +20,9 @@
20static int dvb_usb_digitv_debug; 20static int dvb_usb_digitv_debug;
21module_param_named(debug,dvb_usb_digitv_debug, int, 0644); 21module_param_named(debug,dvb_usb_digitv_debug, int, 0644);
22MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); 22MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
23
24DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
25
23#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args) 26#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
24 27
25static int digitv_ctrl_msg(struct dvb_usb_device *d, 28static int digitv_ctrl_msg(struct dvb_usb_device *d,
@@ -256,8 +259,9 @@ static int digitv_probe(struct usb_interface *intf,
256 const struct usb_device_id *id) 259 const struct usb_device_id *id)
257{ 260{
258 struct dvb_usb_device *d; 261 struct dvb_usb_device *d;
259 int ret; 262 int ret = dvb_usb_device_init(intf, &digitv_properties, THIS_MODULE, &d,
260 if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) { 263 adapter_nr);
264 if (ret == 0) {
261 u8 b[4] = { 0 }; 265 u8 b[4] = { 0 };
262 266
263 if (d != NULL) { /* do that only when the firmware is loaded */ 267 if (d != NULL) { /* do that only when the firmware is loaded */
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c
index d86cf9bee91c..81a6cbf60160 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -18,6 +18,8 @@ int dvb_usb_dtt200u_debug;
18module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644); 18module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644);
19MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS); 19MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS);
20 20
21DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
22
21static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff) 23static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff)
22{ 24{
23 u8 b = SET_INIT; 25 u8 b = SET_INIT;
@@ -101,11 +103,16 @@ static struct dvb_usb_device_properties wt220u_miglia_properties;
101static int dtt200u_usb_probe(struct usb_interface *intf, 103static int dtt200u_usb_probe(struct usb_interface *intf,
102 const struct usb_device_id *id) 104 const struct usb_device_id *id)
103{ 105{
104 if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 || 106 if (0 == dvb_usb_device_init(intf, &dtt200u_properties,
105 dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 || 107 THIS_MODULE, NULL, adapter_nr) ||
106 dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 || 108 0 == dvb_usb_device_init(intf, &wt220u_properties,
107 dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0 || 109 THIS_MODULE, NULL, adapter_nr) ||
108 dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL) == 0) 110 0 == dvb_usb_device_init(intf, &wt220u_fc_properties,
111 THIS_MODULE, NULL, adapter_nr) ||
112 0 == dvb_usb_device_init(intf, &wt220u_zl0353_properties,
113 THIS_MODULE, NULL, adapter_nr) ||
114 0 == dvb_usb_device_init(intf, &wt220u_miglia_properties,
115 THIS_MODULE, NULL, adapter_nr))
109 return 0; 116 return 0;
110 117
111 return -ENODEV; 118 return -ENODEV;
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-common.h b/drivers/media/dvb/dvb-usb/dvb-usb-common.h
index 35ab68f6dcf6..6b7b2a89242e 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-common.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-common.h
@@ -40,7 +40,8 @@ extern int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap);
40extern int dvb_usb_i2c_init(struct dvb_usb_device *); 40extern int dvb_usb_i2c_init(struct dvb_usb_device *);
41extern int dvb_usb_i2c_exit(struct dvb_usb_device *); 41extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
42 42
43extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap); 43extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap,
44 short *adapter_nums);
44extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap); 45extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
45extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap); 46extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
46extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap); 47extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
index 4561a672da92..ce8cd0c5d831 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -77,12 +77,13 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
77 return dvb_usb_ctrl_feed(dvbdmxfeed,0); 77 return dvb_usb_ctrl_feed(dvbdmxfeed,0);
78} 78}
79 79
80int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap) 80int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
81{ 81{
82 int ret; 82 int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
83 adap->dev->owner, &adap->dev->udev->dev,
84 adapter_nums);
83 85
84 if ((ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name, 86 if (ret < 0) {
85 adap->dev->owner, &adap->dev->udev->dev)) < 0) {
86 deb_info("dvb_register_adapter failed: error %d", ret); 87 deb_info("dvb_register_adapter failed: error %d", ret);
87 goto err; 88 goto err;
88 } 89 }
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index aa4844ef875e..34245d1b7dd9 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -40,14 +40,15 @@
40#define USB_VID_MSI 0x0db0 40#define USB_VID_MSI 0x0db0
41#define USB_VID_OPERA1 0x695c 41#define USB_VID_OPERA1 0x695c
42#define USB_VID_PINNACLE 0x2304 42#define USB_VID_PINNACLE 0x2304
43#define USB_VID_TECHNOTREND 0x0b48
43#define USB_VID_TERRATEC 0x0ccd 44#define USB_VID_TERRATEC 0x0ccd
44#define USB_VID_VISIONPLUS 0x13d3 45#define USB_VID_VISIONPLUS 0x13d3
45#define USB_VID_TWINHAN 0x1822 46#define USB_VID_TWINHAN 0x1822
46#define USB_VID_ULTIMA_ELECTRONIC 0x05d8 47#define USB_VID_ULTIMA_ELECTRONIC 0x05d8
47#define USB_VID_UNIWILL 0x1584 48#define USB_VID_UNIWILL 0x1584
48#define USB_VID_WIDEVIEW 0x14aa 49#define USB_VID_WIDEVIEW 0x14aa
49/* dom : pour gigabyte u7000 */
50#define USB_VID_GIGABYTE 0x1044 50#define USB_VID_GIGABYTE 0x1044
51#define USB_VID_YUAN 0x1164
51 52
52 53
53/* Product IDs */ 54/* Product IDs */
@@ -134,10 +135,17 @@
134#define USB_PID_AVERMEDIA_EXPRESS 0xb568 135#define USB_PID_AVERMEDIA_EXPRESS 0xb568
135#define USB_PID_AVERMEDIA_VOLAR 0xa807 136#define USB_PID_AVERMEDIA_VOLAR 0xa807
136#define USB_PID_AVERMEDIA_VOLAR_2 0xb808 137#define USB_PID_AVERMEDIA_VOLAR_2 0xb808
138#define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006
137#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a 139#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a
140#define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058
141#define USB_PID_TERRATEC_CINERGY_HT_EXPRESS 0x0060
142#define USB_PID_TERRATEC_CINERGY_T_XXS 0x0078
143#define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
138#define USB_PID_PINNACLE_PCTV2000E 0x022c 144#define USB_PID_PINNACLE_PCTV2000E 0x022c
139#define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228 145#define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228
140#define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229 146#define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229
147#define USB_PID_PINNACLE_PCTV72E 0x0236
148#define USB_PID_PINNACLE_PCTV73E 0x0237
141#define USB_PID_PCTV_200E 0x020e 149#define USB_PID_PCTV_200E 0x020e
142#define USB_PID_PCTV_400E 0x020f 150#define USB_PID_PCTV_400E 0x020f
143#define USB_PID_PCTV_450E 0x0222 151#define USB_PID_PCTV_450E 0x0222
@@ -172,6 +180,7 @@
172#define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025 180#define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025
173#define USB_PID_WINFAST_DTV_DONGLE_WARM 0x6026 181#define USB_PID_WINFAST_DTV_DONGLE_WARM 0x6026
174#define USB_PID_WINFAST_DTV_DONGLE_STK7700P 0x6f00 182#define USB_PID_WINFAST_DTV_DONGLE_STK7700P 0x6f00
183#define USB_PID_WINFAST_DTV_DONGLE_STK7700P_2 0x6f01
175#define USB_PID_GENPIX_8PSK_REV_1_COLD 0x0200 184#define USB_PID_GENPIX_8PSK_REV_1_COLD 0x0200
176#define USB_PID_GENPIX_8PSK_REV_1_WARM 0x0201 185#define USB_PID_GENPIX_8PSK_REV_1_WARM 0x0201
177#define USB_PID_GENPIX_8PSK_REV_2 0x0202 186#define USB_PID_GENPIX_8PSK_REV_2 0x0202
@@ -183,9 +192,9 @@
183#define USB_PID_OPERA1_WARM 0x3829 192#define USB_PID_OPERA1_WARM 0x3829
184#define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514 193#define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514
185#define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513 194#define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513
186/* dom pour gigabyte u7000 */
187#define USB_PID_GIGABYTE_U7000 0x7001 195#define USB_PID_GIGABYTE_U7000 0x7001
188#define USB_PID_ASUS_U3000 0x171f 196#define USB_PID_ASUS_U3000 0x171f
189#define USB_PID_ASUS_U3100 0x173f 197#define USB_PID_ASUS_U3100 0x173f
198#define USB_PID_YUAN_EC372S 0x1edc
190 199
191#endif 200#endif
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index cdd717c3fe45..e331db8c77b2 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -26,7 +26,7 @@ static int dvb_usb_force_pid_filter_usage;
26module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444); 26module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
27MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0)."); 27MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
28 28
29static int dvb_usb_adapter_init(struct dvb_usb_device *d) 29static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
30{ 30{
31 struct dvb_usb_adapter *adap; 31 struct dvb_usb_adapter *adap;
32 int ret,n; 32 int ret,n;
@@ -72,7 +72,7 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d)
72 } 72 }
73 73
74 if ((ret = dvb_usb_adapter_stream_init(adap)) || 74 if ((ret = dvb_usb_adapter_stream_init(adap)) ||
75 (ret = dvb_usb_adapter_dvb_init(adap)) || 75 (ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
76 (ret = dvb_usb_adapter_frontend_init(adap))) { 76 (ret = dvb_usb_adapter_frontend_init(adap))) {
77 return ret; 77 return ret;
78 } 78 }
@@ -122,7 +122,7 @@ static int dvb_usb_exit(struct dvb_usb_device *d)
122 return 0; 122 return 0;
123} 123}
124 124
125static int dvb_usb_init(struct dvb_usb_device *d) 125static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
126{ 126{
127 int ret = 0; 127 int ret = 0;
128 128
@@ -143,7 +143,7 @@ static int dvb_usb_init(struct dvb_usb_device *d)
143 dvb_usb_device_power_ctrl(d, 1); 143 dvb_usb_device_power_ctrl(d, 1);
144 144
145 if ((ret = dvb_usb_i2c_init(d)) || 145 if ((ret = dvb_usb_i2c_init(d)) ||
146 (ret = dvb_usb_adapter_init(d))) { 146 (ret = dvb_usb_adapter_init(d, adapter_nums))) {
147 dvb_usb_exit(d); 147 dvb_usb_exit(d);
148 return ret; 148 return ret;
149 } 149 }
@@ -213,8 +213,10 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
213/* 213/*
214 * USB 214 * USB
215 */ 215 */
216int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_properties 216int dvb_usb_device_init(struct usb_interface *intf,
217 *props, struct module *owner,struct dvb_usb_device **du) 217 struct dvb_usb_device_properties *props,
218 struct module *owner, struct dvb_usb_device **du,
219 short *adapter_nums)
218{ 220{
219 struct usb_device *udev = interface_to_usbdev(intf); 221 struct usb_device *udev = interface_to_usbdev(intf);
220 struct dvb_usb_device *d = NULL; 222 struct dvb_usb_device *d = NULL;
@@ -254,7 +256,7 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_proper
254 if (du != NULL) 256 if (du != NULL)
255 *du = d; 257 *du = d;
256 258
257 ret = dvb_usb_init(d); 259 ret = dvb_usb_init(d, adapter_nums);
258 260
259 if (ret == 0) 261 if (ret == 0)
260 info("%s successfully initialized and connected.",desc->name); 262 info("%s successfully initialized and connected.",desc->name);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index d1b3c7b81fff..b1de0f7e26e8 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -372,7 +372,10 @@ struct dvb_usb_device {
372 void *priv; 372 void *priv;
373}; 373};
374 374
375extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **); 375extern int dvb_usb_device_init(struct usb_interface *,
376 struct dvb_usb_device_properties *,
377 struct module *, struct dvb_usb_device **,
378 short *adapter_nums);
376extern void dvb_usb_device_exit(struct usb_interface *); 379extern void dvb_usb_device_exit(struct usb_interface *);
377 380
378/* the generic read/write method for device control */ 381/* the generic read/write method for device control */
diff --git a/drivers/media/dvb/dvb-usb/gl861.c b/drivers/media/dvb/dvb-usb/gl861.c
index 6b99d9f4d5b3..0a8ac64a4e33 100644
--- a/drivers/media/dvb/dvb-usb/gl861.c
+++ b/drivers/media/dvb/dvb-usb/gl861.c
@@ -16,6 +16,8 @@ static int dvb_usb_gl861_debug;
16module_param_named(debug,dvb_usb_gl861_debug, int, 0644); 16module_param_named(debug,dvb_usb_gl861_debug, int, 0644);
17MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); 17MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
18 18
19DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
20
19static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr, 21static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
20 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) 22 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
21{ 23{
@@ -140,7 +142,9 @@ static int gl861_probe(struct usb_interface *intf,
140 if (intf->num_altsetting < 2) 142 if (intf->num_altsetting < 2)
141 return -ENODEV; 143 return -ENODEV;
142 144
143 if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d)) == 0) { 145 ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d,
146 adapter_nr);
147 if (ret == 0) {
144 alt = usb_altnum_to_altsetting(intf, 0); 148 alt = usb_altnum_to_altsetting(intf, 0);
145 149
146 if (alt == NULL) { 150 if (alt == NULL) {
diff --git a/drivers/media/dvb/dvb-usb/gp8psk-fe.c b/drivers/media/dvb/dvb-usb/gp8psk-fe.c
index e37142d9271a..262a858c3068 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk-fe.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk-fe.c
@@ -152,7 +152,7 @@ static int gp8psk_fe_send_diseqc_msg (struct dvb_frontend* fe,
152{ 152{
153 struct gp8psk_fe_state *st = fe->demodulator_priv; 153 struct gp8psk_fe_state *st = fe->demodulator_priv;
154 154
155 deb_fe("%s\n",__FUNCTION__); 155 deb_fe("%s\n",__func__);
156 156
157 if (gp8psk_usb_out_op(st->d,SEND_DISEQC_COMMAND, m->msg[0], 0, 157 if (gp8psk_usb_out_op(st->d,SEND_DISEQC_COMMAND, m->msg[0], 0,
158 m->msg, m->msg_len)) { 158 m->msg, m->msg_len)) {
@@ -167,7 +167,7 @@ static int gp8psk_fe_send_diseqc_burst (struct dvb_frontend* fe,
167 struct gp8psk_fe_state *st = fe->demodulator_priv; 167 struct gp8psk_fe_state *st = fe->demodulator_priv;
168 u8 cmd; 168 u8 cmd;
169 169
170 deb_fe("%s\n",__FUNCTION__); 170 deb_fe("%s\n",__func__);
171 171
172 /* These commands are certainly wrong */ 172 /* These commands are certainly wrong */
173 cmd = (burst == SEC_MINI_A) ? 0x00 : 0x01; 173 cmd = (burst == SEC_MINI_A) ? 0x00 : 0x01;
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c
index 83e8535014c6..9a942afaf0af 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -22,6 +22,8 @@ int dvb_usb_gp8psk_debug;
22module_param_named(debug,dvb_usb_gp8psk_debug, int, 0644); 22module_param_named(debug,dvb_usb_gp8psk_debug, int, 0644);
23MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS); 23MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
24 24
25DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
26
25int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) 27int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
26{ 28{
27 int ret = 0,try = 0; 29 int ret = 0,try = 0;
@@ -190,7 +192,8 @@ static int gp8psk_usb_probe(struct usb_interface *intf,
190{ 192{
191 int ret; 193 int ret;
192 struct usb_device *udev = interface_to_usbdev(intf); 194 struct usb_device *udev = interface_to_usbdev(intf);
193 ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL); 195 ret = dvb_usb_device_init(intf, &gp8psk_properties,
196 THIS_MODULE, NULL, adapter_nr);
194 if (ret == 0) { 197 if (ret == 0) {
195 info("found Genpix USB device pID = %x (hex)", 198 info("found Genpix USB device pID = %x (hex)",
196 le16_to_cpu(udev->descriptor.idProduct)); 199 le16_to_cpu(udev->descriptor.idProduct));
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c
index a956bc503a4c..a12e6f784fda 100644
--- a/drivers/media/dvb/dvb-usb/m920x.c
+++ b/drivers/media/dvb/dvb-usb/m920x.c
@@ -22,6 +22,8 @@ static int dvb_usb_m920x_debug;
22module_param_named(debug,dvb_usb_m920x_debug, int, 0644); 22module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
23MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); 23MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
24 24
25DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
26
25static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid); 27static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
26 28
27static inline int m920x_read(struct usb_device *udev, u8 request, u16 value, 29static inline int m920x_read(struct usb_device *udev, u8 request, u16 value,
@@ -477,7 +479,7 @@ static struct qt1010_config m920x_qt1010_config = {
477/* Callbacks for DVB USB */ 479/* Callbacks for DVB USB */
478static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap) 480static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
479{ 481{
480 deb("%s\n",__FUNCTION__); 482 deb("%s\n",__func__);
481 483
482 if ((adap->fe = dvb_attach(mt352_attach, 484 if ((adap->fe = dvb_attach(mt352_attach,
483 &m920x_mt352_config, 485 &m920x_mt352_config,
@@ -489,7 +491,7 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
489 491
490static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap) 492static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
491{ 493{
492 deb("%s\n",__FUNCTION__); 494 deb("%s\n",__func__);
493 495
494 if ((adap->fe = dvb_attach(tda10046_attach, 496 if ((adap->fe = dvb_attach(tda10046_attach,
495 &m920x_tda10046_08_config, 497 &m920x_tda10046_08_config,
@@ -501,7 +503,7 @@ static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
501 503
502static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap) 504static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
503{ 505{
504 deb("%s\n",__FUNCTION__); 506 deb("%s\n",__func__);
505 507
506 if ((adap->fe = dvb_attach(tda10046_attach, 508 if ((adap->fe = dvb_attach(tda10046_attach,
507 &m920x_tda10046_0b_config, 509 &m920x_tda10046_0b_config,
@@ -513,7 +515,7 @@ static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
513 515
514static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap) 516static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
515{ 517{
516 deb("%s\n",__FUNCTION__); 518 deb("%s\n",__func__);
517 519
518 if (dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL) 520 if (dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
519 return -ENODEV; 521 return -ENODEV;
@@ -523,7 +525,7 @@ static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
523 525
524static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap) 526static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
525{ 527{
526 deb("%s\n",__FUNCTION__); 528 deb("%s\n",__func__);
527 529
528 if (dvb_attach(tda827x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL) 530 if (dvb_attach(tda827x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL)
529 return -ENODEV; 531 return -ENODEV;
@@ -533,7 +535,7 @@ static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
533 535
534static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap) 536static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
535{ 537{
536 deb("%s\n",__FUNCTION__); 538 deb("%s\n",__func__);
537 539
538 if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL) 540 if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
539 return -ENODEV; 541 return -ENODEV;
@@ -618,27 +620,31 @@ static int m920x_probe(struct usb_interface *intf,
618 * multi-tuner device 620 * multi-tuner device
619 */ 621 */
620 622
621 if ((ret = dvb_usb_device_init(intf, &megasky_properties, 623 ret = dvb_usb_device_init(intf, &megasky_properties,
622 THIS_MODULE, &d)) == 0) { 624 THIS_MODULE, &d, adapter_nr);
625 if (ret == 0) {
623 rc_init_seq = megasky_rc_init; 626 rc_init_seq = megasky_rc_init;
624 goto found; 627 goto found;
625 } 628 }
626 629
627 if ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties, 630 ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
628 THIS_MODULE, &d)) == 0) { 631 THIS_MODULE, &d, adapter_nr);
632 if (ret == 0) {
629 /* No remote control, so no rc_init_seq */ 633 /* No remote control, so no rc_init_seq */
630 goto found; 634 goto found;
631 } 635 }
632 636
633 /* This configures both tuners on the TV Walker Twin */ 637 /* This configures both tuners on the TV Walker Twin */
634 if ((ret = dvb_usb_device_init(intf, &tvwalkertwin_properties, 638 ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
635 THIS_MODULE, &d)) == 0) { 639 THIS_MODULE, &d, adapter_nr);
640 if (ret == 0) {
636 rc_init_seq = tvwalkertwin_rc_init; 641 rc_init_seq = tvwalkertwin_rc_init;
637 goto found; 642 goto found;
638 } 643 }
639 644
640 if ((ret = dvb_usb_device_init(intf, &dposh_properties, 645 ret = dvb_usb_device_init(intf, &dposh_properties,
641 THIS_MODULE, &d)) == 0) { 646 THIS_MODULE, &d, adapter_nr);
647 if (ret == 0) {
642 /* Remote controller not supported yet. */ 648 /* Remote controller not supported yet. */
643 goto found; 649 goto found;
644 } 650 }
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
index badc468170ea..07fb843c7c2b 100644
--- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -15,6 +15,8 @@ static int debug;
15module_param(debug, int, 0644); 15module_param(debug, int, 0644);
16MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS); 16MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS);
17 17
18DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
19
18#define deb_rc(args...) dprintk(debug,0x01,args) 20#define deb_rc(args...) dprintk(debug,0x01,args)
19#define deb_ee(args...) dprintk(debug,0x02,args) 21#define deb_ee(args...) dprintk(debug,0x02,args)
20 22
@@ -142,7 +144,8 @@ static struct dvb_usb_device_properties nova_t_properties;
142static int nova_t_probe(struct usb_interface *intf, 144static int nova_t_probe(struct usb_interface *intf,
143 const struct usb_device_id *id) 145 const struct usb_device_id *id)
144{ 146{
145 return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL); 147 return dvb_usb_device_init(intf, &nova_t_properties,
148 THIS_MODULE, NULL, adapter_nr);
146} 149}
147 150
148/* do not change the order of the ID table */ 151/* do not change the order of the ID table */
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c
index 302cc67407c3..7e32d11f32b0 100644
--- a/drivers/media/dvb/dvb-usb/opera1.c
+++ b/drivers/media/dvb/dvb-usb/opera1.c
@@ -46,6 +46,9 @@ MODULE_PARM_DESC(debug,
46 "set debugging level (1=info,xfer=2,pll=4,ts=8,err=16,rc=32,fw=64 (or-able))." 46 "set debugging level (1=info,xfer=2,pll=4,ts=8,err=16,rc=32,fw=64 (or-able))."
47 DVB_USB_DEBUG_STATUS); 47 DVB_USB_DEBUG_STATUS);
48 48
49DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
50
51
49static int opera1_xilinx_rw(struct usb_device *dev, u8 request, u16 value, 52static int opera1_xilinx_rw(struct usb_device *dev, u8 request, u16 value,
50 u8 * data, u16 len, int flags) 53 u8 * data, u16 len, int flags)
51{ 54{
@@ -243,7 +246,7 @@ static struct stv0299_config opera1_stv0299_config = {
243 .mclk = 88000000UL, 246 .mclk = 88000000UL,
244 .invert = 1, 247 .invert = 1,
245 .skip_reinit = 0, 248 .skip_reinit = 0,
246 .lock_output = STV0229_LOCKOUTPUT_0, 249 .lock_output = STV0299_LOCKOUTPUT_0,
247 .volt13_op0_op1 = STV0299_VOLT13_OP0, 250 .volt13_op0_op1 = STV0299_VOLT13_OP0,
248 .inittab = opera1_inittab, 251 .inittab = opera1_inittab,
249 .set_symbol_rate = opera1_stv0299_set_symbol_rate, 252 .set_symbol_rate = opera1_stv0299_set_symbol_rate,
@@ -548,7 +551,8 @@ static int opera1_probe(struct usb_interface *intf,
548 return -EINVAL; 551 return -EINVAL;
549 } 552 }
550 553
551 if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0) 554 if (0 != dvb_usb_device_init(intf, &opera1_properties,
555 THIS_MODULE, NULL, adapter_nr))
552 return -EINVAL; 556 return -EINVAL;
553 return 0; 557 return 0;
554} 558}
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c
index 3b9da9c25c6e..20ca9d9ee99b 100644
--- a/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -37,6 +37,8 @@ static int dvb_usb_ttusb2_debug;
37module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644); 37module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644);
38MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS); 38MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
39 39
40DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
41
40struct ttusb2_state { 42struct ttusb2_state {
41 u8 id; 43 u8 id;
42}; 44};
@@ -145,6 +147,7 @@ static struct tda10086_config tda10086_config = {
145 .demod_address = 0x0e, 147 .demod_address = 0x0e,
146 .invert = 0, 148 .invert = 0,
147 .diseqc_tone = 1, 149 .diseqc_tone = 1,
150 .xtal_freq = TDA10086_XTAL_16M,
148}; 151};
149 152
150static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap) 153static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap)
@@ -176,17 +179,25 @@ static int ttusb2_tuner_attach(struct dvb_usb_adapter *adap)
176 179
177/* DVB USB Driver stuff */ 180/* DVB USB Driver stuff */
178static struct dvb_usb_device_properties ttusb2_properties; 181static struct dvb_usb_device_properties ttusb2_properties;
182static struct dvb_usb_device_properties ttusb2_properties_s2400;
179 183
180static int ttusb2_probe(struct usb_interface *intf, 184static int ttusb2_probe(struct usb_interface *intf,
181 const struct usb_device_id *id) 185 const struct usb_device_id *id)
182{ 186{
183 return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL); 187 if (0 == dvb_usb_device_init(intf, &ttusb2_properties,
188 THIS_MODULE, NULL, adapter_nr) ||
189 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400,
190 THIS_MODULE, NULL, adapter_nr))
191 return 0;
192 return -ENODEV;
184} 193}
185 194
186static struct usb_device_id ttusb2_table [] = { 195static struct usb_device_id ttusb2_table [] = {
187 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_400E) }, 196 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_400E) },
188 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) }, 197 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) },
189 {} /* Terminating entry */ 198 { USB_DEVICE(USB_VID_TECHNOTREND,
199 USB_PID_TECHNOTREND_CONNECT_S2400) },
200 {} /* Terminating entry */
190}; 201};
191MODULE_DEVICE_TABLE (usb, ttusb2_table); 202MODULE_DEVICE_TABLE (usb, ttusb2_table);
192 203
@@ -242,6 +253,54 @@ static struct dvb_usb_device_properties ttusb2_properties = {
242 } 253 }
243}; 254};
244 255
256static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
257 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
258
259 .usb_ctrl = CYPRESS_FX2,
260 .firmware = "dvb-usb-tt-s2400-01.fw",
261
262 .size_of_priv = sizeof(struct ttusb2_state),
263
264 .num_adapters = 1,
265 .adapter = {
266 {
267 .streaming_ctrl = NULL,
268
269 .frontend_attach = ttusb2_frontend_attach,
270 .tuner_attach = ttusb2_tuner_attach,
271
272 /* parameter for the MPEG2-data transfer */
273 .stream = {
274 .type = USB_ISOC,
275 .count = 5,
276 .endpoint = 0x02,
277 .u = {
278 .isoc = {
279 .framesperurb = 4,
280 .framesize = 940,
281 .interval = 1,
282 }
283 }
284 }
285 }
286 },
287
288 .power_ctrl = ttusb2_power_ctrl,
289 .identify_state = ttusb2_identify_state,
290
291 .i2c_algo = &ttusb2_i2c_algo,
292
293 .generic_bulk_ctrl_endpoint = 0x01,
294
295 .num_device_descs = 1,
296 .devices = {
297 { "Technotrend TT-connect S-2400",
298 { &ttusb2_table[2], NULL },
299 { NULL },
300 },
301 }
302};
303
245static struct usb_driver ttusb2_driver = { 304static struct usb_driver ttusb2_driver = {
246 .name = "dvb_usb_ttusb2", 305 .name = "dvb_usb_ttusb2",
247 .probe = ttusb2_probe, 306 .probe = ttusb2_probe,
diff --git a/drivers/media/dvb/dvb-usb/umt-010.c b/drivers/media/dvb/dvb-usb/umt-010.c
index 0dcab3d4e236..9e7653bb3b66 100644
--- a/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/drivers/media/dvb/dvb-usb/umt-010.c
@@ -13,6 +13,8 @@
13 13
14#include "mt352.h" 14#include "mt352.h"
15 15
16DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
17
16static int umt_mt352_demod_init(struct dvb_frontend *fe) 18static int umt_mt352_demod_init(struct dvb_frontend *fe)
17{ 19{
18 static u8 mt352_clock_config[] = { 0x89, 0xb8, 0x2d }; 20 static u8 mt352_clock_config[] = { 0x89, 0xb8, 0x2d };
@@ -75,7 +77,8 @@ static struct dvb_usb_device_properties umt_properties;
75static int umt_probe(struct usb_interface *intf, 77static int umt_probe(struct usb_interface *intf,
76 const struct usb_device_id *id) 78 const struct usb_device_id *id)
77{ 79{
78 if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL) == 0) 80 if (0 == dvb_usb_device_init(intf, &umt_properties,
81 THIS_MODULE, NULL, adapter_nr))
79 return 0; 82 return 0;
80 return -EINVAL; 83 return -EINVAL;
81} 84}
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c
index c3fdc7cd094e..ccc7e4452664 100644
--- a/drivers/media/dvb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c
@@ -67,7 +67,7 @@ static int vp702x_fe_read_status(struct dvb_frontend* fe, fe_status_t *status)
67{ 67{
68 struct vp702x_fe_state *st = fe->demodulator_priv; 68 struct vp702x_fe_state *st = fe->demodulator_priv;
69 vp702x_fe_refresh_state(st); 69 vp702x_fe_refresh_state(st);
70 deb_fe("%s\n",__FUNCTION__); 70 deb_fe("%s\n",__func__);
71 71
72 if (st->lock == 0) 72 if (st->lock == 0)
73 *status = FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI | FE_HAS_SIGNAL | FE_HAS_CARRIER; 73 *status = FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI | FE_HAS_SIGNAL | FE_HAS_CARRIER;
@@ -121,7 +121,7 @@ static int vp702x_fe_read_snr(struct dvb_frontend* fe, u16 *snr)
121 121
122static int vp702x_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) 122static int vp702x_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune)
123{ 123{
124 deb_fe("%s\n",__FUNCTION__); 124 deb_fe("%s\n",__func__);
125 tune->min_delay_ms = 2000; 125 tune->min_delay_ms = 2000;
126 return 0; 126 return 0;
127} 127}
@@ -183,21 +183,21 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
183static int vp702x_fe_init(struct dvb_frontend *fe) 183static int vp702x_fe_init(struct dvb_frontend *fe)
184{ 184{
185 struct vp702x_fe_state *st = fe->demodulator_priv; 185 struct vp702x_fe_state *st = fe->demodulator_priv;
186 deb_fe("%s\n",__FUNCTION__); 186 deb_fe("%s\n",__func__);
187 vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0); 187 vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0);
188 return 0; 188 return 0;
189} 189}
190 190
191static int vp702x_fe_sleep(struct dvb_frontend *fe) 191static int vp702x_fe_sleep(struct dvb_frontend *fe)
192{ 192{
193 deb_fe("%s\n",__FUNCTION__); 193 deb_fe("%s\n",__func__);
194 return 0; 194 return 0;
195} 195}
196 196
197static int vp702x_fe_get_frontend(struct dvb_frontend* fe, 197static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
198 struct dvb_frontend_parameters *fep) 198 struct dvb_frontend_parameters *fep)
199{ 199{
200 deb_fe("%s\n",__FUNCTION__); 200 deb_fe("%s\n",__func__);
201 return 0; 201 return 0;
202} 202}
203 203
@@ -208,7 +208,7 @@ static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
208 u8 cmd[8],ibuf[10]; 208 u8 cmd[8],ibuf[10];
209 memset(cmd,0,8); 209 memset(cmd,0,8);
210 210
211 deb_fe("%s\n",__FUNCTION__); 211 deb_fe("%s\n",__func__);
212 212
213 if (m->msg_len > 4) 213 if (m->msg_len > 4)
214 return -EINVAL; 214 return -EINVAL;
@@ -230,7 +230,7 @@ static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
230 230
231static int vp702x_fe_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) 231static int vp702x_fe_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)
232{ 232{
233 deb_fe("%s\n",__FUNCTION__); 233 deb_fe("%s\n",__func__);
234 return 0; 234 return 0;
235} 235}
236 236
@@ -238,7 +238,7 @@ static int vp702x_fe_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
238{ 238{
239 struct vp702x_fe_state *st = fe->demodulator_priv; 239 struct vp702x_fe_state *st = fe->demodulator_priv;
240 u8 ibuf[10]; 240 u8 ibuf[10];
241 deb_fe("%s\n",__FUNCTION__); 241 deb_fe("%s\n",__func__);
242 242
243 st->tone_mode = tone; 243 st->tone_mode = tone;
244 244
@@ -263,7 +263,7 @@ static int vp702x_fe_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t
263{ 263{
264 struct vp702x_fe_state *st = fe->demodulator_priv; 264 struct vp702x_fe_state *st = fe->demodulator_priv;
265 u8 ibuf[10]; 265 u8 ibuf[10];
266 deb_fe("%s\n",__FUNCTION__); 266 deb_fe("%s\n",__func__);
267 267
268 st->voltage = voltage; 268 st->voltage = voltage;
269 269
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c
index e553c139ac44..986fff9a5ba8 100644
--- a/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/drivers/media/dvb/dvb-usb/vp702x.c
@@ -21,6 +21,8 @@ int dvb_usb_vp702x_debug;
21module_param_named(debug,dvb_usb_vp702x_debug, int, 0644); 21module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
22MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS); 22MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
23 23
24DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
25
24struct vp702x_state { 26struct vp702x_state {
25 int pid_filter_count; 27 int pid_filter_count;
26 int pid_filter_can_bypass; 28 int pid_filter_can_bypass;
@@ -238,7 +240,8 @@ static struct dvb_usb_device_properties vp702x_properties;
238static int vp702x_usb_probe(struct usb_interface *intf, 240static int vp702x_usb_probe(struct usb_interface *intf,
239 const struct usb_device_id *id) 241 const struct usb_device_id *id)
240{ 242{
241 return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL); 243 return dvb_usb_device_init(intf, &vp702x_properties,
244 THIS_MODULE, NULL, adapter_nr);
242} 245}
243 246
244static struct usb_device_id vp702x_usb_table [] = { 247static struct usb_device_id vp702x_usb_table [] = {
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c
index c172babf59bb..acb345504e0d 100644
--- a/drivers/media/dvb/dvb-usb/vp7045.c
+++ b/drivers/media/dvb/dvb-usb/vp7045.c
@@ -18,6 +18,9 @@
18static int dvb_usb_vp7045_debug; 18static int dvb_usb_vp7045_debug;
19module_param_named(debug,dvb_usb_vp7045_debug, int, 0644); 19module_param_named(debug,dvb_usb_vp7045_debug, int, 0644);
20MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS); 20MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
21
22DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
23
21#define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args) 24#define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
22#define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args) 25#define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
23#define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args) 26#define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args)
@@ -219,7 +222,8 @@ static struct dvb_usb_device_properties vp7045_properties;
219static int vp7045_usb_probe(struct usb_interface *intf, 222static int vp7045_usb_probe(struct usb_interface *intf,
220 const struct usb_device_id *id) 223 const struct usb_device_id *id)
221{ 224{
222 return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL); 225 return dvb_usb_device_init(intf, &vp7045_properties,
226 THIS_MODULE, NULL, adapter_nr);
223} 227}
224 228
225static struct usb_device_id vp7045_usb_table [] = { 229static struct usb_device_id vp7045_usb_table [] = {