1 diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
2 index 1a3df10..82d35c6 100644
3 --- a/drivers/media/usb/dvb-usb/dw2102.c
4 +++ b/drivers/media/usb/dvb-usb/dw2102.c
9 +#include "m88ds3103.h"
10 +#include "m88ts2022.h"
13 /* Max transfer size done by I2C transfer functions */
14 #define MAX_XFER_SIZE 64
16 #define USB_PID_TEVII_S480_2 0xd482
19 +#ifndef USB_PID_TEVII_S482_1
20 +#define USB_PID_TEVII_S482_1 0xd483
23 +#ifndef USB_PID_TEVII_S482_2
24 +#define USB_PID_TEVII_S482_2 0xd484
27 #ifndef USB_PID_PROF_1100
28 #define USB_PID_PROF_1100 0xb012
30 @@ -1117,6 +1128,19 @@ static struct tda18271_config tda18271_config = {
31 .gate = TDA18271_GATE_DIGITAL,
34 +static const struct m88ds3103_config s482_m88ds3103_config = {
39 + .ts_mode = M88DS3103_TS_CI,
47 static u8 m88rs2000_inittab[] = {
48 DEMOD_WRITE, 0x9a, 0x30,
49 DEMOD_WRITE, 0x00, 0x01,
50 @@ -1386,6 +1410,83 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
54 +static int m88ds3103_frontend_attach(struct dvb_usb_adapter *d)
56 + u8 obuf[3] = { 0xe, 0x80, 0 };
59 + /* demod I2C adapter */
60 + struct i2c_adapter *i2c_adapter;
61 + struct i2c_client *client;
62 + struct i2c_board_info info;
63 + struct m88ts2022_config m88ts2022_config = {
66 + memset(&info, 0, sizeof(struct i2c_board_info));
67 + if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
68 + err("command 0x0e transfer failed.");
74 + if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
75 + err("command 0x0e transfer failed.");
82 + if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
83 + err("command 0x0e transfer failed.");
89 + if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
90 + err("command 0x0e transfer failed.");
94 + if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
95 + err("command 0x51 transfer failed.");
96 + d->fe_adap[0].fe = dvb_attach(m88ds3103_attach,
97 + &s482_m88ds3103_config,
100 + if (d->fe_adap[0].fe == NULL)
103 + m88ts2022_config.fe = d->fe_adap[0].fe;
104 + strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE);
106 + info.platform_data = &m88ts2022_config;
107 + request_module("m88ts2022");
108 + client = i2c_new_device(i2c_adapter, &info);
109 + if (client == NULL || client->dev.driver == NULL) {
110 + dvb_frontend_detach(d->fe_adap[0].fe);
113 + if (!try_module_get(client->dev.driver->owner)) {
114 + i2c_unregister_device(client);
115 + dvb_frontend_detach(d->fe_adap[0].fe);
118 + info("attached m88ds3103/m88ts2022!\n");
120 + /* delegate signal strength measurement to tuner */
122 + d->fe_adap[0].fe->ops.read_signal_strength =
123 + d->fe_adap[0].fe->ops.tuner_ops.get_rf_strength;
127 + info("Failed to attach m88ds3103/m88ts2022!\n");
131 static int t220_frontend_attach(struct dvb_usb_adapter *d)
133 u8 obuf[3] = { 0xe, 0x87, 0 };
134 @@ -1557,6 +1658,8 @@ enum dw2102_table_entry {
141 TERRATEC_CINERGY_S2_R2,
143 @@ -1580,7 +1683,9 @@ static struct usb_device_id dw2102_table[] = {
144 [TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
145 [X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)},
146 [TEVII_S421] = {USB_DEVICE(0x9022, USB_PID_TEVII_S421)},
147 - [TEVII_S632] = {USB_DEVICE(0x9022, USB_PID_TEVII_S632)},
148 + [TEVII_S482_1] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_1) },
149 + [TEVII_S482_2] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_2) },
150 + [TEVII_S632] = { USB_DEVICE(0x9022, USB_PID_TEVII_S632) },
151 [TERRATEC_CINERGY_S2_R2] = {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)},
152 [GOTVIEW_SAT_HD] = {USB_DEVICE(0x1FE1, USB_PID_GOTVIEW_SAT_HD)},
153 [GENIATECH_T220] = {USB_DEVICE(0x1f4d, 0xD220)},
154 @@ -2012,6 +2117,59 @@ static struct dvb_usb_device_properties su3000_properties = {
158 +static struct dvb_usb_device_properties m88ds3103_properties = {
159 + .caps = DVB_USB_IS_AN_I2C_ADAPTER,
160 + .usb_ctrl = DEVICE_SPECIFIC,
161 + .size_of_priv = sizeof(struct su3000_state),
162 + .power_ctrl = su3000_power_ctrl,
164 + .identify_state = su3000_identify_state,
165 + .i2c_algo = &su3000_i2c_algo,
168 + .rc_interval = 150,
169 + .rc_codes = RC_MAP_TEVII_NEC,
170 + .module_name = "dw2102",
171 + .allowed_protos = RC_BIT_NEC,
172 + .rc_query = dw2102_rc_query,
175 + .read_mac_address = su3000_read_mac_address,
177 + .generic_bulk_ctrl_endpoint = 0x01,
181 + .num_frontends = 1,
183 + .streaming_ctrl = su3000_streaming_ctrl,
184 + .frontend_attach = m88ds3103_frontend_attach,
191 + .buffersize = 4096,
198 + .num_device_descs = 2,
200 + { "TeVii S482.1 USB",
201 + { &dw2102_table[TEVII_S482_1], NULL },
204 + { "TeVii S482.2 USB",
205 + { &dw2102_table[TEVII_S482_2], NULL },
211 static struct dvb_usb_device_properties t220_properties = {
212 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
213 .usb_ctrl = DEVICE_SPECIFIC,
214 @@ -2131,11 +2289,13 @@ static int dw2102_probe(struct usb_interface *intf,
215 0 == dvb_usb_device_init(intf, p7500,
216 THIS_MODULE, NULL, adapter_nr) ||
217 0 == dvb_usb_device_init(intf, s421,
218 - THIS_MODULE, NULL, adapter_nr) ||
219 - 0 == dvb_usb_device_init(intf, &su3000_properties,
220 - THIS_MODULE, NULL, adapter_nr) ||
221 + THIS_MODULE, NULL, adapter_nr) ||
222 0 == dvb_usb_device_init(intf, &t220_properties,
223 - THIS_MODULE, NULL, adapter_nr))
224 + THIS_MODULE, NULL, adapter_nr) ||
225 + 0 == dvb_usb_device_init(intf, &m88ds3103_properties,
226 + THIS_MODULE, NULL, adapter_nr) ||
227 + 0 == dvb_usb_device_init(intf, &su3000_properties,
228 + THIS_MODULE, NULL, adapter_nr))
232 @@ -2153,7 +2313,7 @@ module_usb_driver(dw2102_driver);
233 MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
234 MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
235 " DVB-C 3101 USB2.0,"
236 - " TeVii S600, S630, S650, S660, S480, S421, S632"
237 + " TeVii S600, S630, S650, S660, S480, S482, S421, S632"
238 " Prof 1100, 7500 USB2.0,"
239 " Geniatech SU3000, T220 devices");
240 MODULE_VERSION("0.1");