1 // SPDX-License-Identifier: GPL-2.0-only
2 /* DVB USB framework compliant Linux driver for the
3 * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
4 * TeVii S421, S480, S482, S600, S630, S632, S650, S660, S662,
6 * Geniatech SU3000, T220,
8 * Terratec Cinergy S2 cards
9 * Copyright (C) 2008-2012 Igor M. Liplianin (liplianin@me.by)
11 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
13 #include <media/dvb-usb-ids.h>
30 #include "stb6100_proc.h"
31 #include "m88rs2000.h"
34 #include "m88ds3103.h"
36 /* Max transfer size done by I2C transfer functions */
37 #define MAX_XFER_SIZE 64
40 #define DW210X_READ_MSG 0
41 #define DW210X_WRITE_MSG 1
43 #define REG_1F_SYMBOLRATE_BYTE0 0x1f
44 #define REG_20_SYMBOLRATE_BYTE1 0x20
45 #define REG_21_SYMBOLRATE_BYTE2 0x21
47 #define DW2102_VOLTAGE_CTRL (0x1800)
48 #define SU3000_STREAM_CTRL (0x1900)
49 #define DW2102_RC_QUERY (0x1a00)
50 #define DW2102_LED_CTRL (0x1b00)
52 #define DW2101_FIRMWARE "dvb-usb-dw2101.fw"
53 #define DW2102_FIRMWARE "dvb-usb-dw2102.fw"
54 #define DW2104_FIRMWARE "dvb-usb-dw2104.fw"
55 #define DW3101_FIRMWARE "dvb-usb-dw3101.fw"
56 #define S630_FIRMWARE "dvb-usb-s630.fw"
57 #define S660_FIRMWARE "dvb-usb-s660.fw"
58 #define P1100_FIRMWARE "dvb-usb-p1100.fw"
59 #define P7500_FIRMWARE "dvb-usb-p7500.fw"
61 #define err_str "did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware"
66 u8 data[MAX_XFER_SIZE + 4];
67 struct i2c_client *i2c_client_demod;
68 struct i2c_client *i2c_client_tuner;
70 /* fe hook functions*/
71 int (*old_set_voltage)(struct dvb_frontend *f, enum fe_sec_voltage v);
72 int (*fe_read_status)(struct dvb_frontend *fe,
73 enum fe_status *status);
77 static int dvb_usb_dw2102_debug;
78 module_param_named(debug, dvb_usb_dw2102_debug, int, 0644);
79 MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))."
80 DVB_USB_DEBUG_STATUS);
83 static int demod_probe = 1;
84 module_param_named(demod, demod_probe, int, 0644);
85 MODULE_PARM_DESC(demod, "demod to probe (1=cx24116 2=stv0903+stv6110 4=stv0903+stb6100(or-able)).");
87 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
89 static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
90 u16 index, u8 * data, u16 len, int flags)
94 unsigned int pipe = (flags == DW210X_READ_MSG) ?
95 usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
96 u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;
98 u8buf = kmalloc(len, GFP_KERNEL);
103 if (flags == DW210X_WRITE_MSG)
104 memcpy(u8buf, data, len);
105 ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR,
106 value, index , u8buf, len, 2000);
108 if (flags == DW210X_READ_MSG)
109 memcpy(data, u8buf, len);
116 static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
119 struct dvb_usb_device *d = i2c_get_adapdata(adap);
121 u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0};
126 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
131 /* read stv0299 register */
132 value = msg[0].buf[0];/* register */
133 for (i = 0; i < msg[1].len; i++) {
134 dw210x_op_rw(d->udev, 0xb5, value + i, 0,
135 buf6, 2, DW210X_READ_MSG);
136 msg[1].buf[i] = buf6[0];
140 switch (msg[0].addr) {
142 /* write to stv0299 register */
144 buf6[1] = msg[0].buf[0];
145 buf6[2] = msg[0].buf[1];
146 dw210x_op_rw(d->udev, 0xb2, 0, 0,
147 buf6, 3, DW210X_WRITE_MSG);
150 if (msg[0].flags == 0) {
151 /* write to tuner pll */
155 buf6[3] = msg[0].buf[0];
156 buf6[4] = msg[0].buf[1];
157 buf6[5] = msg[0].buf[2];
158 buf6[6] = msg[0].buf[3];
159 dw210x_op_rw(d->udev, 0xb2, 0, 0,
160 buf6, 7, DW210X_WRITE_MSG);
162 /* read from tuner */
163 dw210x_op_rw(d->udev, 0xb5, 0, 0,
164 buf6, 1, DW210X_READ_MSG);
165 msg[0].buf[0] = buf6[0];
168 case (DW2102_RC_QUERY):
169 dw210x_op_rw(d->udev, 0xb8, 0, 0,
170 buf6, 2, DW210X_READ_MSG);
171 msg[0].buf[0] = buf6[0];
172 msg[0].buf[1] = buf6[1];
174 case (DW2102_VOLTAGE_CTRL):
176 buf6[1] = msg[0].buf[0];
177 dw210x_op_rw(d->udev, 0xb2, 0, 0,
178 buf6, 2, DW210X_WRITE_MSG);
185 mutex_unlock(&d->i2c_mutex);
189 static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap,
190 struct i2c_msg msg[], int num)
192 struct dvb_usb_device *d = i2c_get_adapdata(adap);
193 u8 buf6[] = {0, 0, 0, 0, 0, 0, 0};
197 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
202 if (msg[0].len != 1) {
203 warn("i2c rd: len=%d is not 1!\n",
209 if (2 + msg[1].len > sizeof(buf6)) {
210 warn("i2c rd: len=%d is too big!\n",
216 /* read si2109 register by number */
217 buf6[0] = msg[0].addr << 1;
218 buf6[1] = msg[0].len;
219 buf6[2] = msg[0].buf[0];
220 dw210x_op_rw(d->udev, 0xc2, 0, 0,
221 buf6, msg[0].len + 2, DW210X_WRITE_MSG);
222 /* read si2109 register */
223 dw210x_op_rw(d->udev, 0xc3, 0xd0, 0,
224 buf6, msg[1].len + 2, DW210X_READ_MSG);
225 memcpy(msg[1].buf, buf6 + 2, msg[1].len);
229 switch (msg[0].addr) {
231 if (2 + msg[0].len > sizeof(buf6)) {
232 warn("i2c wr: len=%d is too big!\n",
238 /* write to si2109 register */
239 buf6[0] = msg[0].addr << 1;
240 buf6[1] = msg[0].len;
241 memcpy(buf6 + 2, msg[0].buf, msg[0].len);
242 dw210x_op_rw(d->udev, 0xc2, 0, 0, buf6,
243 msg[0].len + 2, DW210X_WRITE_MSG);
245 case(DW2102_RC_QUERY):
246 dw210x_op_rw(d->udev, 0xb8, 0, 0,
247 buf6, 2, DW210X_READ_MSG);
248 msg[0].buf[0] = buf6[0];
249 msg[0].buf[1] = buf6[1];
251 case(DW2102_VOLTAGE_CTRL):
253 buf6[1] = msg[0].buf[0];
254 dw210x_op_rw(d->udev, 0xb2, 0, 0,
255 buf6, 2, DW210X_WRITE_MSG);
261 mutex_unlock(&d->i2c_mutex);
265 static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
267 struct dvb_usb_device *d = i2c_get_adapdata(adap);
272 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
278 /* first write first register number */
279 u8 ibuf[MAX_XFER_SIZE], obuf[3];
281 if (2 + msg[0].len != sizeof(obuf)) {
282 warn("i2c rd: len=%d is not 1!\n",
288 if (2 + msg[1].len > sizeof(ibuf)) {
289 warn("i2c rd: len=%d is too big!\n",
295 obuf[0] = msg[0].addr << 1;
296 obuf[1] = msg[0].len;
297 obuf[2] = msg[0].buf[0];
298 dw210x_op_rw(d->udev, 0xc2, 0, 0,
299 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
300 /* second read registers */
301 dw210x_op_rw(d->udev, 0xc3, 0xd1 , 0,
302 ibuf, msg[1].len + 2, DW210X_READ_MSG);
303 memcpy(msg[1].buf, ibuf + 2, msg[1].len);
308 switch (msg[0].addr) {
310 /* write to register */
311 u8 obuf[MAX_XFER_SIZE];
313 if (2 + msg[0].len > sizeof(obuf)) {
314 warn("i2c wr: len=%d is too big!\n",
320 obuf[0] = msg[0].addr << 1;
321 obuf[1] = msg[0].len;
322 memcpy(obuf + 2, msg[0].buf, msg[0].len);
323 dw210x_op_rw(d->udev, 0xc2, 0, 0,
324 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
329 u8 obuf[MAX_XFER_SIZE];
331 if (2 + msg[0].len > sizeof(obuf)) {
332 warn("i2c wr: len=%d is too big!\n",
338 obuf[0] = msg[0].addr << 1;
339 obuf[1] = msg[0].len;
340 memcpy(obuf + 2, msg[0].buf, msg[0].len);
341 dw210x_op_rw(d->udev, 0xc2, 0, 0,
342 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
345 case(DW2102_RC_QUERY): {
347 dw210x_op_rw(d->udev, 0xb8, 0, 0,
348 ibuf, 2, DW210X_READ_MSG);
349 memcpy(msg[0].buf, ibuf , 2);
352 case(DW2102_VOLTAGE_CTRL): {
355 obuf[1] = msg[0].buf[0];
356 dw210x_op_rw(d->udev, 0xb2, 0, 0,
357 obuf, 2, DW210X_WRITE_MSG);
367 mutex_unlock(&d->i2c_mutex);
371 static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
373 struct dvb_usb_device *d = i2c_get_adapdata(adap);
378 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
381 for (j = 0; j < num; j++) {
382 switch (msg[j].addr) {
383 case(DW2102_RC_QUERY): {
385 dw210x_op_rw(d->udev, 0xb8, 0, 0,
386 ibuf, 2, DW210X_READ_MSG);
387 memcpy(msg[j].buf, ibuf , 2);
390 case(DW2102_VOLTAGE_CTRL): {
393 obuf[1] = msg[j].buf[0];
394 dw210x_op_rw(d->udev, 0xb2, 0, 0,
395 obuf, 2, DW210X_WRITE_MSG);
400 case 0x68: ds3000, stv0903
401 case 0x60: ts2020, stv6110, stb6100 */
403 if (msg[j].flags == I2C_M_RD) {
405 u8 ibuf[MAX_XFER_SIZE];
407 if (2 + msg[j].len > sizeof(ibuf)) {
408 warn("i2c rd: len=%d is too big!\n",
414 dw210x_op_rw(d->udev, 0xc3,
415 (msg[j].addr << 1) + 1, 0,
416 ibuf, msg[j].len + 2,
418 memcpy(msg[j].buf, ibuf + 2, msg[j].len);
420 } else if (((msg[j].buf[0] == 0xb0) &&
421 (msg[j].addr == 0x68)) ||
422 ((msg[j].buf[0] == 0xf7) &&
423 (msg[j].addr == 0x55))) {
426 obuf[0] = msg[j].addr << 1;
427 obuf[1] = (msg[j].len > 15 ? 17 : msg[j].len);
428 obuf[2] = msg[j].buf[0];
429 len = msg[j].len - 1;
432 memcpy(obuf + 3, msg[j].buf + i,
433 (len > 16 ? 16 : len));
434 dw210x_op_rw(d->udev, 0xc2, 0, 0,
435 obuf, (len > 16 ? 16 : len) + 3,
441 /* write registers */
442 u8 obuf[MAX_XFER_SIZE];
444 if (2 + msg[j].len > sizeof(obuf)) {
445 warn("i2c wr: len=%d is too big!\n",
451 obuf[0] = msg[j].addr << 1;
452 obuf[1] = msg[j].len;
453 memcpy(obuf + 2, msg[j].buf, msg[j].len);
454 dw210x_op_rw(d->udev, 0xc2, 0, 0,
455 obuf, msg[j].len + 2,
466 mutex_unlock(&d->i2c_mutex);
470 static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
473 struct dvb_usb_device *d = i2c_get_adapdata(adap);
479 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
485 /* first write first register number */
486 u8 ibuf[MAX_XFER_SIZE], obuf[3];
488 if (2 + msg[0].len != sizeof(obuf)) {
489 warn("i2c rd: len=%d is not 1!\n",
494 if (2 + msg[1].len > sizeof(ibuf)) {
495 warn("i2c rd: len=%d is too big!\n",
500 obuf[0] = msg[0].addr << 1;
501 obuf[1] = msg[0].len;
502 obuf[2] = msg[0].buf[0];
503 dw210x_op_rw(d->udev, 0xc2, 0, 0,
504 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
505 /* second read registers */
506 dw210x_op_rw(d->udev, 0xc3, 0x19 , 0,
507 ibuf, msg[1].len + 2, DW210X_READ_MSG);
508 memcpy(msg[1].buf, ibuf + 2, msg[1].len);
513 switch (msg[0].addr) {
516 /* write to register */
517 u8 obuf[MAX_XFER_SIZE];
519 if (2 + msg[0].len > sizeof(obuf)) {
520 warn("i2c wr: len=%d is too big!\n",
525 obuf[0] = msg[0].addr << 1;
526 obuf[1] = msg[0].len;
527 memcpy(obuf + 2, msg[0].buf, msg[0].len);
528 dw210x_op_rw(d->udev, 0xc2, 0, 0,
529 obuf, msg[0].len + 2, DW210X_WRITE_MSG);
532 case(DW2102_RC_QUERY): {
534 dw210x_op_rw(d->udev, 0xb8, 0, 0,
535 ibuf, 2, DW210X_READ_MSG);
536 memcpy(msg[0].buf, ibuf , 2);
544 for (i = 0; i < num; i++) {
545 deb_xfer("%02x:%02x: %s ", i, msg[i].addr,
546 msg[i].flags == 0 ? ">>>" : "<<<");
547 debug_dump(msg[i].buf, msg[i].len, deb_xfer);
552 mutex_unlock(&d->i2c_mutex);
556 static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
559 struct dvb_usb_device *d = i2c_get_adapdata(adap);
560 struct usb_device *udev;
566 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
569 for (j = 0; j < num; j++) {
570 switch (msg[j].addr) {
571 case (DW2102_RC_QUERY): {
573 dw210x_op_rw(d->udev, 0xb8, 0, 0,
574 ibuf, 5, DW210X_READ_MSG);
575 memcpy(msg[j].buf, ibuf + 3, 2);
578 case (DW2102_VOLTAGE_CTRL): {
582 obuf[1] = msg[j].buf[1];/* off-on */
583 dw210x_op_rw(d->udev, 0x8a, 0, 0,
584 obuf, 2, DW210X_WRITE_MSG);
586 obuf[1] = msg[j].buf[0];/* 13v-18v */
587 dw210x_op_rw(d->udev, 0x8a, 0, 0,
588 obuf, 2, DW210X_WRITE_MSG);
591 case (DW2102_LED_CTRL): {
595 obuf[1] = msg[j].buf[0];
596 dw210x_op_rw(d->udev, 0x8a, 0, 0,
597 obuf, 2, DW210X_WRITE_MSG);
602 case 0x68: ds3000, stv0903, rs2000
603 case 0x60: ts2020, stv6110, stb6100
606 if (msg[j].flags == I2C_M_RD) {
608 u8 ibuf[MAX_XFER_SIZE];
610 if (msg[j].len > sizeof(ibuf)) {
611 warn("i2c rd: len=%d is too big!\n",
617 dw210x_op_rw(d->udev, 0x91, 0, 0,
620 memcpy(msg[j].buf, ibuf, msg[j].len);
622 } else if ((msg[j].buf[0] == 0xb0) &&
623 (msg[j].addr == 0x68)) {
626 obuf[0] = (msg[j].len > 16 ?
627 18 : msg[j].len + 1);
628 obuf[1] = msg[j].addr << 1;
629 obuf[2] = msg[j].buf[0];
630 len = msg[j].len - 1;
633 memcpy(obuf + 3, msg[j].buf + i,
634 (len > 16 ? 16 : len));
635 dw210x_op_rw(d->udev, 0x80, 0, 0,
636 obuf, (len > 16 ? 16 : len) + 3,
641 } else if (j < (num - 1)) {
642 /* write register addr before read */
643 u8 obuf[MAX_XFER_SIZE];
645 if (2 + msg[j].len > sizeof(obuf)) {
646 warn("i2c wr: len=%d is too big!\n",
652 obuf[0] = msg[j + 1].len;
653 obuf[1] = (msg[j].addr << 1);
654 memcpy(obuf + 2, msg[j].buf, msg[j].len);
655 dw210x_op_rw(d->udev,
656 le16_to_cpu(udev->descriptor.idProduct) ==
657 0x7500 ? 0x92 : 0x90, 0, 0,
658 obuf, msg[j].len + 2,
662 /* write registers */
663 u8 obuf[MAX_XFER_SIZE];
665 if (2 + msg[j].len > sizeof(obuf)) {
666 warn("i2c wr: len=%d is too big!\n",
671 obuf[0] = msg[j].len + 1;
672 obuf[1] = (msg[j].addr << 1);
673 memcpy(obuf + 2, msg[j].buf, msg[j].len);
674 dw210x_op_rw(d->udev, 0x80, 0, 0,
675 obuf, msg[j].len + 2,
686 mutex_unlock(&d->i2c_mutex);
690 static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
693 struct dvb_usb_device *d = i2c_get_adapdata(adap);
694 struct dw2102_state *state;
701 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
703 if (mutex_lock_interruptible(&d->data_mutex) < 0) {
704 mutex_unlock(&d->i2c_mutex);
710 switch (msg[0].addr) {
711 case SU3000_STREAM_CTRL:
712 state->data[0] = msg[0].buf[0] + 0x36;
715 if (dvb_usb_generic_rw(d, state->data, 3,
716 state->data, 0, 0) < 0)
717 err("i2c transfer failed.");
719 case DW2102_RC_QUERY:
720 state->data[0] = 0x10;
721 if (dvb_usb_generic_rw(d, state->data, 1,
722 state->data, 2, 0) < 0)
723 err("i2c transfer failed.");
724 msg[0].buf[1] = state->data[0];
725 msg[0].buf[0] = state->data[1];
728 if (3 + msg[0].len > sizeof(state->data)) {
729 warn("i2c wr: len=%d is too big!\n",
735 /* always i2c write*/
736 state->data[0] = 0x08;
737 state->data[1] = msg[0].addr;
738 state->data[2] = msg[0].len;
740 memcpy(&state->data[3], msg[0].buf, msg[0].len);
742 if (dvb_usb_generic_rw(d, state->data, msg[0].len + 3,
743 state->data, 1, 0) < 0)
744 err("i2c transfer failed.");
749 /* always i2c read */
750 if (4 + msg[0].len > sizeof(state->data)) {
751 warn("i2c rd: len=%d is too big!\n",
756 if (1 + msg[1].len > sizeof(state->data)) {
757 warn("i2c rd: len=%d is too big!\n",
763 state->data[0] = 0x09;
764 state->data[1] = msg[0].len;
765 state->data[2] = msg[1].len;
766 state->data[3] = msg[0].addr;
767 memcpy(&state->data[4], msg[0].buf, msg[0].len);
769 if (dvb_usb_generic_rw(d, state->data, msg[0].len + 4,
770 state->data, msg[1].len + 1, 0) < 0)
771 err("i2c transfer failed.");
773 memcpy(msg[1].buf, &state->data[1], msg[1].len);
776 warn("more than 2 i2c messages at a time is not handled yet.");
779 mutex_unlock(&d->data_mutex);
780 mutex_unlock(&d->i2c_mutex);
784 static u32 dw210x_i2c_func(struct i2c_adapter *adapter)
789 static struct i2c_algorithm dw2102_i2c_algo = {
790 .master_xfer = dw2102_i2c_transfer,
791 .functionality = dw210x_i2c_func,
794 static struct i2c_algorithm dw2102_serit_i2c_algo = {
795 .master_xfer = dw2102_serit_i2c_transfer,
796 .functionality = dw210x_i2c_func,
799 static struct i2c_algorithm dw2102_earda_i2c_algo = {
800 .master_xfer = dw2102_earda_i2c_transfer,
801 .functionality = dw210x_i2c_func,
804 static struct i2c_algorithm dw2104_i2c_algo = {
805 .master_xfer = dw2104_i2c_transfer,
806 .functionality = dw210x_i2c_func,
809 static struct i2c_algorithm dw3101_i2c_algo = {
810 .master_xfer = dw3101_i2c_transfer,
811 .functionality = dw210x_i2c_func,
814 static struct i2c_algorithm s6x0_i2c_algo = {
815 .master_xfer = s6x0_i2c_transfer,
816 .functionality = dw210x_i2c_func,
819 static struct i2c_algorithm su3000_i2c_algo = {
820 .master_xfer = su3000_i2c_transfer,
821 .functionality = dw210x_i2c_func,
824 static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
828 u8 eeprom[256], eepromline[16];
830 for (i = 0; i < 256; i++) {
831 if (dw210x_op_rw(d->udev, 0xb6, 0xa0 , i, ibuf, 2, DW210X_READ_MSG) < 0) {
832 err("read eeprom failed.");
835 eepromline[i%16] = ibuf[0];
838 if ((i % 16) == 15) {
839 deb_xfer("%02x: ", i - 15);
840 debug_dump(eepromline, 16, deb_xfer);
844 memcpy(mac, eeprom + 8, 6);
848 static int s6x0_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
851 u8 ibuf[] = { 0 }, obuf[] = { 0 };
852 u8 eeprom[256], eepromline[16];
853 struct i2c_msg msg[] = {
867 for (i = 0; i < 256; i++) {
869 ret = s6x0_i2c_transfer(&d->i2c_adap, msg, 2);
871 err("read eeprom failed.");
874 eepromline[i % 16] = ibuf[0];
878 if ((i % 16) == 15) {
879 deb_xfer("%02x: ", i - 15);
880 debug_dump(eepromline, 16, deb_xfer);
884 memcpy(mac, eeprom + 16, 6);
888 static int su3000_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
890 static u8 command_start[] = {0x00};
891 static u8 command_stop[] = {0x01};
892 struct i2c_msg msg = {
893 .addr = SU3000_STREAM_CTRL,
895 .buf = onoff ? command_start : command_stop,
899 i2c_transfer(&adap->dev->i2c_adap, &msg, 1);
904 static int su3000_power_ctrl(struct dvb_usb_device *d, int i)
906 struct dw2102_state *state = d->priv;
909 info("%s: %d, initialized %d", __func__, i, state->initialized);
911 if (i && !state->initialized) {
912 mutex_lock(&d->data_mutex);
914 state->data[0] = 0xde;
917 state->initialized = 1;
919 ret = dvb_usb_generic_rw(d, state->data, 2, NULL, 0, 0);
920 mutex_unlock(&d->data_mutex);
926 static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
929 u8 obuf[] = { 0x1f, 0xf0 };
931 struct i2c_msg msg[] = {
946 for (i = 0; i < 6; i++) {
948 if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)
957 static int su3000_identify_state(struct usb_device *udev,
958 const struct dvb_usb_device_properties *props,
959 const struct dvb_usb_device_description **desc,
962 info("%s", __func__);
968 static int dw210x_set_voltage(struct dvb_frontend *fe,
969 enum fe_sec_voltage voltage)
971 static u8 command_13v[] = {0x00, 0x01};
972 static u8 command_18v[] = {0x01, 0x01};
973 static u8 command_off[] = {0x00, 0x00};
974 struct i2c_msg msg = {
975 .addr = DW2102_VOLTAGE_CTRL,
981 struct dvb_usb_adapter *udev_adap = fe->dvb->priv;
982 if (voltage == SEC_VOLTAGE_18)
983 msg.buf = command_18v;
984 else if (voltage == SEC_VOLTAGE_13)
985 msg.buf = command_13v;
987 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
992 static int s660_set_voltage(struct dvb_frontend *fe,
993 enum fe_sec_voltage voltage)
995 struct dvb_usb_adapter *d = fe->dvb->priv;
996 struct dw2102_state *st = d->dev->priv;
998 dw210x_set_voltage(fe, voltage);
999 if (st->old_set_voltage)
1000 st->old_set_voltage(fe, voltage);
1005 static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon)
1007 static u8 led_off[] = { 0 };
1008 static u8 led_on[] = { 1 };
1009 struct i2c_msg msg = {
1010 .addr = DW2102_LED_CTRL,
1015 struct dvb_usb_adapter *udev_adap = fe->dvb->priv;
1019 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
1022 static int tt_s2_4600_read_status(struct dvb_frontend *fe,
1023 enum fe_status *status)
1025 struct dvb_usb_adapter *d = fe->dvb->priv;
1026 struct dw2102_state *st = d->dev->priv;
1029 ret = st->fe_read_status(fe, status);
1031 /* resync slave fifo when signal change from unlock to lock */
1032 if ((*status & FE_HAS_LOCK) && (!st->last_lock))
1033 su3000_streaming_ctrl(d, 1);
1035 st->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0;
1039 static struct stv0299_config sharp_z0194a_config = {
1040 .demod_address = 0x68,
1041 .inittab = sharp_z0194a_inittab,
1045 .lock_output = STV0299_LOCKOUTPUT_1,
1046 .volt13_op0_op1 = STV0299_VOLT13_OP1,
1047 .min_delay_ms = 100,
1048 .set_symbol_rate = sharp_z0194a_set_symbol_rate,
1051 static struct cx24116_config dw2104_config = {
1052 .demod_address = 0x55,
1053 .mpg_clk_pos_pol = 0x01,
1056 static struct si21xx_config serit_sp1511lhb_config = {
1057 .demod_address = 0x68,
1058 .min_delay_ms = 100,
1062 static struct tda10023_config dw3101_tda10023_config = {
1063 .demod_address = 0x0c,
1067 static struct mt312_config zl313_config = {
1068 .demod_address = 0x0e,
1071 static struct ds3000_config dw2104_ds3000_config = {
1072 .demod_address = 0x68,
1075 static struct ts2020_config dw2104_ts2020_config = {
1076 .tuner_address = 0x60,
1078 .frequency_div = 1060000,
1081 static struct ds3000_config s660_ds3000_config = {
1082 .demod_address = 0x68,
1084 .set_lock_led = dw210x_led_ctrl,
1087 static struct ts2020_config s660_ts2020_config = {
1088 .tuner_address = 0x60,
1090 .frequency_div = 1146000,
1093 static struct stv0900_config dw2104a_stv0900_config = {
1094 .demod_address = 0x6a,
1097 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
1098 .diseqc_mode = 2,/* 2/3 PWM */
1099 .tun1_maddress = 0,/* 0x60 */
1100 .tun1_adc = 0,/* 2 Vpp */
1104 static struct stb6100_config dw2104a_stb6100_config = {
1105 .tuner_address = 0x60,
1106 .refclock = 27000000,
1109 static struct stv0900_config dw2104_stv0900_config = {
1110 .demod_address = 0x68,
1116 .tun1_adc = 1,/* 1 Vpp */
1120 static struct stv6110_config dw2104_stv6110_config = {
1121 .i2c_address = 0x60,
1126 static struct stv0900_config prof_7500_stv0900_config = {
1127 .demod_address = 0x6a,
1130 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
1131 .diseqc_mode = 2,/* 2/3 PWM */
1132 .tun1_maddress = 0,/* 0x60 */
1133 .tun1_adc = 0,/* 2 Vpp */
1136 .set_lock_led = dw210x_led_ctrl,
1139 static struct ds3000_config su3000_ds3000_config = {
1140 .demod_address = 0x68,
1142 .set_lock_led = dw210x_led_ctrl,
1145 static struct cxd2820r_config cxd2820r_config = {
1146 .i2c_address = 0x6c, /* (0xd8 >> 1) */
1151 static struct tda18271_config tda18271_config = {
1152 .output_opt = TDA18271_OUTPUT_LT_OFF,
1153 .gate = TDA18271_GATE_DIGITAL,
1156 static u8 m88rs2000_inittab[] = {
1157 DEMOD_WRITE, 0x9a, 0x30,
1158 DEMOD_WRITE, 0x00, 0x01,
1159 WRITE_DELAY, 0x19, 0x00,
1160 DEMOD_WRITE, 0x00, 0x00,
1161 DEMOD_WRITE, 0x9a, 0xb0,
1162 DEMOD_WRITE, 0x81, 0xc1,
1163 DEMOD_WRITE, 0x81, 0x81,
1164 DEMOD_WRITE, 0x86, 0xc6,
1165 DEMOD_WRITE, 0x9a, 0x30,
1166 DEMOD_WRITE, 0xf0, 0x80,
1167 DEMOD_WRITE, 0xf1, 0xbf,
1168 DEMOD_WRITE, 0xb0, 0x45,
1169 DEMOD_WRITE, 0xb2, 0x01,
1170 DEMOD_WRITE, 0x9a, 0xb0,
1174 static struct m88rs2000_config s421_m88rs2000_config = {
1176 .inittab = m88rs2000_inittab,
1179 static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
1181 struct dvb_tuner_ops *tuner_ops = NULL;
1183 if (demod_probe & 4) {
1184 d->fe_adap[0].fe = dvb_attach(stv0900_attach, &dw2104a_stv0900_config,
1185 &d->dev->i2c_adap, 0);
1186 if (d->fe_adap[0].fe != NULL) {
1187 if (dvb_attach(stb6100_attach, d->fe_adap[0].fe,
1188 &dw2104a_stb6100_config,
1189 &d->dev->i2c_adap)) {
1190 tuner_ops = &d->fe_adap[0].fe->ops.tuner_ops;
1191 tuner_ops->set_frequency = stb6100_set_freq;
1192 tuner_ops->get_frequency = stb6100_get_freq;
1193 tuner_ops->set_bandwidth = stb6100_set_bandw;
1194 tuner_ops->get_bandwidth = stb6100_get_bandw;
1195 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1196 info("Attached STV0900+STB6100!");
1202 if (demod_probe & 2) {
1203 d->fe_adap[0].fe = dvb_attach(stv0900_attach, &dw2104_stv0900_config,
1204 &d->dev->i2c_adap, 0);
1205 if (d->fe_adap[0].fe != NULL) {
1206 if (dvb_attach(stv6110_attach, d->fe_adap[0].fe,
1207 &dw2104_stv6110_config,
1208 &d->dev->i2c_adap)) {
1209 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1210 info("Attached STV0900+STV6110A!");
1216 if (demod_probe & 1) {
1217 d->fe_adap[0].fe = dvb_attach(cx24116_attach, &dw2104_config,
1219 if (d->fe_adap[0].fe != NULL) {
1220 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1221 info("Attached cx24116!");
1226 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
1228 if (d->fe_adap[0].fe != NULL) {
1229 dvb_attach(ts2020_attach, d->fe_adap[0].fe,
1230 &dw2104_ts2020_config, &d->dev->i2c_adap);
1231 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1232 info("Attached DS3000!");
1239 static struct dvb_usb_device_properties dw2102_properties;
1240 static struct dvb_usb_device_properties dw2104_properties;
1241 static struct dvb_usb_device_properties s6x0_properties;
1243 static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
1245 if (dw2102_properties.i2c_algo == &dw2102_serit_i2c_algo) {
1246 /*dw2102_properties.adapter->tuner_attach = NULL;*/
1247 d->fe_adap[0].fe = dvb_attach(si21xx_attach, &serit_sp1511lhb_config,
1249 if (d->fe_adap[0].fe != NULL) {
1250 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1251 info("Attached si21xx!");
1256 if (dw2102_properties.i2c_algo == &dw2102_earda_i2c_algo) {
1257 d->fe_adap[0].fe = dvb_attach(stv0288_attach, &earda_config,
1259 if (d->fe_adap[0].fe != NULL) {
1260 if (dvb_attach(stb6000_attach, d->fe_adap[0].fe, 0x61,
1261 &d->dev->i2c_adap)) {
1262 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1263 info("Attached stv0288!");
1269 if (dw2102_properties.i2c_algo == &dw2102_i2c_algo) {
1270 /*dw2102_properties.adapter->tuner_attach = dw2102_tuner_attach;*/
1271 d->fe_adap[0].fe = dvb_attach(stv0299_attach, &sharp_z0194a_config,
1273 if (d->fe_adap[0].fe != NULL) {
1274 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1275 info("Attached stv0299!");
1282 static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
1284 d->fe_adap[0].fe = dvb_attach(tda10023_attach, &dw3101_tda10023_config,
1285 &d->dev->i2c_adap, 0x48);
1286 if (d->fe_adap[0].fe != NULL) {
1287 info("Attached tda10023!");
1293 static int zl100313_frontend_attach(struct dvb_usb_adapter *d)
1295 d->fe_adap[0].fe = dvb_attach(mt312_attach, &zl313_config,
1297 if (d->fe_adap[0].fe != NULL) {
1298 if (dvb_attach(zl10039_attach, d->fe_adap[0].fe, 0x60,
1299 &d->dev->i2c_adap)) {
1300 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1301 info("Attached zl100313+zl10039!");
1309 static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
1313 d->fe_adap[0].fe = dvb_attach(stv0288_attach, &earda_config,
1316 if (d->fe_adap[0].fe == NULL)
1319 if (NULL == dvb_attach(stb6000_attach, d->fe_adap[0].fe, 0x61, &d->dev->i2c_adap))
1322 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1324 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1326 info("Attached stv0288+stb6000!");
1332 static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
1334 struct dw2102_state *st = d->dev->priv;
1337 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &s660_ds3000_config,
1340 if (d->fe_adap[0].fe == NULL)
1343 dvb_attach(ts2020_attach, d->fe_adap[0].fe, &s660_ts2020_config,
1346 st->old_set_voltage = d->fe_adap[0].fe->ops.set_voltage;
1347 d->fe_adap[0].fe->ops.set_voltage = s660_set_voltage;
1349 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1351 info("Attached ds3000+ts2020!");
1356 static int prof_7500_frontend_attach(struct dvb_usb_adapter *d)
1360 d->fe_adap[0].fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
1361 &d->dev->i2c_adap, 0);
1362 if (d->fe_adap[0].fe == NULL)
1365 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage;
1367 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1369 info("Attached STV0900+STB6100A!");
1374 static int su3000_frontend_attach(struct dvb_usb_adapter *adap)
1376 struct dvb_usb_device *d = adap->dev;
1377 struct dw2102_state *state = d->priv;
1379 mutex_lock(&d->data_mutex);
1381 state->data[0] = 0xe;
1382 state->data[1] = 0x80;
1385 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1386 err("command 0x0e transfer failed.");
1388 state->data[0] = 0xe;
1389 state->data[1] = 0x02;
1392 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1393 err("command 0x0e transfer failed.");
1396 state->data[0] = 0xe;
1397 state->data[1] = 0x83;
1400 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1401 err("command 0x0e transfer failed.");
1403 state->data[0] = 0xe;
1404 state->data[1] = 0x83;
1407 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1408 err("command 0x0e transfer failed.");
1410 state->data[0] = 0x51;
1412 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0)
1413 err("command 0x51 transfer failed.");
1415 mutex_unlock(&d->data_mutex);
1417 adap->fe_adap[0].fe = dvb_attach(ds3000_attach, &su3000_ds3000_config,
1419 if (adap->fe_adap[0].fe == NULL)
1422 if (dvb_attach(ts2020_attach, adap->fe_adap[0].fe,
1423 &dw2104_ts2020_config,
1425 info("Attached DS3000/TS2020!");
1429 info("Failed to attach DS3000/TS2020!");
1433 static int t220_frontend_attach(struct dvb_usb_adapter *adap)
1435 struct dvb_usb_device *d = adap->dev;
1436 struct dw2102_state *state = d->priv;
1438 mutex_lock(&d->data_mutex);
1440 state->data[0] = 0xe;
1441 state->data[1] = 0x87;
1442 state->data[2] = 0x0;
1444 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1445 err("command 0x0e transfer failed.");
1447 state->data[0] = 0xe;
1448 state->data[1] = 0x86;
1451 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1452 err("command 0x0e transfer failed.");
1454 state->data[0] = 0xe;
1455 state->data[1] = 0x80;
1458 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1459 err("command 0x0e transfer failed.");
1463 state->data[0] = 0xe;
1464 state->data[1] = 0x80;
1467 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1468 err("command 0x0e transfer failed.");
1470 state->data[0] = 0x51;
1472 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0)
1473 err("command 0x51 transfer failed.");
1475 mutex_unlock(&d->data_mutex);
1477 adap->fe_adap[0].fe = dvb_attach(cxd2820r_attach, &cxd2820r_config,
1478 &d->i2c_adap, NULL);
1479 if (adap->fe_adap[0].fe != NULL) {
1480 if (dvb_attach(tda18271_attach, adap->fe_adap[0].fe, 0x60,
1481 &d->i2c_adap, &tda18271_config)) {
1482 info("Attached TDA18271HD/CXD2820R!");
1487 info("Failed to attach TDA18271HD/CXD2820R!");
1491 static int m88rs2000_frontend_attach(struct dvb_usb_adapter *adap)
1493 struct dvb_usb_device *d = adap->dev;
1494 struct dw2102_state *state = d->priv;
1496 mutex_lock(&d->data_mutex);
1498 state->data[0] = 0x51;
1500 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0)
1501 err("command 0x51 transfer failed.");
1503 mutex_unlock(&d->data_mutex);
1505 adap->fe_adap[0].fe = dvb_attach(m88rs2000_attach,
1506 &s421_m88rs2000_config,
1509 if (adap->fe_adap[0].fe == NULL)
1512 if (dvb_attach(ts2020_attach, adap->fe_adap[0].fe,
1513 &dw2104_ts2020_config,
1515 info("Attached RS2000/TS2020!");
1519 info("Failed to attach RS2000/TS2020!");
1523 static int tt_s2_4600_frontend_attach_probe_demod(struct dvb_usb_device *d,
1524 const int probe_addr)
1526 struct dw2102_state *state = d->priv;
1528 state->data[0] = 0x9;
1529 state->data[1] = 0x1;
1530 state->data[2] = 0x1;
1531 state->data[3] = probe_addr;
1532 state->data[4] = 0x0;
1534 if (dvb_usb_generic_rw(d, state->data, 5, state->data, 2, 0) < 0) {
1535 err("i2c probe for address 0x%x failed.", probe_addr);
1539 if (state->data[0] != 8) /* fail(7) or error, no device at address */
1542 /* probing successful */
1546 static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
1548 struct dvb_usb_device *d = adap->dev;
1549 struct dw2102_state *state = d->priv;
1550 struct i2c_adapter *i2c_adapter;
1551 struct i2c_client *client;
1552 struct i2c_board_info board_info;
1553 struct m88ds3103_platform_data m88ds3103_pdata = {};
1554 struct ts2020_config ts2020_config = {};
1557 mutex_lock(&d->data_mutex);
1559 state->data[0] = 0xe;
1560 state->data[1] = 0x80;
1561 state->data[2] = 0x0;
1563 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1564 err("command 0x0e transfer failed.");
1566 state->data[0] = 0xe;
1567 state->data[1] = 0x02;
1570 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1571 err("command 0x0e transfer failed.");
1574 state->data[0] = 0xe;
1575 state->data[1] = 0x83;
1578 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1579 err("command 0x0e transfer failed.");
1581 state->data[0] = 0xe;
1582 state->data[1] = 0x83;
1585 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0)
1586 err("command 0x0e transfer failed.");
1588 state->data[0] = 0x51;
1590 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0)
1591 err("command 0x51 transfer failed.");
1593 /* probe for demodulator i2c address */
1595 if (tt_s2_4600_frontend_attach_probe_demod(d, 0x68))
1597 else if (tt_s2_4600_frontend_attach_probe_demod(d, 0x69))
1599 else if (tt_s2_4600_frontend_attach_probe_demod(d, 0x6a))
1602 mutex_unlock(&d->data_mutex);
1604 if (demod_addr < 0) {
1605 err("probing for demodulator failed. Is the external power switched on?");
1610 m88ds3103_pdata.clk = 27000000;
1611 m88ds3103_pdata.i2c_wr_max = 33;
1612 m88ds3103_pdata.ts_mode = M88DS3103_TS_CI;
1613 m88ds3103_pdata.ts_clk = 16000;
1614 m88ds3103_pdata.ts_clk_pol = 0;
1615 m88ds3103_pdata.spec_inv = 0;
1616 m88ds3103_pdata.agc = 0x99;
1617 m88ds3103_pdata.agc_inv = 0;
1618 m88ds3103_pdata.clk_out = M88DS3103_CLOCK_OUT_ENABLED;
1619 m88ds3103_pdata.envelope_mode = 0;
1620 m88ds3103_pdata.lnb_hv_pol = 1;
1621 m88ds3103_pdata.lnb_en_pol = 0;
1622 memset(&board_info, 0, sizeof(board_info));
1623 if (demod_addr == 0x6a)
1624 strscpy(board_info.type, "m88ds3103b", I2C_NAME_SIZE);
1626 strscpy(board_info.type, "m88ds3103", I2C_NAME_SIZE);
1627 board_info.addr = demod_addr;
1628 board_info.platform_data = &m88ds3103_pdata;
1629 request_module("m88ds3103");
1630 client = i2c_new_client_device(&d->i2c_adap, &board_info);
1631 if (!i2c_client_has_driver(client))
1633 if (!try_module_get(client->dev.driver->owner)) {
1634 i2c_unregister_device(client);
1637 adap->fe_adap[0].fe = m88ds3103_pdata.get_dvb_frontend(client);
1638 i2c_adapter = m88ds3103_pdata.get_i2c_adapter(client);
1640 state->i2c_client_demod = client;
1643 ts2020_config.fe = adap->fe_adap[0].fe;
1644 memset(&board_info, 0, sizeof(board_info));
1645 strscpy(board_info.type, "ts2022", I2C_NAME_SIZE);
1646 board_info.addr = 0x60;
1647 board_info.platform_data = &ts2020_config;
1648 request_module("ts2020");
1649 client = i2c_new_client_device(i2c_adapter, &board_info);
1651 if (!i2c_client_has_driver(client)) {
1652 dvb_frontend_detach(adap->fe_adap[0].fe);
1656 if (!try_module_get(client->dev.driver->owner)) {
1657 i2c_unregister_device(client);
1658 dvb_frontend_detach(adap->fe_adap[0].fe);
1662 /* delegate signal strength measurement to tuner */
1663 adap->fe_adap[0].fe->ops.read_signal_strength =
1664 adap->fe_adap[0].fe->ops.tuner_ops.get_rf_strength;
1666 state->i2c_client_tuner = client;
1668 /* hook fe: need to resync the slave fifo when signal locks */
1669 state->fe_read_status = adap->fe_adap[0].fe->ops.read_status;
1670 adap->fe_adap[0].fe->ops.read_status = tt_s2_4600_read_status;
1672 state->last_lock = 0;
1677 static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
1679 dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60,
1680 &adap->dev->i2c_adap, DVB_PLL_OPERA1);
1684 static int dw3101_tuner_attach(struct dvb_usb_adapter *adap)
1686 dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60,
1687 &adap->dev->i2c_adap, DVB_PLL_TUA6034);
1692 static int dw2102_rc_query(struct dvb_usb_device *d)
1695 struct i2c_msg msg = {
1696 .addr = DW2102_RC_QUERY,
1702 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) {
1703 if (msg.buf[0] != 0xff) {
1704 deb_rc("%s: rc code: %x, %x\n",
1705 __func__, key[0], key[1]);
1706 rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, key[0], 0);
1713 static int prof_rc_query(struct dvb_usb_device *d)
1716 struct i2c_msg msg = {
1717 .addr = DW2102_RC_QUERY,
1723 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) {
1724 if (msg.buf[0] != 0xff) {
1725 deb_rc("%s: rc code: %x, %x\n",
1726 __func__, key[0], key[1]);
1727 rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, key[0] ^ 0xff,
1735 static int su3000_rc_query(struct dvb_usb_device *d)
1738 struct i2c_msg msg = {
1739 .addr = DW2102_RC_QUERY,
1745 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) {
1746 if (msg.buf[0] != 0xff) {
1747 deb_rc("%s: rc code: %x, %x\n",
1748 __func__, key[0], key[1]);
1749 rc_keydown(d->rc_dev, RC_PROTO_RC5,
1750 RC_SCANCODE_RC5(key[1], key[0]), 0);
1757 enum dw2102_table_entry {
1770 TERRATEC_CINERGY_S2_R1,
1773 GENIATECH_X3M_SPC1400HD,
1776 TERRATEC_CINERGY_S2_R2,
1777 TERRATEC_CINERGY_S2_R3,
1778 TERRATEC_CINERGY_S2_R4,
1779 TERRATEC_CINERGY_S2_1,
1780 TERRATEC_CINERGY_S2_2,
1783 TECHNOTREND_CONNECT_S2_4600,
1786 TERRATEC_CINERGY_S2_BOX,
1790 static struct usb_device_id dw2102_table[] = {
1791 DVB_USB_DEV(CYPRESS, CYPRESS_DW2102),
1792 DVB_USB_DEV(CYPRESS, CYPRESS_DW2101),
1793 DVB_USB_DEV(CYPRESS, CYPRESS_DW2104),
1794 DVB_USB_DEV(TEVII, TEVII_S650),
1795 DVB_USB_DEV(TERRATEC, TERRATEC_CINERGY_S),
1796 DVB_USB_DEV(CYPRESS, CYPRESS_DW3101),
1797 DVB_USB_DEV(TEVII, TEVII_S630),
1798 DVB_USB_DEV(PROF_1, PROF_1100),
1799 DVB_USB_DEV(TEVII, TEVII_S660),
1800 DVB_USB_DEV(PROF_2, PROF_7500),
1801 DVB_USB_DEV(GTEK, GENIATECH_SU3000),
1802 DVB_USB_DEV(HAUPPAUGE, HAUPPAUGE_MAX_S2),
1803 DVB_USB_DEV(TERRATEC, TERRATEC_CINERGY_S2_R1),
1804 DVB_USB_DEV(TEVII, TEVII_S480_1),
1805 DVB_USB_DEV(TEVII, TEVII_S480_2),
1806 DVB_USB_DEV(GTEK, GENIATECH_X3M_SPC1400HD),
1807 DVB_USB_DEV(TEVII, TEVII_S421),
1808 DVB_USB_DEV(TEVII, TEVII_S632),
1809 DVB_USB_DEV(TERRATEC, TERRATEC_CINERGY_S2_R2),
1810 DVB_USB_DEV(TERRATEC, TERRATEC_CINERGY_S2_R3),
1811 DVB_USB_DEV(TERRATEC, TERRATEC_CINERGY_S2_R4),
1812 DVB_USB_DEV(TERRATEC_2, TERRATEC_CINERGY_S2_1),
1813 DVB_USB_DEV(TERRATEC_2, TERRATEC_CINERGY_S2_2),
1814 DVB_USB_DEV(GOTVIEW, GOTVIEW_SAT_HD),
1815 DVB_USB_DEV(GTEK, GENIATECH_T220),
1816 DVB_USB_DEV(TECHNOTREND, TECHNOTREND_CONNECT_S2_4600),
1817 DVB_USB_DEV(TEVII, TEVII_S482_1),
1818 DVB_USB_DEV(TEVII, TEVII_S482_2),
1819 DVB_USB_DEV(TERRATEC, TERRATEC_CINERGY_S2_BOX),
1820 DVB_USB_DEV(TEVII, TEVII_S662),
1824 MODULE_DEVICE_TABLE(usb, dw2102_table);
1826 static int dw2102_load_firmware(struct usb_device *dev,
1827 const struct firmware *frmwr)
1832 u8 reset16[] = {0, 0, 0, 0, 0, 0, 0};
1833 const struct firmware *fw;
1835 switch (le16_to_cpu(dev->descriptor.idProduct)) {
1837 ret = request_firmware(&fw, DW2101_FIRMWARE, &dev->dev);
1839 err(err_str, DW2101_FIRMWARE);
1847 info("start downloading DW210X firmware");
1848 p = kmalloc(fw->size, GFP_KERNEL);
1851 dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1, DW210X_WRITE_MSG);
1852 dw210x_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1, DW210X_WRITE_MSG);
1855 memcpy(p, fw->data, fw->size);
1856 for (i = 0; i < fw->size; i += 0x40) {
1858 if (dw210x_op_rw(dev, 0xa0, i, 0, b , 0x40,
1859 DW210X_WRITE_MSG) != 0x40) {
1860 err("error while transferring firmware");
1865 /* restart the CPU */
1867 if (ret || dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1,
1868 DW210X_WRITE_MSG) != 1) {
1869 err("could not restart the USB controller CPU.");
1872 if (ret || dw210x_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1,
1873 DW210X_WRITE_MSG) != 1) {
1874 err("could not restart the USB controller CPU.");
1877 /* init registers */
1878 switch (le16_to_cpu(dev->descriptor.idProduct)) {
1879 case USB_PID_TEVII_S650:
1880 dw2104_properties.rc.core.rc_codes = RC_MAP_TEVII_NEC;
1882 case USB_PID_CYPRESS_DW2104:
1884 dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1,
1887 case USB_PID_CYPRESS_DW3101:
1889 dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
1892 case USB_PID_TERRATEC_CINERGY_S:
1893 case USB_PID_CYPRESS_DW2102:
1894 dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
1896 dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
1898 /* check STV0299 frontend */
1899 dw210x_op_rw(dev, 0xb5, 0, 0, &reset16[0], 2,
1901 if ((reset16[0] == 0xa1) || (reset16[0] == 0x80)) {
1902 dw2102_properties.i2c_algo = &dw2102_i2c_algo;
1903 dw2102_properties.adapter->fe[0].tuner_attach = &dw2102_tuner_attach;
1906 /* check STV0288 frontend */
1910 dw210x_op_rw(dev, 0xc2, 0, 0, &reset16[0], 3,
1912 dw210x_op_rw(dev, 0xc3, 0xd1, 0, &reset16[0], 3,
1914 if (reset16[2] == 0x11) {
1915 dw2102_properties.i2c_algo = &dw2102_earda_i2c_algo;
1921 dw210x_op_rw(dev, 0xbc, 0x0030, 0, &reset16[0], 2,
1923 dw210x_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
1925 dw210x_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
1927 dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
1936 if (le16_to_cpu(dev->descriptor.idProduct) == 0x2101)
1937 release_firmware(fw);
1941 static struct dvb_usb_device_properties dw2102_properties = {
1942 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1943 .usb_ctrl = DEVICE_SPECIFIC,
1944 .firmware = DW2102_FIRMWARE,
1947 .i2c_algo = &dw2102_serit_i2c_algo,
1951 .rc_codes = RC_MAP_DM1105_NEC,
1952 .module_name = "dw2102",
1953 .allowed_protos = RC_PROTO_BIT_NEC,
1954 .rc_query = dw2102_rc_query,
1957 .generic_bulk_ctrl_endpoint = 0x81,
1958 /* parameter for the MPEG2-data transfer */
1960 .download_firmware = dw2102_load_firmware,
1961 .read_mac_address = dw210x_read_mac_address,
1966 .frontend_attach = dw2102_frontend_attach,
1980 .num_device_descs = 3,
1982 {"DVBWorld DVB-S 2102 USB2.0",
1983 {&dw2102_table[CYPRESS_DW2102], NULL},
1986 {"DVBWorld DVB-S 2101 USB2.0",
1987 {&dw2102_table[CYPRESS_DW2101], NULL},
1990 {"TerraTec Cinergy S USB",
1991 {&dw2102_table[TERRATEC_CINERGY_S], NULL},
1997 static struct dvb_usb_device_properties dw2104_properties = {
1998 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1999 .usb_ctrl = DEVICE_SPECIFIC,
2000 .firmware = DW2104_FIRMWARE,
2003 .i2c_algo = &dw2104_i2c_algo,
2006 .rc_codes = RC_MAP_DM1105_NEC,
2007 .module_name = "dw2102",
2008 .allowed_protos = RC_PROTO_BIT_NEC,
2009 .rc_query = dw2102_rc_query,
2012 .generic_bulk_ctrl_endpoint = 0x81,
2013 /* parameter for the MPEG2-data transfer */
2015 .download_firmware = dw2102_load_firmware,
2016 .read_mac_address = dw210x_read_mac_address,
2021 .frontend_attach = dw2104_frontend_attach,
2035 .num_device_descs = 2,
2037 { "DVBWorld DW2104 USB2.0",
2038 {&dw2102_table[CYPRESS_DW2104], NULL},
2041 { "TeVii S650 USB2.0",
2042 {&dw2102_table[TEVII_S650], NULL},
2048 static struct dvb_usb_device_properties dw3101_properties = {
2049 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2050 .usb_ctrl = DEVICE_SPECIFIC,
2051 .firmware = DW3101_FIRMWARE,
2054 .i2c_algo = &dw3101_i2c_algo,
2057 .rc_codes = RC_MAP_DM1105_NEC,
2058 .module_name = "dw2102",
2059 .allowed_protos = RC_PROTO_BIT_NEC,
2060 .rc_query = dw2102_rc_query,
2063 .generic_bulk_ctrl_endpoint = 0x81,
2064 /* parameter for the MPEG2-data transfer */
2066 .download_firmware = dw2102_load_firmware,
2067 .read_mac_address = dw210x_read_mac_address,
2072 .frontend_attach = dw3101_frontend_attach,
2073 .tuner_attach = dw3101_tuner_attach,
2087 .num_device_descs = 1,
2089 { "DVBWorld DVB-C 3101 USB2.0",
2090 {&dw2102_table[CYPRESS_DW3101], NULL},
2096 static struct dvb_usb_device_properties s6x0_properties = {
2097 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2098 .usb_ctrl = DEVICE_SPECIFIC,
2099 .size_of_priv = sizeof(struct dw2102_state),
2100 .firmware = S630_FIRMWARE,
2103 .i2c_algo = &s6x0_i2c_algo,
2106 .rc_codes = RC_MAP_TEVII_NEC,
2107 .module_name = "dw2102",
2108 .allowed_protos = RC_PROTO_BIT_NEC,
2109 .rc_query = dw2102_rc_query,
2112 .generic_bulk_ctrl_endpoint = 0x81,
2114 .download_firmware = dw2102_load_firmware,
2115 .read_mac_address = s6x0_read_mac_address,
2120 .frontend_attach = zl100313_frontend_attach,
2134 .num_device_descs = 1,
2137 {&dw2102_table[TEVII_S630], NULL},
2143 static struct dvb_usb_device_properties p1100_properties = {
2144 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2145 .usb_ctrl = DEVICE_SPECIFIC,
2146 .size_of_priv = sizeof(struct dw2102_state),
2147 .firmware = P1100_FIRMWARE,
2150 .i2c_algo = &s6x0_i2c_algo,
2153 .rc_codes = RC_MAP_TBS_NEC,
2154 .module_name = "dw2102",
2155 .allowed_protos = RC_PROTO_BIT_NEC,
2156 .rc_query = prof_rc_query,
2159 .generic_bulk_ctrl_endpoint = 0x81,
2161 .download_firmware = dw2102_load_firmware,
2162 .read_mac_address = s6x0_read_mac_address,
2167 .frontend_attach = stv0288_frontend_attach,
2181 .num_device_descs = 1,
2184 {&dw2102_table[PROF_1100], NULL},
2190 static struct dvb_usb_device_properties s660_properties = {
2191 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2192 .usb_ctrl = DEVICE_SPECIFIC,
2193 .size_of_priv = sizeof(struct dw2102_state),
2194 .firmware = S660_FIRMWARE,
2197 .i2c_algo = &s6x0_i2c_algo,
2200 .rc_codes = RC_MAP_TEVII_NEC,
2201 .module_name = "dw2102",
2202 .allowed_protos = RC_PROTO_BIT_NEC,
2203 .rc_query = dw2102_rc_query,
2206 .generic_bulk_ctrl_endpoint = 0x81,
2208 .download_firmware = dw2102_load_firmware,
2209 .read_mac_address = s6x0_read_mac_address,
2214 .frontend_attach = ds3000_frontend_attach,
2228 .num_device_descs = 3,
2231 {&dw2102_table[TEVII_S660], NULL},
2234 {"TeVii S480.1 USB",
2235 {&dw2102_table[TEVII_S480_1], NULL},
2238 {"TeVii S480.2 USB",
2239 {&dw2102_table[TEVII_S480_2], NULL},
2245 static struct dvb_usb_device_properties p7500_properties = {
2246 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2247 .usb_ctrl = DEVICE_SPECIFIC,
2248 .size_of_priv = sizeof(struct dw2102_state),
2249 .firmware = P7500_FIRMWARE,
2252 .i2c_algo = &s6x0_i2c_algo,
2255 .rc_codes = RC_MAP_TBS_NEC,
2256 .module_name = "dw2102",
2257 .allowed_protos = RC_PROTO_BIT_NEC,
2258 .rc_query = prof_rc_query,
2261 .generic_bulk_ctrl_endpoint = 0x81,
2263 .download_firmware = dw2102_load_firmware,
2264 .read_mac_address = s6x0_read_mac_address,
2269 .frontend_attach = prof_7500_frontend_attach,
2283 .num_device_descs = 1,
2285 {"Prof 7500 USB DVB-S2",
2286 {&dw2102_table[PROF_7500], NULL},
2292 static struct dvb_usb_device_properties su3000_properties = {
2293 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2294 .usb_ctrl = DEVICE_SPECIFIC,
2295 .size_of_priv = sizeof(struct dw2102_state),
2296 .power_ctrl = su3000_power_ctrl,
2298 .identify_state = su3000_identify_state,
2299 .i2c_algo = &su3000_i2c_algo,
2303 .rc_codes = RC_MAP_SU3000,
2304 .module_name = "dw2102",
2305 .allowed_protos = RC_PROTO_BIT_RC5,
2306 .rc_query = su3000_rc_query,
2309 .read_mac_address = su3000_read_mac_address,
2311 .generic_bulk_ctrl_endpoint = 0x01,
2317 .streaming_ctrl = su3000_streaming_ctrl,
2318 .frontend_attach = su3000_frontend_attach,
2332 .num_device_descs = 9,
2334 { "SU3000HD DVB-S USB2.0",
2335 { &dw2102_table[GENIATECH_SU3000], NULL },
2338 { "Hauppauge MAX S2 or WinTV NOVA HD USB2.0",
2339 { &dw2102_table[HAUPPAUGE_MAX_S2], NULL },
2342 { "Terratec Cinergy S2 USB HD",
2343 { &dw2102_table[TERRATEC_CINERGY_S2_R1], NULL },
2346 { "X3M TV SPC1400HD PCI",
2347 { &dw2102_table[GENIATECH_X3M_SPC1400HD], NULL },
2350 { "Terratec Cinergy S2 USB HD Rev.2",
2351 { &dw2102_table[TERRATEC_CINERGY_S2_R2], NULL },
2354 { "Terratec Cinergy S2 USB HD Rev.3",
2355 { &dw2102_table[TERRATEC_CINERGY_S2_R3], NULL },
2358 { "Terratec Cinergy S2 PCIe Dual Port 1",
2359 { &dw2102_table[TERRATEC_CINERGY_S2_1], NULL },
2362 { "Terratec Cinergy S2 PCIe Dual Port 2",
2363 { &dw2102_table[TERRATEC_CINERGY_S2_2], NULL },
2366 { "GOTVIEW Satellite HD",
2367 { &dw2102_table[GOTVIEW_SAT_HD], NULL },
2373 static struct dvb_usb_device_properties s421_properties = {
2374 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2375 .usb_ctrl = DEVICE_SPECIFIC,
2376 .size_of_priv = sizeof(struct dw2102_state),
2377 .power_ctrl = su3000_power_ctrl,
2379 .identify_state = su3000_identify_state,
2380 .i2c_algo = &su3000_i2c_algo,
2384 .rc_codes = RC_MAP_SU3000,
2385 .module_name = "dw2102",
2386 .allowed_protos = RC_PROTO_BIT_RC5,
2387 .rc_query = su3000_rc_query,
2390 .read_mac_address = su3000_read_mac_address,
2392 .generic_bulk_ctrl_endpoint = 0x01,
2398 .streaming_ctrl = su3000_streaming_ctrl,
2399 .frontend_attach = m88rs2000_frontend_attach,
2413 .num_device_descs = 2,
2416 { &dw2102_table[TEVII_S421], NULL },
2420 { &dw2102_table[TEVII_S632], NULL },
2426 static struct dvb_usb_device_properties t220_properties = {
2427 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2428 .usb_ctrl = DEVICE_SPECIFIC,
2429 .size_of_priv = sizeof(struct dw2102_state),
2430 .power_ctrl = su3000_power_ctrl,
2432 .identify_state = su3000_identify_state,
2433 .i2c_algo = &su3000_i2c_algo,
2437 .rc_codes = RC_MAP_SU3000,
2438 .module_name = "dw2102",
2439 .allowed_protos = RC_PROTO_BIT_RC5,
2440 .rc_query = su3000_rc_query,
2443 .read_mac_address = su3000_read_mac_address,
2445 .generic_bulk_ctrl_endpoint = 0x01,
2451 .streaming_ctrl = su3000_streaming_ctrl,
2452 .frontend_attach = t220_frontend_attach,
2466 .num_device_descs = 1,
2468 { "Geniatech T220 DVB-T/T2 USB2.0",
2469 { &dw2102_table[GENIATECH_T220], NULL },
2475 static struct dvb_usb_device_properties tt_s2_4600_properties = {
2476 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2477 .usb_ctrl = DEVICE_SPECIFIC,
2478 .size_of_priv = sizeof(struct dw2102_state),
2479 .power_ctrl = su3000_power_ctrl,
2481 .identify_state = su3000_identify_state,
2482 .i2c_algo = &su3000_i2c_algo,
2486 .rc_codes = RC_MAP_TT_1500,
2487 .module_name = "dw2102",
2488 .allowed_protos = RC_PROTO_BIT_RC5,
2489 .rc_query = su3000_rc_query,
2492 .read_mac_address = su3000_read_mac_address,
2494 .generic_bulk_ctrl_endpoint = 0x01,
2500 .streaming_ctrl = su3000_streaming_ctrl,
2501 .frontend_attach = tt_s2_4600_frontend_attach,
2515 .num_device_descs = 5,
2517 { "TechnoTrend TT-connect S2-4600",
2518 { &dw2102_table[TECHNOTREND_CONNECT_S2_4600], NULL },
2521 { "TeVii S482 (tuner 1)",
2522 { &dw2102_table[TEVII_S482_1], NULL },
2525 { "TeVii S482 (tuner 2)",
2526 { &dw2102_table[TEVII_S482_2], NULL },
2529 { "Terratec Cinergy S2 USB BOX",
2530 { &dw2102_table[TERRATEC_CINERGY_S2_BOX], NULL },
2534 { &dw2102_table[TEVII_S662], NULL },
2540 static int dw2102_probe(struct usb_interface *intf,
2541 const struct usb_device_id *id)
2543 if (!(dvb_usb_device_init(intf, &dw2102_properties,
2544 THIS_MODULE, NULL, adapter_nr) &&
2545 dvb_usb_device_init(intf, &dw2104_properties,
2546 THIS_MODULE, NULL, adapter_nr) &&
2547 dvb_usb_device_init(intf, &dw3101_properties,
2548 THIS_MODULE, NULL, adapter_nr) &&
2549 dvb_usb_device_init(intf, &s6x0_properties,
2550 THIS_MODULE, NULL, adapter_nr) &&
2551 dvb_usb_device_init(intf, &p1100_properties,
2552 THIS_MODULE, NULL, adapter_nr) &&
2553 dvb_usb_device_init(intf, &s660_properties,
2554 THIS_MODULE, NULL, adapter_nr) &&
2555 dvb_usb_device_init(intf, &p7500_properties,
2556 THIS_MODULE, NULL, adapter_nr) &&
2557 dvb_usb_device_init(intf, &s421_properties,
2558 THIS_MODULE, NULL, adapter_nr) &&
2559 dvb_usb_device_init(intf, &su3000_properties,
2560 THIS_MODULE, NULL, adapter_nr) &&
2561 dvb_usb_device_init(intf, &t220_properties,
2562 THIS_MODULE, NULL, adapter_nr) &&
2563 dvb_usb_device_init(intf, &tt_s2_4600_properties,
2564 THIS_MODULE, NULL, adapter_nr))) {
2572 static void dw2102_disconnect(struct usb_interface *intf)
2574 struct dvb_usb_device *d = usb_get_intfdata(intf);
2575 struct dw2102_state *st = d->priv;
2576 struct i2c_client *client;
2578 /* remove I2C client for tuner */
2579 client = st->i2c_client_tuner;
2581 module_put(client->dev.driver->owner);
2582 i2c_unregister_device(client);
2585 /* remove I2C client for demodulator */
2586 client = st->i2c_client_demod;
2588 module_put(client->dev.driver->owner);
2589 i2c_unregister_device(client);
2592 dvb_usb_device_exit(intf);
2595 static struct usb_driver dw2102_driver = {
2597 .probe = dw2102_probe,
2598 .disconnect = dw2102_disconnect,
2599 .id_table = dw2102_table,
2602 module_usb_driver(dw2102_driver);
2604 MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
2605 MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101 USB2.0, TeVii S421, S480, S482, S600, S630, S632, S650, TeVii S660, S662, Prof 1100, 7500 USB2.0, Geniatech SU3000, T220, TechnoTrend S2-4600, Terratec Cinergy S2 devices");
2606 MODULE_VERSION("0.1");
2607 MODULE_LICENSE("GPL");
2608 MODULE_FIRMWARE(DW2101_FIRMWARE);
2609 MODULE_FIRMWARE(DW2102_FIRMWARE);
2610 MODULE_FIRMWARE(DW2104_FIRMWARE);
2611 MODULE_FIRMWARE(DW3101_FIRMWARE);
2612 MODULE_FIRMWARE(S630_FIRMWARE);
2613 MODULE_FIRMWARE(S660_FIRMWARE);
2614 MODULE_FIRMWARE(P1100_FIRMWARE);
2615 MODULE_FIRMWARE(P7500_FIRMWARE);