blob: d1ddf7e8173506d68b04c8ffd6e8dd1b03b6b962 [file] [log] [blame]
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001/* DVB USB framework compliant Linux driver for the
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03002* DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
Igor M. Liplianincd79d332009-12-14 20:24:56 -03003* TeVii S600, S630, S650,
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03004* Prof 1100, 7500,
5 * Geniatech SU3000 Cards
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03006* Copyright (C) 2008,2009 Igor M. Liplianin (liplianin@me.by)
Igor M Liplianin7fd48282008-07-20 08:05:50 -03007*
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
10* Free Software Foundation, version 2.
11*
12* see Documentation/dvb/README.dvb-usb for more information
13*/
Igor M Liplianin7fd48282008-07-20 08:05:50 -030014#include "dw2102.h"
Igor M. Liplianin21b007b2008-09-17 19:19:19 -030015#include "si21xx.h"
Igor M Liplianin7fd48282008-07-20 08:05:50 -030016#include "stv0299.h"
17#include "z0194a.h"
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -030018#include "stv0288.h"
19#include "stb6000.h"
20#include "eds1547.h"
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -030021#include "cx24116.h"
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -030022#include "tda1002x.h"
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -030023#include "mt312.h"
24#include "zl10039.h"
Igor M. Liplianin141cc352009-11-27 14:37:35 -030025#include "ds3000.h"
26#include "stv0900.h"
27#include "stv6110.h"
28#include "stb6100.h"
29#include "stb6100_proc.h"
Igor M Liplianin7fd48282008-07-20 08:05:50 -030030
31#ifndef USB_PID_DW2102
32#define USB_PID_DW2102 0x2102
33#endif
34
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -030035#ifndef USB_PID_DW2104
36#define USB_PID_DW2104 0x2104
37#endif
38
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -030039#ifndef USB_PID_DW3101
40#define USB_PID_DW3101 0x3101
41#endif
42
Igor M. Liplianin4cc0edf2008-11-05 22:12:56 -030043#ifndef USB_PID_CINERGY_S
44#define USB_PID_CINERGY_S 0x0064
45#endif
46
Igor M. Liplianin141cc352009-11-27 14:37:35 -030047#ifndef USB_PID_TEVII_S630
48#define USB_PID_TEVII_S630 0xd630
49#endif
50
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -030051#ifndef USB_PID_TEVII_S650
52#define USB_PID_TEVII_S650 0xd650
53#endif
54
Igor M. Liplianin141cc352009-11-27 14:37:35 -030055#ifndef USB_PID_TEVII_S660
56#define USB_PID_TEVII_S660 0xd660
57#endif
58
59#ifndef USB_PID_PROF_1100
60#define USB_PID_PROF_1100 0xb012
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -030061#endif
62
Igor M. Liplianin21b007b2008-09-17 19:19:19 -030063#define DW210X_READ_MSG 0
64#define DW210X_WRITE_MSG 1
Igor M Liplianin7fd48282008-07-20 08:05:50 -030065
66#define REG_1F_SYMBOLRATE_BYTE0 0x1f
67#define REG_20_SYMBOLRATE_BYTE1 0x20
68#define REG_21_SYMBOLRATE_BYTE2 0x21
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -030069/* on my own*/
Igor M Liplianin7fd48282008-07-20 08:05:50 -030070#define DW2102_VOLTAGE_CTRL (0x1800)
Igor M. Liplianind2ffc442011-02-25 18:41:22 -030071#define SU3000_STREAM_CTRL (0x1900)
Igor M Liplianin7fd48282008-07-20 08:05:50 -030072#define DW2102_RC_QUERY (0x1a00)
Igor M. Liplianinfa8bae12011-02-25 18:41:22 -030073#define DW2102_LED_CTRL (0x1b00)
Igor M Liplianin7fd48282008-07-20 08:05:50 -030074
Igor M. Liplianin141cc352009-11-27 14:37:35 -030075#define err_str "did not find the firmware file. (%s) " \
76 "Please see linux/Documentation/dvb/ for more details " \
77 "on firmware-problems."
78
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -030079struct rc_map_dvb_usb_table_table {
80 struct rc_map_table *rc_keys;
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -030081 int rc_keys_size;
Igor M Liplianin7fd48282008-07-20 08:05:50 -030082};
83
Igor M. Liplianind2ffc442011-02-25 18:41:22 -030084struct su3000_state {
85 u8 initialized;
86};
87
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -030088/* debug */
89static int dvb_usb_dw2102_debug;
90module_param_named(debug, dvb_usb_dw2102_debug, int, 0644);
Igor M. Liplianin8a8dad72009-06-13 08:10:24 -030091MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))."
92 DVB_USB_DEBUG_STATUS);
93
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -030094/* keymaps */
95static int ir_keymap;
96module_param_named(keymap, ir_keymap, int, 0644);
Igor M. Liplianinfeb16e92011-02-25 18:41:22 -030097MODULE_PARM_DESC(keymap, "set keymap 0=default 1=dvbworld 2=tevii 3=tbs ..."
98 " 256=none");
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -030099
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300100/* demod probe */
101static int demod_probe = 1;
102module_param_named(demod, demod_probe, int, 0644);
103MODULE_PARM_DESC(demod, "demod to probe (1=cx24116 2=stv0903+stv6110 "
104 "4=stv0903+stb6100(or-able)).");
105
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300106DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
107
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300108static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300109 u16 index, u8 * data, u16 len, int flags)
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300110{
111 int ret;
112 u8 u8buf[len];
113
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300114 unsigned int pipe = (flags == DW210X_READ_MSG) ?
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300115 usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300116 u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300117
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300118 if (flags == DW210X_WRITE_MSG)
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300119 memcpy(u8buf, data, len);
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300120 ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR,
121 value, index , u8buf, len, 2000);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300122
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300123 if (flags == DW210X_READ_MSG)
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300124 memcpy(data, u8buf, len);
125 return ret;
126}
127
128/* I2C */
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300129static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
130 int num)
131{
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300132 struct dvb_usb_device *d = i2c_get_adapdata(adap);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300133 int i = 0, ret = 0;
134 u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0};
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300135 u16 value;
136
137 if (!d)
138 return -ENODEV;
139 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
140 return -EAGAIN;
141
142 switch (num) {
143 case 2:
144 /* read stv0299 register */
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300145 value = msg[0].buf[0];/* register */
146 for (i = 0; i < msg[1].len; i++) {
147 value = value + i;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300148 ret = dw210x_op_rw(d->udev, 0xb5, value, 0,
149 buf6, 2, DW210X_READ_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300150 msg[1].buf[i] = buf6[0];
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300151 }
152 break;
153 case 1:
154 switch (msg[0].addr) {
155 case 0x68:
156 /* write to stv0299 register */
157 buf6[0] = 0x2a;
158 buf6[1] = msg[0].buf[0];
159 buf6[2] = msg[0].buf[1];
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300160 ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
161 buf6, 3, DW210X_WRITE_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300162 break;
163 case 0x60:
164 if (msg[0].flags == 0) {
165 /* write to tuner pll */
166 buf6[0] = 0x2c;
167 buf6[1] = 5;
168 buf6[2] = 0xc0;
169 buf6[3] = msg[0].buf[0];
170 buf6[4] = msg[0].buf[1];
171 buf6[5] = msg[0].buf[2];
172 buf6[6] = msg[0].buf[3];
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300173 ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
174 buf6, 7, DW210X_WRITE_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300175 } else {
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300176 /* read from tuner */
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300177 ret = dw210x_op_rw(d->udev, 0xb5, 0, 0,
178 buf6, 1, DW210X_READ_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300179 msg[0].buf[0] = buf6[0];
180 }
181 break;
182 case (DW2102_RC_QUERY):
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300183 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
184 buf6, 2, DW210X_READ_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300185 msg[0].buf[0] = buf6[0];
186 msg[0].buf[1] = buf6[1];
187 break;
188 case (DW2102_VOLTAGE_CTRL):
189 buf6[0] = 0x30;
190 buf6[1] = msg[0].buf[0];
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300191 ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
192 buf6, 2, DW210X_WRITE_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300193 break;
194 }
195
196 break;
197 }
198
199 mutex_unlock(&d->i2c_mutex);
200 return num;
201}
202
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300203static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap,
204 struct i2c_msg msg[], int num)
205{
206 struct dvb_usb_device *d = i2c_get_adapdata(adap);
207 int ret = 0;
208 u8 buf6[] = {0, 0, 0, 0, 0, 0, 0};
209
210 if (!d)
211 return -ENODEV;
212 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
213 return -EAGAIN;
214
215 switch (num) {
216 case 2:
217 /* read si2109 register by number */
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300218 buf6[0] = msg[0].addr << 1;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300219 buf6[1] = msg[0].len;
220 buf6[2] = msg[0].buf[0];
221 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
222 buf6, msg[0].len + 2, DW210X_WRITE_MSG);
223 /* read si2109 register */
224 ret = dw210x_op_rw(d->udev, 0xc3, 0xd0, 0,
225 buf6, msg[1].len + 2, DW210X_READ_MSG);
226 memcpy(msg[1].buf, buf6 + 2, msg[1].len);
227
228 break;
229 case 1:
230 switch (msg[0].addr) {
231 case 0x68:
232 /* write to si2109 register */
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300233 buf6[0] = msg[0].addr << 1;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300234 buf6[1] = msg[0].len;
235 memcpy(buf6 + 2, msg[0].buf, msg[0].len);
236 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, buf6,
237 msg[0].len + 2, DW210X_WRITE_MSG);
238 break;
239 case(DW2102_RC_QUERY):
240 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
241 buf6, 2, DW210X_READ_MSG);
242 msg[0].buf[0] = buf6[0];
243 msg[0].buf[1] = buf6[1];
244 break;
245 case(DW2102_VOLTAGE_CTRL):
246 buf6[0] = 0x30;
247 buf6[1] = msg[0].buf[0];
248 ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
249 buf6, 2, DW210X_WRITE_MSG);
250 break;
251 }
252 break;
253 }
254
255 mutex_unlock(&d->i2c_mutex);
256 return num;
257}
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300258
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -0300259static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
260{
261 struct dvb_usb_device *d = i2c_get_adapdata(adap);
262 int ret = 0;
263
264 if (!d)
265 return -ENODEV;
266 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
267 return -EAGAIN;
268
269 switch (num) {
270 case 2: {
271 /* read */
272 /* first write first register number */
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300273 u8 ibuf[msg[1].len + 2], obuf[3];
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300274 obuf[0] = msg[0].addr << 1;
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -0300275 obuf[1] = msg[0].len;
276 obuf[2] = msg[0].buf[0];
277 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
278 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
279 /* second read registers */
280 ret = dw210x_op_rw(d->udev, 0xc3, 0xd1 , 0,
281 ibuf, msg[1].len + 2, DW210X_READ_MSG);
282 memcpy(msg[1].buf, ibuf + 2, msg[1].len);
283
284 break;
285 }
286 case 1:
287 switch (msg[0].addr) {
288 case 0x68: {
289 /* write to register */
290 u8 obuf[msg[0].len + 2];
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300291 obuf[0] = msg[0].addr << 1;
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -0300292 obuf[1] = msg[0].len;
293 memcpy(obuf + 2, msg[0].buf, msg[0].len);
294 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
295 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
296 break;
297 }
298 case 0x61: {
299 /* write to tuner */
300 u8 obuf[msg[0].len + 2];
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300301 obuf[0] = msg[0].addr << 1;
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -0300302 obuf[1] = msg[0].len;
303 memcpy(obuf + 2, msg[0].buf, msg[0].len);
304 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
305 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
306 break;
307 }
308 case(DW2102_RC_QUERY): {
309 u8 ibuf[2];
310 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
311 ibuf, 2, DW210X_READ_MSG);
312 memcpy(msg[0].buf, ibuf , 2);
313 break;
314 }
315 case(DW2102_VOLTAGE_CTRL): {
316 u8 obuf[2];
317 obuf[0] = 0x30;
318 obuf[1] = msg[0].buf[0];
319 ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
320 obuf, 2, DW210X_WRITE_MSG);
321 break;
322 }
323 }
324
325 break;
326 }
327
328 mutex_unlock(&d->i2c_mutex);
329 return num;
330}
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300331
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300332static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
333{
334 struct dvb_usb_device *d = i2c_get_adapdata(adap);
335 int ret = 0;
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300336 int len, i, j;
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300337
338 if (!d)
339 return -ENODEV;
340 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
341 return -EAGAIN;
342
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300343 for (j = 0; j < num; j++) {
344 switch (msg[j].addr) {
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300345 case(DW2102_RC_QUERY): {
346 u8 ibuf[2];
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300347 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
348 ibuf, 2, DW210X_READ_MSG);
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300349 memcpy(msg[j].buf, ibuf , 2);
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300350 break;
351 }
352 case(DW2102_VOLTAGE_CTRL): {
353 u8 obuf[2];
354 obuf[0] = 0x30;
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300355 obuf[1] = msg[j].buf[0];
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300356 ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
357 obuf, 2, DW210X_WRITE_MSG);
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300358 break;
359 }
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300360 /*case 0x55: cx24116
361 case 0x6a: stv0903
362 case 0x68: ds3000, stv0903
363 case 0x60: ts2020, stv6110, stb6100 */
364 default: {
365 if (msg[j].flags == I2C_M_RD) {
366 /* read registers */
367 u8 ibuf[msg[j].len + 2];
368 ret = dw210x_op_rw(d->udev, 0xc3,
369 (msg[j].addr << 1) + 1, 0,
370 ibuf, msg[j].len + 2,
371 DW210X_READ_MSG);
372 memcpy(msg[j].buf, ibuf + 2, msg[j].len);
373 mdelay(10);
374 } else if (((msg[j].buf[0] == 0xb0) &&
375 (msg[j].addr == 0x68)) ||
376 ((msg[j].buf[0] == 0xf7) &&
377 (msg[j].addr == 0x55))) {
378 /* write firmware */
379 u8 obuf[19];
380 obuf[0] = msg[j].addr << 1;
381 obuf[1] = (msg[j].len > 15 ? 17 : msg[j].len);
382 obuf[2] = msg[j].buf[0];
383 len = msg[j].len - 1;
384 i = 1;
385 do {
386 memcpy(obuf + 3, msg[j].buf + i,
387 (len > 16 ? 16 : len));
388 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
389 obuf, (len > 16 ? 16 : len) + 3,
390 DW210X_WRITE_MSG);
391 i += 16;
392 len -= 16;
393 } while (len > 0);
394 } else {
395 /* write registers */
396 u8 obuf[msg[j].len + 2];
397 obuf[0] = msg[j].addr << 1;
398 obuf[1] = msg[j].len;
399 memcpy(obuf + 2, msg[j].buf, msg[j].len);
400 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
401 obuf, msg[j].len + 2,
402 DW210X_WRITE_MSG);
403 }
404 break;
405 }
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300406 }
407
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300408 }
409
410 mutex_unlock(&d->i2c_mutex);
411 return num;
412}
413
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300414static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
415 int num)
416{
417 struct dvb_usb_device *d = i2c_get_adapdata(adap);
418 int ret = 0, i;
419
420 if (!d)
421 return -ENODEV;
422 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
423 return -EAGAIN;
424
425 switch (num) {
426 case 2: {
427 /* read */
428 /* first write first register number */
429 u8 ibuf[msg[1].len + 2], obuf[3];
430 obuf[0] = msg[0].addr << 1;
431 obuf[1] = msg[0].len;
432 obuf[2] = msg[0].buf[0];
433 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
434 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
435 /* second read registers */
436 ret = dw210x_op_rw(d->udev, 0xc3, 0x19 , 0,
437 ibuf, msg[1].len + 2, DW210X_READ_MSG);
438 memcpy(msg[1].buf, ibuf + 2, msg[1].len);
439
440 break;
441 }
442 case 1:
443 switch (msg[0].addr) {
444 case 0x60:
445 case 0x0c: {
446 /* write to register */
447 u8 obuf[msg[0].len + 2];
448 obuf[0] = msg[0].addr << 1;
449 obuf[1] = msg[0].len;
450 memcpy(obuf + 2, msg[0].buf, msg[0].len);
451 ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
452 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
453 break;
454 }
455 case(DW2102_RC_QUERY): {
456 u8 ibuf[2];
457 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
458 ibuf, 2, DW210X_READ_MSG);
459 memcpy(msg[0].buf, ibuf , 2);
460 break;
461 }
462 }
463
464 break;
465 }
466
467 for (i = 0; i < num; i++) {
468 deb_xfer("%02x:%02x: %s ", i, msg[i].addr,
469 msg[i].flags == 0 ? ">>>" : "<<<");
470 debug_dump(msg[i].buf, msg[i].len, deb_xfer);
471 }
472
473 mutex_unlock(&d->i2c_mutex);
474 return num;
475}
476
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300477static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300478 int num)
479{
480 struct dvb_usb_device *d = i2c_get_adapdata(adap);
Julia Lawall21ead032009-12-22 18:00:07 -0300481 struct usb_device *udev;
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300482 int ret = 0;
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300483 int len, i, j;
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300484
485 if (!d)
486 return -ENODEV;
Julia Lawall21ead032009-12-22 18:00:07 -0300487 udev = d->udev;
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300488 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
489 return -EAGAIN;
490
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300491 for (j = 0; j < num; j++) {
492 switch (msg[j].addr) {
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300493 case (DW2102_RC_QUERY): {
494 u8 ibuf[4];
495 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
496 ibuf, 4, DW210X_READ_MSG);
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300497 memcpy(msg[j].buf, ibuf + 1, 2);
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300498 break;
499 }
500 case (DW2102_VOLTAGE_CTRL): {
501 u8 obuf[2];
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300502
503 obuf[0] = 1;
504 obuf[1] = msg[j].buf[1];/* off-on */
505 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
506 obuf, 2, DW210X_WRITE_MSG);
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300507 obuf[0] = 3;
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300508 obuf[1] = msg[j].buf[0];/* 13v-18v */
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300509 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
510 obuf, 2, DW210X_WRITE_MSG);
511 break;
512 }
Igor M. Liplianinfa8bae12011-02-25 18:41:22 -0300513 case (DW2102_LED_CTRL): {
514 u8 obuf[2];
515
516 obuf[0] = 5;
517 obuf[1] = msg[j].buf[0];
518 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
519 obuf, 2, DW210X_WRITE_MSG);
520 break;
521 }
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300522 /*case 0x55: cx24116
523 case 0x6a: stv0903
524 case 0x68: ds3000, stv0903
525 case 0x60: ts2020, stv6110, stb6100
526 case 0xa0: eeprom */
527 default: {
528 if (msg[j].flags == I2C_M_RD) {
529 /* read registers */
530 u8 ibuf[msg[j].len];
531 ret = dw210x_op_rw(d->udev, 0x91, 0, 0,
532 ibuf, msg[j].len,
533 DW210X_READ_MSG);
534 memcpy(msg[j].buf, ibuf, msg[j].len);
535 break;
536 } else if ((msg[j].buf[0] == 0xb0) &&
537 (msg[j].addr == 0x68)) {
538 /* write firmware */
539 u8 obuf[19];
540 obuf[0] = (msg[j].len > 16 ?
541 18 : msg[j].len + 1);
542 obuf[1] = msg[j].addr << 1;
543 obuf[2] = msg[j].buf[0];
544 len = msg[j].len - 1;
545 i = 1;
546 do {
547 memcpy(obuf + 3, msg[j].buf + i,
548 (len > 16 ? 16 : len));
549 ret = dw210x_op_rw(d->udev, 0x80, 0, 0,
550 obuf, (len > 16 ? 16 : len) + 3,
551 DW210X_WRITE_MSG);
552 i += 16;
553 len -= 16;
554 } while (len > 0);
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300555 } else if ((udev->descriptor.idProduct == 0x7500)
556 && (j < (num - 1))) {
557 /* write register addr before read */
558 u8 obuf[msg[j].len + 2];
559 obuf[0] = msg[j + 1].len;
560 obuf[1] = (msg[j].addr << 1);
561 memcpy(obuf + 2, msg[j].buf, msg[j].len);
562 ret = dw210x_op_rw(d->udev, 0x92, 0, 0,
563 obuf, msg[j].len + 2,
564 DW210X_WRITE_MSG);
565 break;
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300566 } else {
567 /* write registers */
568 u8 obuf[msg[j].len + 2];
569 obuf[0] = msg[j].len + 1;
570 obuf[1] = (msg[j].addr << 1);
571 memcpy(obuf + 2, msg[j].buf, msg[j].len);
572 ret = dw210x_op_rw(d->udev,
573 (num > 1 ? 0x90 : 0x80), 0, 0,
574 obuf, msg[j].len + 2,
575 DW210X_WRITE_MSG);
576 break;
577 }
578 break;
579 }
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300580 }
581
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300582 msleep(3);
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300583 }
584
585 mutex_unlock(&d->i2c_mutex);
586 return num;
587}
588
Igor M. Liplianind2ffc442011-02-25 18:41:22 -0300589static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
590 int num)
591{
592 struct dvb_usb_device *d = i2c_get_adapdata(adap);
593 u8 obuf[0x40], ibuf[0x40];
594
595 if (!d)
596 return -ENODEV;
597 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
598 return -EAGAIN;
599
600 switch (num) {
601 case 1:
602 switch (msg[0].addr) {
603 case SU3000_STREAM_CTRL:
604 obuf[0] = msg[0].buf[0] + 0x36;
605 obuf[1] = 3;
606 obuf[2] = 0;
607 if (dvb_usb_generic_rw(d, obuf, 3, ibuf, 0, 0) < 0)
608 err("i2c transfer failed.");
609 break;
610 case DW2102_RC_QUERY:
611 obuf[0] = 0x10;
612 if (dvb_usb_generic_rw(d, obuf, 1, ibuf, 2, 0) < 0)
613 err("i2c transfer failed.");
614 msg[0].buf[1] = ibuf[0];
615 msg[0].buf[0] = ibuf[1];
616 break;
617 default:
618 /* always i2c write*/
619 obuf[0] = 0x08;
620 obuf[1] = msg[0].addr;
621 obuf[2] = msg[0].len;
622
623 memcpy(&obuf[3], msg[0].buf, msg[0].len);
624
625 if (dvb_usb_generic_rw(d, obuf, msg[0].len + 3,
626 ibuf, 1, 0) < 0)
627 err("i2c transfer failed.");
628
629 }
630 break;
631 case 2:
632 /* always i2c read */
633 obuf[0] = 0x09;
634 obuf[1] = msg[0].len;
635 obuf[2] = msg[1].len;
636 obuf[3] = msg[0].addr;
637 memcpy(&obuf[4], msg[0].buf, msg[0].len);
638
639 if (dvb_usb_generic_rw(d, obuf, msg[0].len + 4,
640 ibuf, msg[1].len + 1, 0) < 0)
641 err("i2c transfer failed.");
642
643 memcpy(msg[1].buf, &ibuf[1], msg[1].len);
644 break;
645 default:
646 warn("more than 2 i2c messages at a time is not handled yet.");
647 break;
648 }
649 mutex_unlock(&d->i2c_mutex);
650 return num;
651}
652
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300653static u32 dw210x_i2c_func(struct i2c_adapter *adapter)
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300654{
655 return I2C_FUNC_I2C;
656}
657
658static struct i2c_algorithm dw2102_i2c_algo = {
659 .master_xfer = dw2102_i2c_transfer,
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300660 .functionality = dw210x_i2c_func,
661};
662
663static struct i2c_algorithm dw2102_serit_i2c_algo = {
664 .master_xfer = dw2102_serit_i2c_transfer,
665 .functionality = dw210x_i2c_func,
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300666};
667
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -0300668static struct i2c_algorithm dw2102_earda_i2c_algo = {
669 .master_xfer = dw2102_earda_i2c_transfer,
670 .functionality = dw210x_i2c_func,
671};
672
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300673static struct i2c_algorithm dw2104_i2c_algo = {
674 .master_xfer = dw2104_i2c_transfer,
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300675 .functionality = dw210x_i2c_func,
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300676};
677
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300678static struct i2c_algorithm dw3101_i2c_algo = {
679 .master_xfer = dw3101_i2c_transfer,
680 .functionality = dw210x_i2c_func,
681};
682
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300683static struct i2c_algorithm s6x0_i2c_algo = {
684 .master_xfer = s6x0_i2c_transfer,
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300685 .functionality = dw210x_i2c_func,
686};
687
Igor M. Liplianind2ffc442011-02-25 18:41:22 -0300688static struct i2c_algorithm su3000_i2c_algo = {
689 .master_xfer = su3000_i2c_transfer,
690 .functionality = dw210x_i2c_func,
691};
692
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300693static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300694{
695 int i;
696 u8 ibuf[] = {0, 0};
697 u8 eeprom[256], eepromline[16];
698
699 for (i = 0; i < 256; i++) {
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300700 if (dw210x_op_rw(d->udev, 0xb6, 0xa0 , i, ibuf, 2, DW210X_READ_MSG) < 0) {
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300701 err("read eeprom failed.");
702 return -1;
703 } else {
704 eepromline[i%16] = ibuf[0];
705 eeprom[i] = ibuf[0];
706 }
707 if ((i % 16) == 15) {
708 deb_xfer("%02x: ", i - 15);
709 debug_dump(eepromline, 16, deb_xfer);
710 }
711 }
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300712
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300713 memcpy(mac, eeprom + 8, 6);
714 return 0;
715};
716
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300717static int s6x0_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300718{
719 int i, ret;
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300720 u8 ibuf[] = { 0 }, obuf[] = { 0 };
721 u8 eeprom[256], eepromline[16];
722 struct i2c_msg msg[] = {
723 {
724 .addr = 0xa0 >> 1,
725 .flags = 0,
726 .buf = obuf,
727 .len = 1,
728 }, {
729 .addr = 0xa0 >> 1,
730 .flags = I2C_M_RD,
731 .buf = ibuf,
732 .len = 1,
733 }
734 };
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300735
736 for (i = 0; i < 256; i++) {
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300737 obuf[0] = i;
738 ret = s6x0_i2c_transfer(&d->i2c_adap, msg, 2);
739 if (ret != 2) {
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300740 err("read eeprom failed.");
741 return -1;
742 } else {
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300743 eepromline[i % 16] = ibuf[0];
744 eeprom[i] = ibuf[0];
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300745 }
746
747 if ((i % 16) == 15) {
748 deb_xfer("%02x: ", i - 15);
749 debug_dump(eepromline, 16, deb_xfer);
750 }
751 }
752
753 memcpy(mac, eeprom + 16, 6);
754 return 0;
755};
756
Igor M. Liplianind2ffc442011-02-25 18:41:22 -0300757static int su3000_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
758{
759 static u8 command_start[] = {0x00};
760 static u8 command_stop[] = {0x01};
761 struct i2c_msg msg = {
762 .addr = SU3000_STREAM_CTRL,
763 .flags = 0,
764 .buf = onoff ? command_start : command_stop,
765 .len = 1
766 };
767
768 i2c_transfer(&adap->dev->i2c_adap, &msg, 1);
769
770 return 0;
771}
772
773static int su3000_power_ctrl(struct dvb_usb_device *d, int i)
774{
775 struct su3000_state *state = (struct su3000_state *)d->priv;
776 u8 obuf[] = {0xde, 0};
777
778 info("%s: %d, initialized %d\n", __func__, i, state->initialized);
779
780 if (i && !state->initialized) {
781 state->initialized = 1;
782 /* reset board */
783 dvb_usb_generic_rw(d, obuf, 2, NULL, 0, 0);
784 }
785
786 return 0;
787}
788
789static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
790{
791 int i;
792 u8 obuf[] = { 0x1f, 0xf0 };
793 u8 ibuf[] = { 0 };
794 struct i2c_msg msg[] = {
795 {
796 .addr = 0x51,
797 .flags = 0,
798 .buf = obuf,
799 .len = 2,
800 }, {
801 .addr = 0x51,
802 .flags = I2C_M_RD,
803 .buf = ibuf,
804 .len = 1,
805
806 }
807 };
808
809 for (i = 0; i < 6; i++) {
810 obuf[1] = 0xf0 + i;
811 if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)
812 break;
813 else
814 mac[i] = ibuf[0];
815
816 debug_dump(mac, 6, printk);
817 }
818
819 return 0;
820}
821
822static int su3000_identify_state(struct usb_device *udev,
823 struct dvb_usb_device_properties *props,
824 struct dvb_usb_device_description **desc,
825 int *cold)
826{
827 info("%s\n", __func__);
828
829 *cold = 0;
830 return 0;
831}
832
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300833static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300834{
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300835 static u8 command_13v[] = {0x00, 0x01};
836 static u8 command_18v[] = {0x01, 0x01};
837 static u8 command_off[] = {0x00, 0x00};
838 struct i2c_msg msg = {
839 .addr = DW2102_VOLTAGE_CTRL,
840 .flags = 0,
841 .buf = command_off,
842 .len = 2,
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300843 };
844
845 struct dvb_usb_adapter *udev_adap =
846 (struct dvb_usb_adapter *)(fe->dvb->priv);
847 if (voltage == SEC_VOLTAGE_18)
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300848 msg.buf = command_18v;
849 else if (voltage == SEC_VOLTAGE_13)
850 msg.buf = command_13v;
851
852 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
853
Igor M Liplianin7fd48282008-07-20 08:05:50 -0300854 return 0;
855}
856
Igor M. Liplianinfa8bae12011-02-25 18:41:22 -0300857static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon)
858{
859 static u8 led_off[] = { 0 };
860 static u8 led_on[] = { 1 };
861 struct i2c_msg msg = {
862 .addr = DW2102_LED_CTRL,
863 .flags = 0,
864 .buf = led_off,
865 .len = 1
866 };
867 struct dvb_usb_adapter *udev_adap =
868 (struct dvb_usb_adapter *)(fe->dvb->priv);
869
870 if (offon)
871 msg.buf = led_on;
872 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
873}
874
Igor M. Liplianind4305c62008-10-17 13:45:55 -0300875static struct stv0299_config sharp_z0194a_config = {
876 .demod_address = 0x68,
877 .inittab = sharp_z0194a_inittab,
878 .mclk = 88000000UL,
879 .invert = 1,
880 .skip_reinit = 0,
881 .lock_output = STV0299_LOCKOUTPUT_1,
882 .volt13_op0_op1 = STV0299_VOLT13_OP1,
883 .min_delay_ms = 100,
884 .set_symbol_rate = sharp_z0194a_set_symbol_rate,
885};
886
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300887static struct cx24116_config dw2104_config = {
888 .demod_address = 0x55,
Igor M. Liplianincc8c4f32008-09-09 13:57:47 -0300889 .mpg_clk_pos_pol = 0x01,
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300890};
891
Igor M. Liplianin21b007b2008-09-17 19:19:19 -0300892static struct si21xx_config serit_sp1511lhb_config = {
893 .demod_address = 0x68,
894 .min_delay_ms = 100,
895
896};
897
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -0300898static struct tda10023_config dw3101_tda10023_config = {
899 .demod_address = 0x0c,
900 .invert = 1,
901};
902
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -0300903static struct mt312_config zl313_config = {
904 .demod_address = 0x0e,
905};
906
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300907static struct ds3000_config dw2104_ds3000_config = {
908 .demod_address = 0x68,
909};
910
911static struct stv0900_config dw2104a_stv0900_config = {
912 .demod_address = 0x6a,
913 .demod_mode = 0,
914 .xtal = 27000000,
915 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
916 .diseqc_mode = 2,/* 2/3 PWM */
917 .tun1_maddress = 0,/* 0x60 */
918 .tun1_adc = 0,/* 2 Vpp */
919 .path1_mode = 3,
920};
921
922static struct stb6100_config dw2104a_stb6100_config = {
923 .tuner_address = 0x60,
924 .refclock = 27000000,
925};
926
927static struct stv0900_config dw2104_stv0900_config = {
928 .demod_address = 0x68,
929 .demod_mode = 0,
930 .xtal = 8000000,
931 .clkmode = 3,
932 .diseqc_mode = 2,
933 .tun1_maddress = 0,
934 .tun1_adc = 1,/* 1 Vpp */
935 .path1_mode = 3,
936};
937
938static struct stv6110_config dw2104_stv6110_config = {
939 .i2c_address = 0x60,
940 .mclk = 16000000,
941 .clk_div = 1,
942};
943
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300944static struct stv0900_config prof_7500_stv0900_config = {
945 .demod_address = 0x6a,
946 .demod_mode = 0,
947 .xtal = 27000000,
948 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
949 .diseqc_mode = 2,/* 2/3 PWM */
950 .tun1_maddress = 0,/* 0x60 */
951 .tun1_adc = 0,/* 2 Vpp */
952 .path1_mode = 3,
953 .tun1_type = 3,
Igor M. Liplianinfa8bae12011-02-25 18:41:22 -0300954 .set_lock_led = dw210x_led_ctrl,
Igor M. Liplianincd79d332009-12-14 20:24:56 -0300955};
956
Igor M. Liplianind2ffc442011-02-25 18:41:22 -0300957static struct ds3000_config su3000_ds3000_config = {
958 .demod_address = 0x68,
959 .ci_mode = 1,
960};
961
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -0300962static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
963{
Igor M. Liplianin141cc352009-11-27 14:37:35 -0300964 struct dvb_tuner_ops *tuner_ops = NULL;
965
966 if (demod_probe & 4) {
967 d->fe = dvb_attach(stv0900_attach, &dw2104a_stv0900_config,
968 &d->dev->i2c_adap, 0);
969 if (d->fe != NULL) {
970 if (dvb_attach(stb6100_attach, d->fe,
971 &dw2104a_stb6100_config,
972 &d->dev->i2c_adap)) {
973 tuner_ops = &d->fe->ops.tuner_ops;
974 tuner_ops->set_frequency = stb6100_set_freq;
975 tuner_ops->get_frequency = stb6100_get_freq;
976 tuner_ops->set_bandwidth = stb6100_set_bandw;
977 tuner_ops->get_bandwidth = stb6100_get_bandw;
978 d->fe->ops.set_voltage = dw210x_set_voltage;
979 info("Attached STV0900+STB6100!\n");
980 return 0;
981 }
982 }
983 }
984
985 if (demod_probe & 2) {
986 d->fe = dvb_attach(stv0900_attach, &dw2104_stv0900_config,
987 &d->dev->i2c_adap, 0);
988 if (d->fe != NULL) {
989 if (dvb_attach(stv6110_attach, d->fe,
990 &dw2104_stv6110_config,
991 &d->dev->i2c_adap)) {
992 d->fe->ops.set_voltage = dw210x_set_voltage;
993 info("Attached STV0900+STV6110A!\n");
994 return 0;
995 }
996 }
997 }
998
999 if (demod_probe & 1) {
1000 d->fe = dvb_attach(cx24116_attach, &dw2104_config,
1001 &d->dev->i2c_adap);
1002 if (d->fe != NULL) {
1003 d->fe->ops.set_voltage = dw210x_set_voltage;
1004 info("Attached cx24116!\n");
1005 return 0;
1006 }
1007 }
1008
1009 d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
1010 &d->dev->i2c_adap);
1011 if (d->fe != NULL) {
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001012 d->fe->ops.set_voltage = dw210x_set_voltage;
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001013 info("Attached DS3000!\n");
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001014 return 0;
1015 }
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001016
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001017 return -EIO;
1018}
1019
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001020static struct dvb_usb_device_properties dw2102_properties;
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001021static struct dvb_usb_device_properties dw2104_properties;
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001022static struct dvb_usb_device_properties s6x0_properties;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001023
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001024static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
1025{
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001026 if (dw2102_properties.i2c_algo == &dw2102_serit_i2c_algo) {
1027 /*dw2102_properties.adapter->tuner_attach = NULL;*/
1028 d->fe = dvb_attach(si21xx_attach, &serit_sp1511lhb_config,
1029 &d->dev->i2c_adap);
1030 if (d->fe != NULL) {
1031 d->fe->ops.set_voltage = dw210x_set_voltage;
1032 info("Attached si21xx!\n");
1033 return 0;
1034 }
1035 }
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001036
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -03001037 if (dw2102_properties.i2c_algo == &dw2102_earda_i2c_algo) {
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -03001038 d->fe = dvb_attach(stv0288_attach, &earda_config,
1039 &d->dev->i2c_adap);
1040 if (d->fe != NULL) {
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001041 if (dvb_attach(stb6000_attach, d->fe, 0x61,
1042 &d->dev->i2c_adap)) {
1043 d->fe->ops.set_voltage = dw210x_set_voltage;
1044 info("Attached stv0288!\n");
1045 return 0;
1046 }
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -03001047 }
1048 }
1049
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001050 if (dw2102_properties.i2c_algo == &dw2102_i2c_algo) {
1051 /*dw2102_properties.adapter->tuner_attach = dw2102_tuner_attach;*/
1052 d->fe = dvb_attach(stv0299_attach, &sharp_z0194a_config,
1053 &d->dev->i2c_adap);
1054 if (d->fe != NULL) {
1055 d->fe->ops.set_voltage = dw210x_set_voltage;
1056 info("Attached stv0299!\n");
1057 return 0;
1058 }
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001059 }
1060 return -EIO;
1061}
1062
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001063static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
1064{
1065 d->fe = dvb_attach(tda10023_attach, &dw3101_tda10023_config,
1066 &d->dev->i2c_adap, 0x48);
1067 if (d->fe != NULL) {
1068 info("Attached tda10023!\n");
1069 return 0;
1070 }
1071 return -EIO;
1072}
1073
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001074static int zl100313_frontend_attach(struct dvb_usb_adapter *d)
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001075{
1076 d->fe = dvb_attach(mt312_attach, &zl313_config,
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001077 &d->dev->i2c_adap);
1078 if (d->fe != NULL) {
1079 if (dvb_attach(zl10039_attach, d->fe, 0x60,
1080 &d->dev->i2c_adap)) {
1081 d->fe->ops.set_voltage = dw210x_set_voltage;
1082 info("Attached zl100313+zl10039!\n");
1083 return 0;
1084 }
1085 }
1086
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001087 return -EIO;
1088}
1089
1090static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
1091{
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001092 d->fe = dvb_attach(stv0288_attach, &earda_config,
1093 &d->dev->i2c_adap);
1094 if (d->fe != NULL) {
1095 if (dvb_attach(stb6000_attach, d->fe, 0x61,
1096 &d->dev->i2c_adap)) {
1097 d->fe->ops.set_voltage = dw210x_set_voltage;
1098 info("Attached stv0288+stb6000!\n");
1099 return 0;
1100 }
1101 }
1102
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001103 return -EIO;
1104}
1105
1106static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
1107{
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001108 d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
1109 &d->dev->i2c_adap);
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001110 if (d->fe != NULL) {
1111 d->fe->ops.set_voltage = dw210x_set_voltage;
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001112 info("Attached ds3000+ds2020!\n");
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001113 return 0;
1114 }
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001115
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001116 return -EIO;
1117}
1118
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001119static int prof_7500_frontend_attach(struct dvb_usb_adapter *d)
1120{
Igor M. Liplianin4e59df82011-02-25 18:41:23 -03001121 u8 obuf[] = {7, 1};
1122
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001123 d->fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
1124 &d->dev->i2c_adap, 0);
1125 if (d->fe == NULL)
1126 return -EIO;
Igor M. Liplianin4e59df82011-02-25 18:41:23 -03001127
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001128 d->fe->ops.set_voltage = dw210x_set_voltage;
1129
Igor M. Liplianin4e59df82011-02-25 18:41:23 -03001130 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1131
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001132 info("Attached STV0900+STB6100A!\n");
1133
1134 return 0;
1135}
1136
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001137static int su3000_frontend_attach(struct dvb_usb_adapter *d)
1138{
1139 u8 obuf[3] = { 0xe, 0x80, 0 };
1140 u8 ibuf[] = { 0 };
1141
1142 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1143 err("command 0x0e transfer failed.");
1144
1145 obuf[0] = 0xe;
1146 obuf[1] = 0x83;
1147 obuf[2] = 0;
1148
1149 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1150 err("command 0x0e transfer failed.");
1151
1152 obuf[0] = 0xe;
1153 obuf[1] = 0x83;
1154 obuf[2] = 1;
1155
1156 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1157 err("command 0x0e transfer failed.");
1158
1159 obuf[0] = 0x51;
1160
1161 if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
1162 err("command 0x51 transfer failed.");
1163
1164 d->fe = dvb_attach(ds3000_attach, &su3000_ds3000_config,
1165 &d->dev->i2c_adap);
1166 if (d->fe == NULL)
1167 return -EIO;
1168
1169 info("Attached DS3000!\n");
1170
1171 return 0;
1172}
1173
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001174static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
1175{
1176 dvb_attach(dvb_pll_attach, adap->fe, 0x60,
1177 &adap->dev->i2c_adap, DVB_PLL_OPERA1);
1178 return 0;
1179}
1180
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001181static int dw3101_tuner_attach(struct dvb_usb_adapter *adap)
1182{
1183 dvb_attach(dvb_pll_attach, adap->fe, 0x60,
1184 &adap->dev->i2c_adap, DVB_PLL_TUA6034);
1185
1186 return 0;
1187}
1188
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001189static struct rc_map_table rc_map_dw210x_table[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -03001190 { 0xf80a, KEY_Q }, /*power*/
1191 { 0xf80c, KEY_M }, /*mute*/
1192 { 0xf811, KEY_1 },
1193 { 0xf812, KEY_2 },
1194 { 0xf813, KEY_3 },
1195 { 0xf814, KEY_4 },
1196 { 0xf815, KEY_5 },
1197 { 0xf816, KEY_6 },
1198 { 0xf817, KEY_7 },
1199 { 0xf818, KEY_8 },
1200 { 0xf819, KEY_9 },
1201 { 0xf810, KEY_0 },
1202 { 0xf81c, KEY_PAGEUP }, /*ch+*/
1203 { 0xf80f, KEY_PAGEDOWN }, /*ch-*/
1204 { 0xf81a, KEY_O }, /*vol+*/
1205 { 0xf80e, KEY_Z }, /*vol-*/
1206 { 0xf804, KEY_R }, /*rec*/
1207 { 0xf809, KEY_D }, /*fav*/
1208 { 0xf808, KEY_BACKSPACE }, /*rewind*/
1209 { 0xf807, KEY_A }, /*fast*/
1210 { 0xf80b, KEY_P }, /*pause*/
1211 { 0xf802, KEY_ESC }, /*cancel*/
1212 { 0xf803, KEY_G }, /*tab*/
1213 { 0xf800, KEY_UP }, /*up*/
1214 { 0xf81f, KEY_ENTER }, /*ok*/
1215 { 0xf801, KEY_DOWN }, /*down*/
1216 { 0xf805, KEY_C }, /*cap*/
1217 { 0xf806, KEY_S }, /*stop*/
1218 { 0xf840, KEY_F }, /*full*/
1219 { 0xf81e, KEY_W }, /*tvmode*/
1220 { 0xf81b, KEY_B }, /*recall*/
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001221};
1222
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001223static struct rc_map_table rc_map_tevii_table[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -03001224 { 0xf80a, KEY_POWER },
1225 { 0xf80c, KEY_MUTE },
1226 { 0xf811, KEY_1 },
1227 { 0xf812, KEY_2 },
1228 { 0xf813, KEY_3 },
1229 { 0xf814, KEY_4 },
1230 { 0xf815, KEY_5 },
1231 { 0xf816, KEY_6 },
1232 { 0xf817, KEY_7 },
1233 { 0xf818, KEY_8 },
1234 { 0xf819, KEY_9 },
1235 { 0xf810, KEY_0 },
1236 { 0xf81c, KEY_MENU },
1237 { 0xf80f, KEY_VOLUMEDOWN },
1238 { 0xf81a, KEY_LAST },
1239 { 0xf80e, KEY_OPEN },
1240 { 0xf804, KEY_RECORD },
1241 { 0xf809, KEY_VOLUMEUP },
1242 { 0xf808, KEY_CHANNELUP },
1243 { 0xf807, KEY_PVR },
1244 { 0xf80b, KEY_TIME },
1245 { 0xf802, KEY_RIGHT },
1246 { 0xf803, KEY_LEFT },
1247 { 0xf800, KEY_UP },
1248 { 0xf81f, KEY_OK },
1249 { 0xf801, KEY_DOWN },
1250 { 0xf805, KEY_TUNER },
1251 { 0xf806, KEY_CHANNELDOWN },
1252 { 0xf840, KEY_PLAYPAUSE },
1253 { 0xf81e, KEY_REWIND },
1254 { 0xf81b, KEY_FAVORITES },
1255 { 0xf81d, KEY_BACK },
1256 { 0xf84d, KEY_FASTFORWARD },
1257 { 0xf844, KEY_EPG },
1258 { 0xf84c, KEY_INFO },
1259 { 0xf841, KEY_AB },
1260 { 0xf843, KEY_AUDIO },
1261 { 0xf845, KEY_SUBTITLE },
1262 { 0xf84a, KEY_LIST },
1263 { 0xf846, KEY_F1 },
1264 { 0xf847, KEY_F2 },
1265 { 0xf85e, KEY_F3 },
1266 { 0xf85c, KEY_F4 },
1267 { 0xf852, KEY_F5 },
1268 { 0xf85a, KEY_F6 },
1269 { 0xf856, KEY_MODE },
1270 { 0xf858, KEY_SWITCHVIDEOMODE },
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001271};
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001272
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001273static struct rc_map_table rc_map_tbs_table[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -03001274 { 0xf884, KEY_POWER },
1275 { 0xf894, KEY_MUTE },
1276 { 0xf887, KEY_1 },
1277 { 0xf886, KEY_2 },
1278 { 0xf885, KEY_3 },
1279 { 0xf88b, KEY_4 },
1280 { 0xf88a, KEY_5 },
1281 { 0xf889, KEY_6 },
1282 { 0xf88f, KEY_7 },
1283 { 0xf88e, KEY_8 },
1284 { 0xf88d, KEY_9 },
1285 { 0xf892, KEY_0 },
1286 { 0xf896, KEY_CHANNELUP },
1287 { 0xf891, KEY_CHANNELDOWN },
1288 { 0xf893, KEY_VOLUMEUP },
1289 { 0xf88c, KEY_VOLUMEDOWN },
1290 { 0xf883, KEY_RECORD },
1291 { 0xf898, KEY_PAUSE },
1292 { 0xf899, KEY_OK },
1293 { 0xf89a, KEY_SHUFFLE },
1294 { 0xf881, KEY_UP },
1295 { 0xf890, KEY_LEFT },
1296 { 0xf882, KEY_RIGHT },
1297 { 0xf888, KEY_DOWN },
1298 { 0xf895, KEY_FAVORITES },
1299 { 0xf897, KEY_SUBTITLE },
1300 { 0xf89d, KEY_ZOOM },
1301 { 0xf89f, KEY_EXIT },
1302 { 0xf89e, KEY_MENU },
1303 { 0xf89c, KEY_EPG },
1304 { 0xf880, KEY_PREVIOUS },
1305 { 0xf89b, KEY_MODE }
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001306};
1307
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001308static struct rc_map_table rc_map_su3000_table[] = {
1309 { 0x25, KEY_POWER }, /* right-bottom Red */
1310 { 0x0a, KEY_MUTE }, /* -/-- */
1311 { 0x01, KEY_1 },
1312 { 0x02, KEY_2 },
1313 { 0x03, KEY_3 },
1314 { 0x04, KEY_4 },
1315 { 0x05, KEY_5 },
1316 { 0x06, KEY_6 },
1317 { 0x07, KEY_7 },
1318 { 0x08, KEY_8 },
1319 { 0x09, KEY_9 },
1320 { 0x00, KEY_0 },
1321 { 0x20, KEY_UP }, /* CH+ */
1322 { 0x21, KEY_DOWN }, /* CH+ */
1323 { 0x12, KEY_VOLUMEUP }, /* Brightness Up */
1324 { 0x13, KEY_VOLUMEDOWN },/* Brightness Down */
1325 { 0x1f, KEY_RECORD },
1326 { 0x17, KEY_PLAY },
1327 { 0x16, KEY_PAUSE },
1328 { 0x0b, KEY_STOP },
1329 { 0x27, KEY_FASTFORWARD },/* >> */
1330 { 0x26, KEY_REWIND }, /* << */
1331 { 0x0d, KEY_OK }, /* Mute */
1332 { 0x11, KEY_LEFT }, /* VOL- */
1333 { 0x10, KEY_RIGHT }, /* VOL+ */
1334 { 0x29, KEY_BACK }, /* button under 9 */
1335 { 0x2c, KEY_MENU }, /* TTX */
1336 { 0x2b, KEY_EPG }, /* EPG */
1337 { 0x1e, KEY_RED }, /* OSD */
1338 { 0x0e, KEY_GREEN }, /* Window */
1339 { 0x2d, KEY_YELLOW }, /* button under << */
1340 { 0x0f, KEY_BLUE }, /* bottom yellow button */
1341 { 0x14, KEY_AUDIO }, /* Snapshot */
1342 { 0x38, KEY_TV }, /* TV/Radio */
1343 { 0x0c, KEY_ESC } /* upper Red buttton */
1344};
1345
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001346static struct rc_map_dvb_usb_table_table keys_tables[] = {
1347 { rc_map_dw210x_table, ARRAY_SIZE(rc_map_dw210x_table) },
1348 { rc_map_tevii_table, ARRAY_SIZE(rc_map_tevii_table) },
1349 { rc_map_tbs_table, ARRAY_SIZE(rc_map_tbs_table) },
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001350 { rc_map_su3000_table, ARRAY_SIZE(rc_map_su3000_table) },
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001351};
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001352
1353static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
1354{
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001355 struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
1356 int keymap_size = d->props.rc.legacy.rc_map_size;
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001357 u8 key[2];
Igor M. Liplianin8a8dad72009-06-13 08:10:24 -03001358 struct i2c_msg msg = {
1359 .addr = DW2102_RC_QUERY,
1360 .flags = I2C_M_RD,
1361 .buf = key,
1362 .len = 2
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001363 };
1364 int i;
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001365 /* override keymap */
1366 if ((ir_keymap > 0) && (ir_keymap <= ARRAY_SIZE(keys_tables))) {
1367 keymap = keys_tables[ir_keymap - 1].rc_keys ;
1368 keymap_size = keys_tables[ir_keymap - 1].rc_keys_size;
Igor M. Liplianinfeb16e92011-02-25 18:41:22 -03001369 } else if (ir_keymap > ARRAY_SIZE(keys_tables))
1370 return 0; /* none */
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001371
1372 *state = REMOTE_NO_KEY_PRESSED;
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001373 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) {
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001374 for (i = 0; i < keymap_size ; i++) {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -03001375 if (rc5_data(&keymap[i]) == msg.buf[0]) {
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001376 *state = REMOTE_KEY_PRESSED;
Mauro Carvalho Chehab34abf212010-07-31 11:24:57 -03001377 *event = keymap[i].keycode;
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001378 break;
1379 }
Igor M. Liplianin8a8dad72009-06-13 08:10:24 -03001380
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001381 }
Igor M. Liplianin8a8dad72009-06-13 08:10:24 -03001382
1383 if ((*state) == REMOTE_KEY_PRESSED)
1384 deb_rc("%s: found rc key: %x, %x, event: %x\n",
1385 __func__, key[0], key[1], (*event));
1386 else if (key[0] != 0xff)
1387 deb_rc("%s: unknown rc key: %x, %x\n",
1388 __func__, key[0], key[1]);
1389
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001390 }
Igor M. Liplianin8a8dad72009-06-13 08:10:24 -03001391
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001392 return 0;
1393}
1394
1395static struct usb_device_id dw2102_table[] = {
1396 {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW2102)},
1397 {USB_DEVICE(USB_VID_CYPRESS, 0x2101)},
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001398 {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW2104)},
1399 {USB_DEVICE(0x9022, USB_PID_TEVII_S650)},
Igor M. Liplianin4cc0edf2008-11-05 22:12:56 -03001400 {USB_DEVICE(USB_VID_TERRATEC, USB_PID_CINERGY_S)},
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001401 {USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW3101)},
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001402 {USB_DEVICE(0x9022, USB_PID_TEVII_S630)},
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001403 {USB_DEVICE(0x3011, USB_PID_PROF_1100)},
1404 {USB_DEVICE(0x9022, USB_PID_TEVII_S660)},
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001405 {USB_DEVICE(0x3034, 0x7500)},
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001406 {USB_DEVICE(0x1f4d, 0x3000)},
Igor M. Liplianin2adc5912011-02-25 18:41:22 -03001407 {USB_DEVICE(USB_VID_TERRATEC, 0x00a8)},
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001408 { }
1409};
1410
1411MODULE_DEVICE_TABLE(usb, dw2102_table);
1412
1413static int dw2102_load_firmware(struct usb_device *dev,
1414 const struct firmware *frmwr)
1415{
1416 u8 *b, *p;
1417 int ret = 0, i;
1418 u8 reset;
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -03001419 u8 reset16[] = {0, 0, 0, 0, 0, 0, 0};
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001420 const struct firmware *fw;
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001421 const char *fw_2101 = "dvb-usb-dw2101.fw";
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001422
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001423 switch (dev->descriptor.idProduct) {
1424 case 0x2101:
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001425 ret = request_firmware(&fw, fw_2101, &dev->dev);
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001426 if (ret != 0) {
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001427 err(err_str, fw_2101);
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001428 return ret;
1429 }
1430 break;
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001431 default:
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001432 fw = frmwr;
1433 break;
1434 }
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001435 info("start downloading DW210X firmware");
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001436 p = kmalloc(fw->size, GFP_KERNEL);
1437 reset = 1;
1438 /*stop the CPU*/
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001439 dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1, DW210X_WRITE_MSG);
1440 dw210x_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1, DW210X_WRITE_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001441
1442 if (p != NULL) {
1443 memcpy(p, fw->data, fw->size);
1444 for (i = 0; i < fw->size; i += 0x40) {
1445 b = (u8 *) p + i;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001446 if (dw210x_op_rw(dev, 0xa0, i, 0, b , 0x40,
1447 DW210X_WRITE_MSG) != 0x40) {
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001448 err("error while transferring firmware");
1449 ret = -EINVAL;
1450 break;
1451 }
1452 }
1453 /* restart the CPU */
1454 reset = 0;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001455 if (ret || dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1,
1456 DW210X_WRITE_MSG) != 1) {
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001457 err("could not restart the USB controller CPU.");
1458 ret = -EINVAL;
1459 }
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001460 if (ret || dw210x_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1,
1461 DW210X_WRITE_MSG) != 1) {
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001462 err("could not restart the USB controller CPU.");
1463 ret = -EINVAL;
1464 }
1465 /* init registers */
1466 switch (dev->descriptor.idProduct) {
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001467 case USB_PID_TEVII_S650:
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001468 dw2104_properties.rc.legacy.rc_map_table = rc_map_tevii_table;
1469 dw2104_properties.rc.legacy.rc_map_size =
1470 ARRAY_SIZE(rc_map_tevii_table);
Igor M. Liplianinb42e1d72009-06-14 19:41:22 -03001471 case USB_PID_DW2104:
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001472 reset = 1;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001473 dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1,
1474 DW210X_WRITE_MSG);
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001475 /* break omitted intentionally */
1476 case USB_PID_DW3101:
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001477 reset = 0;
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001478 dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
1479 DW210X_WRITE_MSG);
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001480 break;
Igor M. Liplianin4cc0edf2008-11-05 22:12:56 -03001481 case USB_PID_CINERGY_S:
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001482 case USB_PID_DW2102:
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001483 dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
1484 DW210X_WRITE_MSG);
1485 dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
1486 DW210X_READ_MSG);
1487 /* check STV0299 frontend */
1488 dw210x_op_rw(dev, 0xb5, 0, 0, &reset16[0], 2,
1489 DW210X_READ_MSG);
Igor M. Liplianinea023df2008-12-04 12:49:23 -03001490 if ((reset16[0] == 0xa1) || (reset16[0] == 0x80)) {
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001491 dw2102_properties.i2c_algo = &dw2102_i2c_algo;
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -03001492 dw2102_properties.adapter->tuner_attach = &dw2102_tuner_attach;
1493 break;
1494 } else {
1495 /* check STV0288 frontend */
1496 reset16[0] = 0xd0;
1497 reset16[1] = 1;
1498 reset16[2] = 0;
1499 dw210x_op_rw(dev, 0xc2, 0, 0, &reset16[0], 3,
1500 DW210X_WRITE_MSG);
1501 dw210x_op_rw(dev, 0xc3, 0xd1, 0, &reset16[0], 3,
1502 DW210X_READ_MSG);
1503 if (reset16[2] == 0x11) {
1504 dw2102_properties.i2c_algo = &dw2102_earda_i2c_algo;
Igor M. Liplianin8a4949b2008-10-05 09:11:21 -03001505 break;
1506 }
1507 }
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001508 case 0x2101:
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001509 dw210x_op_rw(dev, 0xbc, 0x0030, 0, &reset16[0], 2,
1510 DW210X_READ_MSG);
1511 dw210x_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
1512 DW210X_READ_MSG);
1513 dw210x_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
1514 DW210X_READ_MSG);
1515 dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
1516 DW210X_READ_MSG);
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001517 break;
1518 }
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001519
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001520 msleep(100);
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001521 kfree(p);
1522 }
1523 return ret;
1524}
1525
1526static struct dvb_usb_device_properties dw2102_properties = {
1527 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1528 .usb_ctrl = DEVICE_SPECIFIC,
1529 .firmware = "dvb-usb-dw2102.fw",
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001530 .no_reconnect = 1,
1531
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001532 .i2c_algo = &dw2102_serit_i2c_algo,
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001533
1534 .rc.legacy = {
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001535 .rc_map_table = rc_map_dw210x_table,
1536 .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001537 .rc_interval = 150,
1538 .rc_query = dw2102_rc_query,
1539 },
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001540
1541 .generic_bulk_ctrl_endpoint = 0x81,
1542 /* parameter for the MPEG2-data transfer */
1543 .num_adapters = 1,
1544 .download_firmware = dw2102_load_firmware,
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001545 .read_mac_address = dw210x_read_mac_address,
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001546 .adapter = {
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001547 {
1548 .frontend_attach = dw2102_frontend_attach,
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001549 .stream = {
1550 .type = USB_BULK,
1551 .count = 8,
1552 .endpoint = 0x82,
1553 .u = {
1554 .bulk = {
1555 .buffersize = 4096,
1556 }
1557 }
1558 },
1559 }
1560 },
Igor M. Liplianin4cc0edf2008-11-05 22:12:56 -03001561 .num_device_descs = 3,
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001562 .devices = {
1563 {"DVBWorld DVB-S 2102 USB2.0",
1564 {&dw2102_table[0], NULL},
1565 {NULL},
1566 },
1567 {"DVBWorld DVB-S 2101 USB2.0",
1568 {&dw2102_table[1], NULL},
1569 {NULL},
1570 },
Igor M. Liplianin4cc0edf2008-11-05 22:12:56 -03001571 {"TerraTec Cinergy S USB",
1572 {&dw2102_table[4], NULL},
1573 {NULL},
1574 },
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001575 }
1576};
1577
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001578static struct dvb_usb_device_properties dw2104_properties = {
1579 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1580 .usb_ctrl = DEVICE_SPECIFIC,
1581 .firmware = "dvb-usb-dw2104.fw",
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001582 .no_reconnect = 1,
1583
1584 .i2c_algo = &dw2104_i2c_algo,
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001585 .rc.legacy = {
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001586 .rc_map_table = rc_map_dw210x_table,
1587 .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001588 .rc_interval = 150,
1589 .rc_query = dw2102_rc_query,
1590 },
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001591
1592 .generic_bulk_ctrl_endpoint = 0x81,
1593 /* parameter for the MPEG2-data transfer */
1594 .num_adapters = 1,
1595 .download_firmware = dw2102_load_firmware,
Igor M. Liplianin21b007b2008-09-17 19:19:19 -03001596 .read_mac_address = dw210x_read_mac_address,
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001597 .adapter = {
1598 {
1599 .frontend_attach = dw2104_frontend_attach,
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001600 .stream = {
1601 .type = USB_BULK,
1602 .count = 8,
1603 .endpoint = 0x82,
1604 .u = {
1605 .bulk = {
1606 .buffersize = 4096,
1607 }
1608 }
1609 },
1610 }
1611 },
1612 .num_device_descs = 2,
1613 .devices = {
1614 { "DVBWorld DW2104 USB2.0",
1615 {&dw2102_table[2], NULL},
1616 {NULL},
1617 },
1618 { "TeVii S650 USB2.0",
1619 {&dw2102_table[3], NULL},
1620 {NULL},
1621 },
1622 }
1623};
1624
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001625static struct dvb_usb_device_properties dw3101_properties = {
1626 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1627 .usb_ctrl = DEVICE_SPECIFIC,
1628 .firmware = "dvb-usb-dw3101.fw",
1629 .no_reconnect = 1,
1630
1631 .i2c_algo = &dw3101_i2c_algo,
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001632 .rc.legacy = {
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001633 .rc_map_table = rc_map_dw210x_table,
1634 .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001635 .rc_interval = 150,
1636 .rc_query = dw2102_rc_query,
1637 },
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001638
1639 .generic_bulk_ctrl_endpoint = 0x81,
1640 /* parameter for the MPEG2-data transfer */
1641 .num_adapters = 1,
1642 .download_firmware = dw2102_load_firmware,
1643 .read_mac_address = dw210x_read_mac_address,
1644 .adapter = {
1645 {
1646 .frontend_attach = dw3101_frontend_attach,
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001647 .tuner_attach = dw3101_tuner_attach,
1648 .stream = {
1649 .type = USB_BULK,
1650 .count = 8,
1651 .endpoint = 0x82,
1652 .u = {
1653 .bulk = {
1654 .buffersize = 4096,
1655 }
1656 }
1657 },
1658 }
1659 },
1660 .num_device_descs = 1,
1661 .devices = {
1662 { "DVBWorld DVB-C 3101 USB2.0",
1663 {&dw2102_table[5], NULL},
1664 {NULL},
1665 },
1666 }
1667};
1668
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001669static struct dvb_usb_device_properties s6x0_properties = {
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001670 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1671 .usb_ctrl = DEVICE_SPECIFIC,
1672 .firmware = "dvb-usb-s630.fw",
1673 .no_reconnect = 1,
1674
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001675 .i2c_algo = &s6x0_i2c_algo,
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001676 .rc.legacy = {
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001677 .rc_map_table = rc_map_tevii_table,
1678 .rc_map_size = ARRAY_SIZE(rc_map_tevii_table),
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001679 .rc_interval = 150,
1680 .rc_query = dw2102_rc_query,
1681 },
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001682
1683 .generic_bulk_ctrl_endpoint = 0x81,
1684 .num_adapters = 1,
1685 .download_firmware = dw2102_load_firmware,
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001686 .read_mac_address = s6x0_read_mac_address,
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001687 .adapter = {
1688 {
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001689 .frontend_attach = zl100313_frontend_attach,
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001690 .stream = {
1691 .type = USB_BULK,
1692 .count = 8,
1693 .endpoint = 0x82,
1694 .u = {
1695 .bulk = {
1696 .buffersize = 4096,
1697 }
1698 }
1699 },
1700 }
1701 },
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001702 .num_device_descs = 1,
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001703 .devices = {
1704 {"TeVii S630 USB",
1705 {&dw2102_table[6], NULL},
1706 {NULL},
1707 },
1708 }
1709};
1710
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001711struct dvb_usb_device_properties *p1100;
1712static struct dvb_usb_device_description d1100 = {
1713 "Prof 1100 USB ",
1714 {&dw2102_table[7], NULL},
1715 {NULL},
1716};
1717
1718struct dvb_usb_device_properties *s660;
1719static struct dvb_usb_device_description d660 = {
1720 "TeVii S660 USB",
1721 {&dw2102_table[8], NULL},
1722 {NULL},
1723};
1724
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001725struct dvb_usb_device_properties *p7500;
1726static struct dvb_usb_device_description d7500 = {
1727 "Prof 7500 USB DVB-S2",
1728 {&dw2102_table[9], NULL},
1729 {NULL},
1730};
1731
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001732static struct dvb_usb_device_properties su3000_properties = {
1733 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1734 .usb_ctrl = DEVICE_SPECIFIC,
1735 .size_of_priv = sizeof(struct su3000_state),
1736 .power_ctrl = su3000_power_ctrl,
1737 .num_adapters = 1,
1738 .identify_state = su3000_identify_state,
1739 .i2c_algo = &su3000_i2c_algo,
1740
1741 .rc.legacy = {
1742 .rc_map_table = rc_map_su3000_table,
1743 .rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
1744 .rc_interval = 150,
1745 .rc_query = dw2102_rc_query,
1746 },
1747
1748 .read_mac_address = su3000_read_mac_address,
1749
1750 .generic_bulk_ctrl_endpoint = 0x01,
1751
1752 .adapter = {
1753 {
1754 .streaming_ctrl = su3000_streaming_ctrl,
1755 .frontend_attach = su3000_frontend_attach,
1756 .stream = {
1757 .type = USB_BULK,
1758 .count = 8,
1759 .endpoint = 0x82,
1760 .u = {
1761 .bulk = {
1762 .buffersize = 4096,
1763 }
1764 }
1765 }
1766 }
1767 },
Igor M. Liplianin2adc5912011-02-25 18:41:22 -03001768 .num_device_descs = 2,
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001769 .devices = {
1770 { "SU3000HD DVB-S USB2.0",
1771 { &dw2102_table[10], NULL },
1772 { NULL },
1773 },
Igor M. Liplianin2adc5912011-02-25 18:41:22 -03001774 { "Terratec Cinergy S2 USB HD",
1775 { &dw2102_table[11], NULL },
1776 { NULL },
1777 },
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001778 }
1779};
1780
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001781static int dw2102_probe(struct usb_interface *intf,
1782 const struct usb_device_id *id)
1783{
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001784 p1100 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1785 if (!p1100)
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001786 return -ENOMEM;
1787 /* copy default structure */
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001788 memcpy(p1100, &s6x0_properties,
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001789 sizeof(struct dvb_usb_device_properties));
1790 /* fill only different fields */
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001791 p1100->firmware = "dvb-usb-p1100.fw";
1792 p1100->devices[0] = d1100;
1793 p1100->rc.legacy.rc_map_table = rc_map_tbs_table;
1794 p1100->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
1795 p1100->adapter->frontend_attach = stv0288_frontend_attach;
1796
1797 s660 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1798 if (!s660) {
1799 kfree(p1100);
1800 return -ENOMEM;
1801 }
1802 memcpy(s660, &s6x0_properties,
1803 sizeof(struct dvb_usb_device_properties));
1804 s660->firmware = "dvb-usb-s660.fw";
1805 s660->devices[0] = d660;
1806 s660->adapter->frontend_attach = ds3000_frontend_attach;
1807
1808 p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1809 if (!p7500) {
1810 kfree(p1100);
1811 kfree(s660);
1812 return -ENOMEM;
1813 }
1814 memcpy(p7500, &s6x0_properties,
1815 sizeof(struct dvb_usb_device_properties));
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001816 p7500->firmware = "dvb-usb-p7500.fw";
1817 p7500->devices[0] = d7500;
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -03001818 p7500->rc.legacy.rc_map_table = rc_map_tbs_table;
1819 p7500->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001820 p7500->adapter->frontend_attach = prof_7500_frontend_attach;
1821
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001822 if (0 == dvb_usb_device_init(intf, &dw2102_properties,
1823 THIS_MODULE, NULL, adapter_nr) ||
1824 0 == dvb_usb_device_init(intf, &dw2104_properties,
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001825 THIS_MODULE, NULL, adapter_nr) ||
1826 0 == dvb_usb_device_init(intf, &dw3101_properties,
Igor M. Liplianind0a1dda2009-06-20 09:54:18 -03001827 THIS_MODULE, NULL, adapter_nr) ||
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001828 0 == dvb_usb_device_init(intf, &s6x0_properties,
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001829 THIS_MODULE, NULL, adapter_nr) ||
Igor M. Liplianin195288d2011-02-25 18:41:22 -03001830 0 == dvb_usb_device_init(intf, p1100,
1831 THIS_MODULE, NULL, adapter_nr) ||
1832 0 == dvb_usb_device_init(intf, s660,
1833 THIS_MODULE, NULL, adapter_nr) ||
Igor M. Liplianincd79d332009-12-14 20:24:56 -03001834 0 == dvb_usb_device_init(intf, p7500,
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001835 THIS_MODULE, NULL, adapter_nr) ||
1836 0 == dvb_usb_device_init(intf, &su3000_properties,
1837 THIS_MODULE, NULL, adapter_nr))
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001838 return 0;
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001839
Igor M. Liplianinfe03d5e2008-09-08 17:16:40 -03001840 return -ENODEV;
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001841}
1842
1843static struct usb_driver dw2102_driver = {
1844 .name = "dw2102",
1845 .probe = dw2102_probe,
1846 .disconnect = dvb_usb_device_exit,
1847 .id_table = dw2102_table,
1848};
1849
1850static int __init dw2102_module_init(void)
1851{
1852 int ret = usb_register(&dw2102_driver);
1853 if (ret)
1854 err("usb_register failed. Error number %d", ret);
1855
1856 return ret;
1857}
1858
1859static void __exit dw2102_module_exit(void)
1860{
1861 usb_deregister(&dw2102_driver);
1862}
1863
1864module_init(dw2102_module_init);
1865module_exit(dw2102_module_exit);
1866
1867MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
Igor M. Liplianin1dac77c2009-06-14 20:51:45 -03001868MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
1869 " DVB-C 3101 USB2.0,"
Igor M. Liplianin141cc352009-11-27 14:37:35 -03001870 " TeVii S600, S630, S650, S660 USB2.0,"
Igor M. Liplianind2ffc442011-02-25 18:41:22 -03001871 " Prof 1100, 7500 USB2.0,"
1872 " Geniatech SU3000 devices");
Igor M Liplianin7fd48282008-07-20 08:05:50 -03001873MODULE_VERSION("0.1");
1874MODULE_LICENSE("GPL");