aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/dvb-usb')
-rw-r--r--drivers/media/usb/dvb-usb/Kconfig8
-rw-r--r--drivers/media/usb/dvb-usb/dib0700_core.c5
-rw-r--r--drivers/media/usb/dvb-usb/dvb-usb-init.c60
-rw-r--r--drivers/media/usb/dvb-usb/dw2102.c179
-rw-r--r--drivers/media/usb/dvb-usb/friio-fe.c5
-rw-r--r--drivers/media/usb/dvb-usb/m920x.c277
-rw-r--r--drivers/media/usb/dvb-usb/ttusb2.c8
7 files changed, 433 insertions, 109 deletions
diff --git a/drivers/media/usb/dvb-usb/Kconfig b/drivers/media/usb/dvb-usb/Kconfig
index fa0b2931d305..c5d95662e2e1 100644
--- a/drivers/media/usb/dvb-usb/Kconfig
+++ b/drivers/media/usb/dvb-usb/Kconfig
@@ -202,8 +202,12 @@ config DVB_USB_TTUSB2
202 select DVB_TDA10086 if MEDIA_SUBDRV_AUTOSELECT 202 select DVB_TDA10086 if MEDIA_SUBDRV_AUTOSELECT
203 select DVB_LNBP21 if MEDIA_SUBDRV_AUTOSELECT 203 select DVB_LNBP21 if MEDIA_SUBDRV_AUTOSELECT
204 select DVB_TDA826X if MEDIA_SUBDRV_AUTOSELECT 204 select DVB_TDA826X if MEDIA_SUBDRV_AUTOSELECT
205 select DVB_TDA10023 if MEDIA_SUBDRV_AUTOSELECT
206 select DVB_TDA10048 if MEDIA_SUBDRV_AUTOSELECT
207 select MEDIA_TUNER_TDA827X if MEDIA_SUBDRV_AUTOSELECT
205 help 208 help
206 Say Y here to support the Pinnacle 400e DVB-S USB2.0 receiver. The 209 Say Y here to support the Pinnacle 400e DVB-S USB2.0 receiver and
210 the TechnoTrend CT-3650 CI DVB-C/T USB2.0 receiver. The
207 firmware protocol used by this module is similar to the one used by the 211 firmware protocol used by this module is similar to the one used by the
208 old ttusb-driver - that's why the module is called dvb-usb-ttusb2. 212 old ttusb-driver - that's why the module is called dvb-usb-ttusb2.
209 213
@@ -267,9 +271,11 @@ config DVB_USB_DW2102
267 select DVB_MT312 if MEDIA_SUBDRV_AUTOSELECT 271 select DVB_MT312 if MEDIA_SUBDRV_AUTOSELECT
268 select DVB_ZL10039 if MEDIA_SUBDRV_AUTOSELECT 272 select DVB_ZL10039 if MEDIA_SUBDRV_AUTOSELECT
269 select DVB_DS3000 if MEDIA_SUBDRV_AUTOSELECT 273 select DVB_DS3000 if MEDIA_SUBDRV_AUTOSELECT
274 select DVB_TS2020 if MEDIA_SUBDRV_AUTOSELECT
270 select DVB_STB6100 if MEDIA_SUBDRV_AUTOSELECT 275 select DVB_STB6100 if MEDIA_SUBDRV_AUTOSELECT
271 select DVB_STV6110 if MEDIA_SUBDRV_AUTOSELECT 276 select DVB_STV6110 if MEDIA_SUBDRV_AUTOSELECT
272 select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT 277 select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT
278 select DVB_M88RS2000 if MEDIA_SUBDRV_AUTOSELECT
273 help 279 help
274 Say Y here to support the DvbWorld, TeVii, Prof DVB-S/S2 USB2.0 280 Say Y here to support the DvbWorld, TeVii, Prof DVB-S/S2 USB2.0
275 receivers. 281 receivers.
diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c
index 19b5ed2825d7..bf2a908d74cf 100644
--- a/drivers/media/usb/dvb-usb/dib0700_core.c
+++ b/drivers/media/usb/dvb-usb/dib0700_core.c
@@ -561,10 +561,7 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
561 } 561 }
562 } 562 }
563 563
564 if (mutex_lock_interruptible(&adap->dev->usb_mutex) < 0) { 564 mutex_lock(&adap->dev->usb_mutex);
565 err("could not acquire lock");
566 return -EINTR;
567 }
568 565
569 st->buf[0] = REQUEST_ENABLE_VIDEO; 566 st->buf[0] = REQUEST_ENABLE_VIDEO;
570 /* this bit gives a kind of command, 567 /* this bit gives a kind of command,
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
index 169196ec2d4e..1adf325012f7 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
@@ -38,41 +38,41 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
38 38
39 memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties)); 39 memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties));
40 40
41 for (o = 0; o < adap->props.num_frontends; o++) { 41 for (o = 0; o < adap->props.num_frontends; o++) {
42 struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o]; 42 struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
43 /* speed - when running at FULL speed we need a HW PID filter */ 43 /* speed - when running at FULL speed we need a HW PID filter */
44 if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) { 44 if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
45 err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)"); 45 err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
46 return -ENODEV; 46 return -ENODEV;
47 } 47 }
48 48
49 if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) || 49 if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
50 (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) { 50 (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
51 info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count); 51 info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
52 adap->fe_adap[o].pid_filtering = 1; 52 adap->fe_adap[o].pid_filtering = 1;
53 adap->fe_adap[o].max_feed_count = props->pid_filter_count; 53 adap->fe_adap[o].max_feed_count = props->pid_filter_count;
54 } else { 54 } else {
55 info("will pass the complete MPEG2 transport stream to the software demuxer."); 55 info("will pass the complete MPEG2 transport stream to the software demuxer.");
56 adap->fe_adap[o].pid_filtering = 0; 56 adap->fe_adap[o].pid_filtering = 0;
57 adap->fe_adap[o].max_feed_count = 255; 57 adap->fe_adap[o].max_feed_count = 255;
58 } 58 }
59 59
60 if (!adap->fe_adap[o].pid_filtering && 60 if (!adap->fe_adap[o].pid_filtering &&
61 dvb_usb_force_pid_filter_usage && 61 dvb_usb_force_pid_filter_usage &&
62 props->caps & DVB_USB_ADAP_HAS_PID_FILTER) { 62 props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
63 info("pid filter enabled by module option."); 63 info("pid filter enabled by module option.");
64 adap->fe_adap[o].pid_filtering = 1; 64 adap->fe_adap[o].pid_filtering = 1;
65 adap->fe_adap[o].max_feed_count = props->pid_filter_count; 65 adap->fe_adap[o].max_feed_count = props->pid_filter_count;
66 } 66 }
67 67
68 if (props->size_of_priv > 0) { 68 if (props->size_of_priv > 0) {
69 adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL); 69 adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
70 if (adap->fe_adap[o].priv == NULL) { 70 if (adap->fe_adap[o].priv == NULL) {
71 err("no memory for priv for adapter %d fe %d.", n, o); 71 err("no memory for priv for adapter %d fe %d.", n, o);
72 return -ENOMEM; 72 return -ENOMEM;
73 }
73 } 74 }
74 } 75 }
75 }
76 76
77 if (adap->props.size_of_priv > 0) { 77 if (adap->props.size_of_priv > 0) {
78 adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL); 78 adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL);
diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index 9382895b1b88..9578a6761f1b 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -1,9 +1,9 @@
1/* DVB USB framework compliant Linux driver for the 1/* DVB USB framework compliant Linux driver for the
2 * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101, 2 * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
3 * TeVii S600, S630, S650, S660, S480, 3 * TeVii S600, S630, S650, S660, S480, S421, S632
4 * Prof 1100, 7500, 4 * Prof 1100, 7500,
5 * Geniatech SU3000 Cards 5 * Geniatech SU3000 Cards
6 * Copyright (C) 2008-2011 Igor M. Liplianin (liplianin@me.by) 6 * Copyright (C) 2008-2012 Igor M. Liplianin (liplianin@me.by)
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -22,11 +22,14 @@
22#include "tda1002x.h" 22#include "tda1002x.h"
23#include "mt312.h" 23#include "mt312.h"
24#include "zl10039.h" 24#include "zl10039.h"
25#include "ts2020.h"
25#include "ds3000.h" 26#include "ds3000.h"
26#include "stv0900.h" 27#include "stv0900.h"
27#include "stv6110.h" 28#include "stv6110.h"
28#include "stb6100.h" 29#include "stb6100.h"
29#include "stb6100_proc.h" 30#include "stb6100_proc.h"
31#include "m88rs2000.h"
32#include "ts2020.h"
30 33
31#ifndef USB_PID_DW2102 34#ifndef USB_PID_DW2102
32#define USB_PID_DW2102 0x2102 35#define USB_PID_DW2102 0x2102
@@ -68,6 +71,14 @@
68#define USB_PID_PROF_1100 0xb012 71#define USB_PID_PROF_1100 0xb012
69#endif 72#endif
70 73
74#ifndef USB_PID_TEVII_S421
75#define USB_PID_TEVII_S421 0xd421
76#endif
77
78#ifndef USB_PID_TEVII_S632
79#define USB_PID_TEVII_S632 0xd632
80#endif
81
71#define DW210X_READ_MSG 0 82#define DW210X_READ_MSG 0
72#define DW210X_WRITE_MSG 1 83#define DW210X_WRITE_MSG 1
73 84
@@ -80,6 +91,15 @@
80#define DW2102_RC_QUERY (0x1a00) 91#define DW2102_RC_QUERY (0x1a00)
81#define DW2102_LED_CTRL (0x1b00) 92#define DW2102_LED_CTRL (0x1b00)
82 93
94#define DW2101_FIRMWARE "dvb-usb-dw2101.fw"
95#define DW2102_FIRMWARE "dvb-usb-dw2102.fw"
96#define DW2104_FIRMWARE "dvb-usb-dw2104.fw"
97#define DW3101_FIRMWARE "dvb-usb-dw3101.fw"
98#define S630_FIRMWARE "dvb-usb-s630.fw"
99#define S660_FIRMWARE "dvb-usb-s660.fw"
100#define P1100_FIRMWARE "dvb-usb-p1100.fw"
101#define P7500_FIRMWARE "dvb-usb-p7500.fw"
102
83#define err_str "did not find the firmware file. (%s) " \ 103#define err_str "did not find the firmware file. (%s) " \
84 "Please see linux/Documentation/dvb/ for more details " \ 104 "Please see linux/Documentation/dvb/ for more details " \
85 "on firmware-problems." 105 "on firmware-problems."
@@ -534,7 +554,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
534 } 554 }
535 /*case 0x55: cx24116 555 /*case 0x55: cx24116
536 case 0x6a: stv0903 556 case 0x6a: stv0903
537 case 0x68: ds3000, stv0903 557 case 0x68: ds3000, stv0903, rs2000
538 case 0x60: ts2020, stv6110, stb6100 558 case 0x60: ts2020, stv6110, stb6100
539 case 0xa0: eeprom */ 559 case 0xa0: eeprom */
540 default: { 560 default: {
@@ -932,6 +952,17 @@ static struct ds3000_config dw2104_ds3000_config = {
932 .demod_address = 0x68, 952 .demod_address = 0x68,
933}; 953};
934 954
955static struct ts2020_config dw2104_ts2020_config = {
956 .tuner_address = 0x60,
957 .clk_out_div = 1,
958};
959
960static struct ds3000_config s660_ds3000_config = {
961 .demod_address = 0x68,
962 .ci_mode = 1,
963 .set_lock_led = dw210x_led_ctrl,
964};
965
935static struct stv0900_config dw2104a_stv0900_config = { 966static struct stv0900_config dw2104a_stv0900_config = {
936 .demod_address = 0x6a, 967 .demod_address = 0x6a,
937 .demod_mode = 0, 968 .demod_mode = 0,
@@ -981,6 +1012,30 @@ static struct stv0900_config prof_7500_stv0900_config = {
981static struct ds3000_config su3000_ds3000_config = { 1012static struct ds3000_config su3000_ds3000_config = {
982 .demod_address = 0x68, 1013 .demod_address = 0x68,
983 .ci_mode = 1, 1014 .ci_mode = 1,
1015 .set_lock_led = dw210x_led_ctrl,
1016};
1017
1018static u8 m88rs2000_inittab[] = {
1019 DEMOD_WRITE, 0x9a, 0x30,
1020 DEMOD_WRITE, 0x00, 0x01,
1021 WRITE_DELAY, 0x19, 0x00,
1022 DEMOD_WRITE, 0x00, 0x00,
1023 DEMOD_WRITE, 0x9a, 0xb0,
1024 DEMOD_WRITE, 0x81, 0xc1,
1025 DEMOD_WRITE, 0x81, 0x81,
1026 DEMOD_WRITE, 0x86, 0xc6,
1027 DEMOD_WRITE, 0x9a, 0x30,
1028 DEMOD_WRITE, 0xf0, 0x80,
1029 DEMOD_WRITE, 0xf1, 0xbf,
1030 DEMOD_WRITE, 0xb0, 0x45,
1031 DEMOD_WRITE, 0xb2, 0x01,
1032 DEMOD_WRITE, 0x9a, 0xb0,
1033 0xff, 0xaa, 0xff
1034};
1035
1036static struct m88rs2000_config s421_m88rs2000_config = {
1037 .demod_addr = 0x68,
1038 .inittab = m88rs2000_inittab,
984}; 1039};
985 1040
986static int dw2104_frontend_attach(struct dvb_usb_adapter *d) 1041static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
@@ -1033,6 +1088,8 @@ static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
1033 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, 1088 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
1034 &d->dev->i2c_adap); 1089 &d->dev->i2c_adap);
1035 if (d->fe_adap[0].fe != NULL) { 1090 if (d->fe_adap[0].fe != NULL) {
1091 dvb_attach(ts2020_attach, d->fe_adap[0].fe,
1092 &dw2104_ts2020_config, &d->dev->i2c_adap);
1036 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; 1093 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1037 info("Attached DS3000!\n"); 1094 info("Attached DS3000!\n");
1038 return 0; 1095 return 0;
@@ -1139,12 +1196,15 @@ static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
1139 struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; 1196 struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
1140 u8 obuf[] = {7, 1}; 1197 u8 obuf[] = {7, 1};
1141 1198
1142 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, 1199 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &s660_ds3000_config,
1143 &d->dev->i2c_adap); 1200 &d->dev->i2c_adap);
1144 1201
1145 if (d->fe_adap[0].fe == NULL) 1202 if (d->fe_adap[0].fe == NULL)
1146 return -EIO; 1203 return -EIO;
1147 1204
1205 dvb_attach(ts2020_attach, d->fe_adap[0].fe, &dw2104_ts2020_config,
1206 &d->dev->i2c_adap);
1207
1148 st->old_set_voltage = d->fe_adap[0].fe->ops.set_voltage; 1208 st->old_set_voltage = d->fe_adap[0].fe->ops.set_voltage;
1149 d->fe_adap[0].fe->ops.set_voltage = s660_set_voltage; 1209 d->fe_adap[0].fe->ops.set_voltage = s660_set_voltage;
1150 1210
@@ -1182,6 +1242,14 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
1182 err("command 0x0e transfer failed."); 1242 err("command 0x0e transfer failed.");
1183 1243
1184 obuf[0] = 0xe; 1244 obuf[0] = 0xe;
1245 obuf[1] = 0x02;
1246 obuf[2] = 1;
1247
1248 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1249 err("command 0x0e transfer failed.");
1250 msleep(300);
1251
1252 obuf[0] = 0xe;
1185 obuf[1] = 0x83; 1253 obuf[1] = 0x83;
1186 obuf[2] = 0; 1254 obuf[2] = 0;
1187 1255
@@ -1205,9 +1273,40 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
1205 if (d->fe_adap[0].fe == NULL) 1273 if (d->fe_adap[0].fe == NULL)
1206 return -EIO; 1274 return -EIO;
1207 1275
1208 info("Attached DS3000!\n"); 1276 if (dvb_attach(ts2020_attach, d->fe_adap[0].fe,
1277 &dw2104_ts2020_config,
1278 &d->dev->i2c_adap)) {
1279 info("Attached DS3000/TS2020!\n");
1280 return 0;
1281 }
1209 1282
1210 return 0; 1283 info("Failed to attach DS3000/TS2020!\n");
1284 return -EIO;
1285}
1286
1287static int m88rs2000_frontend_attach(struct dvb_usb_adapter *d)
1288{
1289 u8 obuf[] = { 0x51 };
1290 u8 ibuf[] = { 0 };
1291
1292 if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
1293 err("command 0x51 transfer failed.");
1294
1295 d->fe_adap[0].fe = dvb_attach(m88rs2000_attach, &s421_m88rs2000_config,
1296 &d->dev->i2c_adap);
1297
1298 if (d->fe_adap[0].fe == NULL)
1299 return -EIO;
1300
1301 if (dvb_attach(ts2020_attach, d->fe_adap[0].fe,
1302 &dw2104_ts2020_config,
1303 &d->dev->i2c_adap)) {
1304 info("Attached RS2000/TS2020!\n");
1305 return 0;
1306 }
1307
1308 info("Failed to attach RS2000/TS2020!\n");
1309 return -EIO;
1211} 1310}
1212 1311
1213static int dw2102_tuner_attach(struct dvb_usb_adapter *adap) 1312static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
@@ -1447,6 +1546,8 @@ enum dw2102_table_entry {
1447 TEVII_S480_1, 1546 TEVII_S480_1,
1448 TEVII_S480_2, 1547 TEVII_S480_2,
1449 X3M_SPC1400HD, 1548 X3M_SPC1400HD,
1549 TEVII_S421,
1550 TEVII_S632,
1450}; 1551};
1451 1552
1452static struct usb_device_id dw2102_table[] = { 1553static struct usb_device_id dw2102_table[] = {
@@ -1465,6 +1566,8 @@ static struct usb_device_id dw2102_table[] = {
1465 [TEVII_S480_1] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)}, 1566 [TEVII_S480_1] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)},
1466 [TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)}, 1567 [TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
1467 [X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)}, 1568 [X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)},
1569 [TEVII_S421] = {USB_DEVICE(0x9022, USB_PID_TEVII_S421)},
1570 [TEVII_S632] = {USB_DEVICE(0x9022, USB_PID_TEVII_S632)},
1468 { } 1571 { }
1469}; 1572};
1470 1573
@@ -1478,13 +1581,12 @@ static int dw2102_load_firmware(struct usb_device *dev,
1478 u8 reset; 1581 u8 reset;
1479 u8 reset16[] = {0, 0, 0, 0, 0, 0, 0}; 1582 u8 reset16[] = {0, 0, 0, 0, 0, 0, 0};
1480 const struct firmware *fw; 1583 const struct firmware *fw;
1481 const char *fw_2101 = "dvb-usb-dw2101.fw";
1482 1584
1483 switch (dev->descriptor.idProduct) { 1585 switch (dev->descriptor.idProduct) {
1484 case 0x2101: 1586 case 0x2101:
1485 ret = request_firmware(&fw, fw_2101, &dev->dev); 1587 ret = request_firmware(&fw, DW2101_FIRMWARE, &dev->dev);
1486 if (ret != 0) { 1588 if (ret != 0) {
1487 err(err_str, fw_2101); 1589 err(err_str, DW2101_FIRMWARE);
1488 return ret; 1590 return ret;
1489 } 1591 }
1490 break; 1592 break;
@@ -1586,7 +1688,7 @@ static int dw2102_load_firmware(struct usb_device *dev,
1586static struct dvb_usb_device_properties dw2102_properties = { 1688static struct dvb_usb_device_properties dw2102_properties = {
1587 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 1689 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1588 .usb_ctrl = DEVICE_SPECIFIC, 1690 .usb_ctrl = DEVICE_SPECIFIC,
1589 .firmware = "dvb-usb-dw2102.fw", 1691 .firmware = DW2102_FIRMWARE,
1590 .no_reconnect = 1, 1692 .no_reconnect = 1,
1591 1693
1592 .i2c_algo = &dw2102_serit_i2c_algo, 1694 .i2c_algo = &dw2102_serit_i2c_algo,
@@ -1641,7 +1743,7 @@ static struct dvb_usb_device_properties dw2102_properties = {
1641static struct dvb_usb_device_properties dw2104_properties = { 1743static struct dvb_usb_device_properties dw2104_properties = {
1642 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 1744 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1643 .usb_ctrl = DEVICE_SPECIFIC, 1745 .usb_ctrl = DEVICE_SPECIFIC,
1644 .firmware = "dvb-usb-dw2104.fw", 1746 .firmware = DW2104_FIRMWARE,
1645 .no_reconnect = 1, 1747 .no_reconnect = 1,
1646 1748
1647 .i2c_algo = &dw2104_i2c_algo, 1749 .i2c_algo = &dw2104_i2c_algo,
@@ -1691,7 +1793,7 @@ static struct dvb_usb_device_properties dw2104_properties = {
1691static struct dvb_usb_device_properties dw3101_properties = { 1793static struct dvb_usb_device_properties dw3101_properties = {
1692 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 1794 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1693 .usb_ctrl = DEVICE_SPECIFIC, 1795 .usb_ctrl = DEVICE_SPECIFIC,
1694 .firmware = "dvb-usb-dw3101.fw", 1796 .firmware = DW3101_FIRMWARE,
1695 .no_reconnect = 1, 1797 .no_reconnect = 1,
1696 1798
1697 .i2c_algo = &dw3101_i2c_algo, 1799 .i2c_algo = &dw3101_i2c_algo,
@@ -1739,7 +1841,7 @@ static struct dvb_usb_device_properties s6x0_properties = {
1739 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 1841 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1740 .usb_ctrl = DEVICE_SPECIFIC, 1842 .usb_ctrl = DEVICE_SPECIFIC,
1741 .size_of_priv = sizeof(struct s6x0_state), 1843 .size_of_priv = sizeof(struct s6x0_state),
1742 .firmware = "dvb-usb-s630.fw", 1844 .firmware = S630_FIRMWARE,
1743 .no_reconnect = 1, 1845 .no_reconnect = 1,
1744 1846
1745 .i2c_algo = &s6x0_i2c_algo, 1847 .i2c_algo = &s6x0_i2c_algo,
@@ -1814,6 +1916,19 @@ static struct dvb_usb_device_description d7500 = {
1814 {NULL}, 1916 {NULL},
1815}; 1917};
1816 1918
1919struct dvb_usb_device_properties *s421;
1920static struct dvb_usb_device_description d421 = {
1921 "TeVii S421 PCI",
1922 {&dw2102_table[TEVII_S421], NULL},
1923 {NULL},
1924};
1925
1926static struct dvb_usb_device_description d632 = {
1927 "TeVii S632 USB",
1928 {&dw2102_table[TEVII_S632], NULL},
1929 {NULL},
1930};
1931
1817static struct dvb_usb_device_properties su3000_properties = { 1932static struct dvb_usb_device_properties su3000_properties = {
1818 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 1933 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1819 .usb_ctrl = DEVICE_SPECIFIC, 1934 .usb_ctrl = DEVICE_SPECIFIC,
@@ -1879,7 +1994,7 @@ static int dw2102_probe(struct usb_interface *intf,
1879 return -ENOMEM; 1994 return -ENOMEM;
1880 /* copy default structure */ 1995 /* copy default structure */
1881 /* fill only different fields */ 1996 /* fill only different fields */
1882 p1100->firmware = "dvb-usb-p1100.fw"; 1997 p1100->firmware = P1100_FIRMWARE;
1883 p1100->devices[0] = d1100; 1998 p1100->devices[0] = d1100;
1884 p1100->rc.legacy.rc_map_table = rc_map_tbs_table; 1999 p1100->rc.legacy.rc_map_table = rc_map_tbs_table;
1885 p1100->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table); 2000 p1100->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
@@ -1891,7 +2006,7 @@ static int dw2102_probe(struct usb_interface *intf,
1891 kfree(p1100); 2006 kfree(p1100);
1892 return -ENOMEM; 2007 return -ENOMEM;
1893 } 2008 }
1894 s660->firmware = "dvb-usb-s660.fw"; 2009 s660->firmware = S660_FIRMWARE;
1895 s660->num_device_descs = 3; 2010 s660->num_device_descs = 3;
1896 s660->devices[0] = d660; 2011 s660->devices[0] = d660;
1897 s660->devices[1] = d480_1; 2012 s660->devices[1] = d480_1;
@@ -1905,12 +2020,26 @@ static int dw2102_probe(struct usb_interface *intf,
1905 kfree(s660); 2020 kfree(s660);
1906 return -ENOMEM; 2021 return -ENOMEM;
1907 } 2022 }
1908 p7500->firmware = "dvb-usb-p7500.fw"; 2023 p7500->firmware = P7500_FIRMWARE;
1909 p7500->devices[0] = d7500; 2024 p7500->devices[0] = d7500;
1910 p7500->rc.legacy.rc_map_table = rc_map_tbs_table; 2025 p7500->rc.legacy.rc_map_table = rc_map_tbs_table;
1911 p7500->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table); 2026 p7500->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
1912 p7500->adapter->fe[0].frontend_attach = prof_7500_frontend_attach; 2027 p7500->adapter->fe[0].frontend_attach = prof_7500_frontend_attach;
1913 2028
2029
2030 s421 = kmemdup(&su3000_properties,
2031 sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
2032 if (!s421) {
2033 kfree(p1100);
2034 kfree(s660);
2035 kfree(p7500);
2036 return -ENOMEM;
2037 }
2038 s421->num_device_descs = 2;
2039 s421->devices[0] = d421;
2040 s421->devices[1] = d632;
2041 s421->adapter->fe[0].frontend_attach = m88rs2000_frontend_attach;
2042
1914 if (0 == dvb_usb_device_init(intf, &dw2102_properties, 2043 if (0 == dvb_usb_device_init(intf, &dw2102_properties,
1915 THIS_MODULE, NULL, adapter_nr) || 2044 THIS_MODULE, NULL, adapter_nr) ||
1916 0 == dvb_usb_device_init(intf, &dw2104_properties, 2045 0 == dvb_usb_device_init(intf, &dw2104_properties,
@@ -1925,6 +2054,8 @@ static int dw2102_probe(struct usb_interface *intf,
1925 THIS_MODULE, NULL, adapter_nr) || 2054 THIS_MODULE, NULL, adapter_nr) ||
1926 0 == dvb_usb_device_init(intf, p7500, 2055 0 == dvb_usb_device_init(intf, p7500,
1927 THIS_MODULE, NULL, adapter_nr) || 2056 THIS_MODULE, NULL, adapter_nr) ||
2057 0 == dvb_usb_device_init(intf, s421,
2058 THIS_MODULE, NULL, adapter_nr) ||
1928 0 == dvb_usb_device_init(intf, &su3000_properties, 2059 0 == dvb_usb_device_init(intf, &su3000_properties,
1929 THIS_MODULE, NULL, adapter_nr)) 2060 THIS_MODULE, NULL, adapter_nr))
1930 return 0; 2061 return 0;
@@ -1943,9 +2074,17 @@ module_usb_driver(dw2102_driver);
1943 2074
1944MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); 2075MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
1945MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," 2076MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
1946 " DVB-C 3101 USB2.0," 2077 " DVB-C 3101 USB2.0,"
1947 " TeVii S600, S630, S650, S660, S480," 2078 " TeVii S600, S630, S650, S660, S480, S421, S632"
1948 " Prof 1100, 7500 USB2.0," 2079 " Prof 1100, 7500 USB2.0,"
1949 " Geniatech SU3000 devices"); 2080 " Geniatech SU3000 devices");
1950MODULE_VERSION("0.1"); 2081MODULE_VERSION("0.1");
1951MODULE_LICENSE("GPL"); 2082MODULE_LICENSE("GPL");
2083MODULE_FIRMWARE(DW2101_FIRMWARE);
2084MODULE_FIRMWARE(DW2102_FIRMWARE);
2085MODULE_FIRMWARE(DW2104_FIRMWARE);
2086MODULE_FIRMWARE(DW3101_FIRMWARE);
2087MODULE_FIRMWARE(S630_FIRMWARE);
2088MODULE_FIRMWARE(S660_FIRMWARE);
2089MODULE_FIRMWARE(P1100_FIRMWARE);
2090MODULE_FIRMWARE(P7500_FIRMWARE);
diff --git a/drivers/media/usb/dvb-usb/friio-fe.c b/drivers/media/usb/dvb-usb/friio-fe.c
index 90a70c66a96e..d56f927fc31a 100644
--- a/drivers/media/usb/dvb-usb/friio-fe.c
+++ b/drivers/media/usb/dvb-usb/friio-fe.c
@@ -421,11 +421,10 @@ struct dvb_frontend *jdvbt90502_attach(struct dvb_usb_device *d)
421 421
422 /* setup the state */ 422 /* setup the state */
423 state->i2c = &d->i2c_adap; 423 state->i2c = &d->i2c_adap;
424 memcpy(&state->config, &friio_fe_config, sizeof(friio_fe_config)); 424 state->config = friio_fe_config;
425 425
426 /* create dvb_frontend */ 426 /* create dvb_frontend */
427 memcpy(&state->frontend.ops, &jdvbt90502_ops, 427 state->frontend.ops = jdvbt90502_ops;
428 sizeof(jdvbt90502_ops));
429 state->frontend.demodulator_priv = state; 428 state->frontend.demodulator_priv = state;
430 429
431 if (jdvbt90502_init(&state->frontend) < 0) 430 if (jdvbt90502_init(&state->frontend) < 0)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 661bb75be955..92afeb20650f 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -16,6 +16,7 @@
16#include "qt1010.h" 16#include "qt1010.h"
17#include "tda1004x.h" 17#include "tda1004x.h"
18#include "tda827x.h" 18#include "tda827x.h"
19#include "mt2060.h"
19 20
20#include <media/tuner.h> 21#include <media/tuner.h>
21#include "tuner-simple.h" 22#include "tuner-simple.h"
@@ -63,23 +64,33 @@ static inline int m920x_write(struct usb_device *udev, u8 request,
63 return ret; 64 return ret;
64} 65}
65 66
67static inline int m920x_write_seq(struct usb_device *udev, u8 request,
68 struct m920x_inits *seq)
69{
70 int ret;
71 while (seq->address) {
72 ret = m920x_write(udev, request, seq->data, seq->address);
73 if (ret != 0)
74 return ret;
75
76 seq++;
77 }
78
79 return ret;
80}
81
66static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) 82static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
67{ 83{
68 int ret = 0, i, epi, flags = 0; 84 int ret = 0, i, epi, flags = 0;
69 int adap_enabled[M9206_MAX_ADAPTERS] = { 0 }; 85 int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
70 86
71 /* Remote controller init. */ 87 /* Remote controller init. */
72 if (d->props.rc.legacy.rc_query) { 88 if (d->props.rc.legacy.rc_query || d->props.rc.core.rc_query) {
73 deb("Initialising remote control\n"); 89 deb("Initialising remote control\n");
74 while (rc_seq->address) { 90 ret = m920x_write_seq(d->udev, M9206_CORE, rc_seq);
75 if ((ret = m920x_write(d->udev, M9206_CORE, 91 if (ret != 0) {
76 rc_seq->data, 92 deb("Initialising remote control failed\n");
77 rc_seq->address)) != 0) { 93 return ret;
78 deb("Initialising remote control failed\n");
79 return ret;
80 }
81
82 rc_seq++;
83 } 94 }
84 95
85 deb("Initialising remote control success\n"); 96 deb("Initialising remote control success\n");
@@ -130,9 +141,50 @@ static int m920x_init_ep(struct usb_interface *intf)
130 alt->desc.bAlternateSetting); 141 alt->desc.bAlternateSetting);
131} 142}
132 143
133static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 144static inline void m920x_parse_rc_state(struct dvb_usb_device *d, u8 rc_state,
145 int *state)
134{ 146{
135 struct m920x_state *m = d->priv; 147 struct m920x_state *m = d->priv;
148
149 switch (rc_state) {
150 case 0x80:
151 *state = REMOTE_NO_KEY_PRESSED;
152 break;
153
154 case 0x88: /* framing error or "invalid code" */
155 case 0x99:
156 case 0xc0:
157 case 0xd8:
158 *state = REMOTE_NO_KEY_PRESSED;
159 m->rep_count = 0;
160 break;
161
162 case 0x93:
163 case 0x92:
164 case 0x83: /* pinnacle PCTV310e */
165 case 0x82:
166 m->rep_count = 0;
167 *state = REMOTE_KEY_PRESSED;
168 break;
169
170 case 0x91:
171 case 0x81: /* pinnacle PCTV310e */
172 /* prevent immediate auto-repeat */
173 if (++m->rep_count > 2)
174 *state = REMOTE_KEY_REPEAT;
175 else
176 *state = REMOTE_NO_KEY_PRESSED;
177 break;
178
179 default:
180 deb("Unexpected rc state %02x\n", rc_state);
181 *state = REMOTE_NO_KEY_PRESSED;
182 break;
183 }
184}
185
186static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
187{
136 int i, ret = 0; 188 int i, ret = 0;
137 u8 *rc_state; 189 u8 *rc_state;
138 190
@@ -140,51 +192,22 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
140 if (!rc_state) 192 if (!rc_state)
141 return -ENOMEM; 193 return -ENOMEM;
142 194
143 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, rc_state, 1)) != 0) 195 ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE,
196 rc_state, 1);
197 if (ret != 0)
144 goto out; 198 goto out;
145 199
146 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0) 200 ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY,
201 rc_state + 1, 1);
202 if (ret != 0)
147 goto out; 203 goto out;
148 204
205 m920x_parse_rc_state(d, rc_state[0], state);
206
149 for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) 207 for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
150 if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) { 208 if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) {
151 *event = d->props.rc.legacy.rc_map_table[i].keycode; 209 *event = d->props.rc.legacy.rc_map_table[i].keycode;
152 210 goto out;
153 switch(rc_state[0]) {
154 case 0x80:
155 *state = REMOTE_NO_KEY_PRESSED;
156 goto out;
157
158 case 0x88: /* framing error or "invalid code" */
159 case 0x99:
160 case 0xc0:
161 case 0xd8:
162 *state = REMOTE_NO_KEY_PRESSED;
163 m->rep_count = 0;
164 goto out;
165
166 case 0x93:
167 case 0x92:
168 case 0x83: /* pinnacle PCTV310e */
169 case 0x82:
170 m->rep_count = 0;
171 *state = REMOTE_KEY_PRESSED;
172 goto out;
173
174 case 0x91:
175 case 0x81: /* pinnacle PCTV310e */
176 /* prevent immediate auto-repeat */
177 if (++m->rep_count > 2)
178 *state = REMOTE_KEY_REPEAT;
179 else
180 *state = REMOTE_NO_KEY_PRESSED;
181 goto out;
182
183 default:
184 deb("Unexpected rc state %02x\n", rc_state[0]);
185 *state = REMOTE_NO_KEY_PRESSED;
186 goto out;
187 }
188 } 211 }
189 212
190 if (rc_state[1] != 0) 213 if (rc_state[1] != 0)
@@ -197,6 +220,38 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
197 return ret; 220 return ret;
198} 221}
199 222
223static int m920x_rc_core_query(struct dvb_usb_device *d)
224{
225 int ret = 0;
226 u8 *rc_state;
227 int state;
228
229 rc_state = kmalloc(2, GFP_KERNEL);
230 if (!rc_state)
231 return -ENOMEM;
232
233 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, &rc_state[0], 1)) != 0)
234 goto out;
235
236 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, &rc_state[1], 1)) != 0)
237 goto out;
238
239 deb("state=0x%02x keycode=0x%02x\n", rc_state[0], rc_state[1]);
240
241 m920x_parse_rc_state(d, rc_state[0], &state);
242
243 if (state == REMOTE_NO_KEY_PRESSED)
244 rc_keyup(d->rc_dev);
245 else if (state == REMOTE_KEY_REPEAT)
246 rc_repeat(d->rc_dev);
247 else
248 rc_keydown(d->rc_dev, rc_state[1], 0);
249
250out:
251 kfree(rc_state);
252 return ret;
253}
254
200/* I2C */ 255/* I2C */
201static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) 256static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
202{ 257{
@@ -496,6 +551,12 @@ static struct qt1010_config m920x_qt1010_config = {
496 .i2c_address = 0x62 551 .i2c_address = 0x62
497}; 552};
498 553
554static struct mt2060_config m920x_mt2060_config = {
555 .i2c_address = 0x60, /* 0xc0 */
556 .clock_out = 0,
557};
558
559
499/* Callbacks for DVB USB */ 560/* Callbacks for DVB USB */
500static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap) 561static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
501{ 562{
@@ -510,6 +571,37 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
510 return 0; 571 return 0;
511} 572}
512 573
574static int m920x_mt352_frontend_attach_vp7049(struct dvb_usb_adapter *adap)
575{
576 struct m920x_inits vp7049_fe_init_seq[] = {
577 /* XXX without these commands the frontend cannot be detected,
578 * they must be sent BEFORE the frontend is attached */
579 { 0xff28, 0x00 },
580 { 0xff23, 0x00 },
581 { 0xff28, 0x00 },
582 { 0xff23, 0x00 },
583 { 0xff21, 0x20 },
584 { 0xff21, 0x60 },
585 { 0xff28, 0x00 },
586 { 0xff22, 0x00 },
587 { 0xff20, 0x30 },
588 { 0xff20, 0x20 },
589 { 0xff20, 0x30 },
590 { } /* terminating entry */
591 };
592 int ret;
593
594 deb("%s\n", __func__);
595
596 ret = m920x_write_seq(adap->dev->udev, M9206_CORE, vp7049_fe_init_seq);
597 if (ret != 0) {
598 deb("Initialization of vp7049 frontend failed.");
599 return ret;
600 }
601
602 return m920x_mt352_frontend_attach(adap);
603}
604
513static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap) 605static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
514{ 606{
515 deb("%s\n",__func__); 607 deb("%s\n",__func__);
@@ -574,6 +666,18 @@ static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
574 return 0; 666 return 0;
575} 667}
576 668
669static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap)
670{
671 deb("%s\n", __func__);
672
673 if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
674 &m920x_mt2060_config, 1220) == NULL)
675 return -ENODEV;
676
677 return 0;
678}
679
680
577/* device-specific initialization */ 681/* device-specific initialization */
578static struct m920x_inits megasky_rc_init [] = { 682static struct m920x_inits megasky_rc_init [] = {
579 { M9206_RC_INIT2, 0xa8 }, 683 { M9206_RC_INIT2, 0xa8 },
@@ -591,7 +695,7 @@ static struct m920x_inits tvwalkertwin_rc_init [] = {
591}; 695};
592 696
593static struct m920x_inits pinnacle310e_init[] = { 697static struct m920x_inits pinnacle310e_init[] = {
594 /* without these the tuner don't work */ 698 /* without these the tuner doesn't work */
595 { 0xff20, 0x9b }, 699 { 0xff20, 0x9b },
596 { 0xff22, 0x70 }, 700 { 0xff22, 0x70 },
597 701
@@ -602,6 +706,15 @@ static struct m920x_inits pinnacle310e_init[] = {
602 { } /* terminating entry */ 706 { } /* terminating entry */
603}; 707};
604 708
709static struct m920x_inits vp7049_rc_init[] = {
710 { 0xff28, 0x00 },
711 { 0xff23, 0x00 },
712 { 0xff21, 0x70 },
713 { M9206_RC_INIT2, 0x00 },
714 { M9206_RC_INIT1, 0xff },
715 { } /* terminating entry */
716};
717
605/* ir keymaps */ 718/* ir keymaps */
606static struct rc_map_table rc_map_megasky_table[] = { 719static struct rc_map_table rc_map_megasky_table[] = {
607 { 0x0012, KEY_POWER }, 720 { 0x0012, KEY_POWER },
@@ -704,6 +817,7 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties;
704static struct dvb_usb_device_properties tvwalkertwin_properties; 817static struct dvb_usb_device_properties tvwalkertwin_properties;
705static struct dvb_usb_device_properties dposh_properties; 818static struct dvb_usb_device_properties dposh_properties;
706static struct dvb_usb_device_properties pinnacle_pctv310e_properties; 819static struct dvb_usb_device_properties pinnacle_pctv310e_properties;
820static struct dvb_usb_device_properties vp7049_properties;
707 821
708static int m920x_probe(struct usb_interface *intf, 822static int m920x_probe(struct usb_interface *intf,
709 const struct usb_device_id *id) 823 const struct usb_device_id *id)
@@ -756,6 +870,13 @@ static int m920x_probe(struct usb_interface *intf,
756 goto found; 870 goto found;
757 } 871 }
758 872
873 ret = dvb_usb_device_init(intf, &vp7049_properties,
874 THIS_MODULE, &d, adapter_nr);
875 if (ret == 0) {
876 rc_init_seq = vp7049_rc_init;
877 goto found;
878 }
879
759 return ret; 880 return ret;
760 } else { 881 } else {
761 /* Another interface on a multi-tuner device */ 882 /* Another interface on a multi-tuner device */
@@ -787,6 +908,7 @@ static struct usb_device_id m920x_table [] = {
787 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) }, 908 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
788 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) }, 909 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
789 { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) }, 910 { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) },
911 { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_TWINHAN_VP7049) },
790 { } /* Terminating entry */ 912 { } /* Terminating entry */
791}; 913};
792MODULE_DEVICE_TABLE (usb, m920x_table); 914MODULE_DEVICE_TABLE (usb, m920x_table);
@@ -1079,6 +1201,61 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
1079 } 1201 }
1080}; 1202};
1081 1203
1204static struct dvb_usb_device_properties vp7049_properties = {
1205 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1206
1207 .usb_ctrl = DEVICE_SPECIFIC,
1208 .firmware = "dvb-usb-vp7049-0.95.fw",
1209 .download_firmware = m920x_firmware_download,
1210
1211 .rc.core = {
1212 .rc_interval = 150,
1213 .rc_codes = RC_MAP_TWINHAN_VP1027_DVBS,
1214 .rc_query = m920x_rc_core_query,
1215 .allowed_protos = RC_TYPE_UNKNOWN,
1216 },
1217
1218 .size_of_priv = sizeof(struct m920x_state),
1219
1220 .identify_state = m920x_identify_state,
1221 .num_adapters = 1,
1222 .adapter = {{
1223 .num_frontends = 1,
1224 .fe = {{
1225
1226 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
1227 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1228
1229 .pid_filter_count = 8,
1230 .pid_filter = m920x_pid_filter,
1231 .pid_filter_ctrl = m920x_pid_filter_ctrl,
1232
1233 .frontend_attach = m920x_mt352_frontend_attach_vp7049,
1234 .tuner_attach = m920x_mt2060_tuner_attach,
1235
1236 .stream = {
1237 .type = USB_BULK,
1238 .count = 8,
1239 .endpoint = 0x81,
1240 .u = {
1241 .bulk = {
1242 .buffersize = 512,
1243 }
1244 }
1245 },
1246 } },
1247 } },
1248 .i2c_algo = &m920x_i2c_algo,
1249
1250 .num_device_descs = 1,
1251 .devices = {
1252 { "DTV-DVB UDTT7049",
1253 { &m920x_table[7], NULL },
1254 { NULL },
1255 }
1256 }
1257};
1258
1082static struct usb_driver m920x_driver = { 1259static struct usb_driver m920x_driver = {
1083 .name = "dvb_usb_m920x", 1260 .name = "dvb_usb_m920x",
1084 .probe = m920x_probe, 1261 .probe = m920x_probe,
diff --git a/drivers/media/usb/dvb-usb/ttusb2.c b/drivers/media/usb/dvb-usb/ttusb2.c
index bcdac225ebe1..2ce3d19c58ef 100644
--- a/drivers/media/usb/dvb-usb/ttusb2.c
+++ b/drivers/media/usb/dvb-usb/ttusb2.c
@@ -620,6 +620,8 @@ static struct usb_device_id ttusb2_table [] = {
620 USB_PID_TECHNOTREND_CONNECT_S2400) }, 620 USB_PID_TECHNOTREND_CONNECT_S2400) },
621 { USB_DEVICE(USB_VID_TECHNOTREND, 621 { USB_DEVICE(USB_VID_TECHNOTREND,
622 USB_PID_TECHNOTREND_CONNECT_CT3650) }, 622 USB_PID_TECHNOTREND_CONNECT_CT3650) },
623 { USB_DEVICE(USB_VID_TECHNOTREND,
624 USB_PID_TECHNOTREND_CONNECT_S2400_8KEEPROM) },
623 {} /* Terminating entry */ 625 {} /* Terminating entry */
624}; 626};
625MODULE_DEVICE_TABLE (usb, ttusb2_table); 627MODULE_DEVICE_TABLE (usb, ttusb2_table);
@@ -721,12 +723,16 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
721 723
722 .generic_bulk_ctrl_endpoint = 0x01, 724 .generic_bulk_ctrl_endpoint = 0x01,
723 725
724 .num_device_descs = 1, 726 .num_device_descs = 2,
725 .devices = { 727 .devices = {
726 { "Technotrend TT-connect S-2400", 728 { "Technotrend TT-connect S-2400",
727 { &ttusb2_table[2], NULL }, 729 { &ttusb2_table[2], NULL },
728 { NULL }, 730 { NULL },
729 }, 731 },
732 { "Technotrend TT-connect S-2400 (8kB EEPROM)",
733 { &ttusb2_table[4], NULL },
734 { NULL },
735 },
730 } 736 }
731}; 737};
732 738