aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dw2102.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dw2102.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dw2102.c648
1 files changed, 534 insertions, 114 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
index 774df88dc6e3..058b2318abed 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.c
+++ b/drivers/media/dvb/dvb-usb/dw2102.c
@@ -1,15 +1,16 @@
1/* DVB USB framework compliant Linux driver for the 1/* DVB USB framework compliant Linux driver for the
2* DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101, 2 * DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
3* TeVii S600, S630, S650, 3 * TeVii S600, S630, S650, S660, S480,
4* Prof 1100, 7500 Cards 4 * Prof 1100, 7500,
5* Copyright (C) 2008,2009 Igor M. Liplianin (liplianin@me.by) 5 * Geniatech SU3000 Cards
6* 6 * Copyright (C) 2008-2011 Igor M. Liplianin (liplianin@me.by)
7* This program is free software; you can redistribute it and/or modify it 7 *
8* under the terms of the GNU General Public License as published by the 8 * This program is free software; you can redistribute it and/or modify it
9* Free Software Foundation, version 2. 9 * under the terms of the GNU General Public License as published by the
10* 10 * Free Software Foundation, version 2.
11* see Documentation/dvb/README.dvb-usb for more information 11 *
12*/ 12 * see Documentation/dvb/README.dvb-usb for more information
13 */
13#include "dw2102.h" 14#include "dw2102.h"
14#include "si21xx.h" 15#include "si21xx.h"
15#include "stv0299.h" 16#include "stv0299.h"
@@ -55,6 +56,14 @@
55#define USB_PID_TEVII_S660 0xd660 56#define USB_PID_TEVII_S660 0xd660
56#endif 57#endif
57 58
59#ifndef USB_PID_TEVII_S480_1
60#define USB_PID_TEVII_S480_1 0xd481
61#endif
62
63#ifndef USB_PID_TEVII_S480_2
64#define USB_PID_TEVII_S480_2 0xd482
65#endif
66
58#ifndef USB_PID_PROF_1100 67#ifndef USB_PID_PROF_1100
59#define USB_PID_PROF_1100 0xb012 68#define USB_PID_PROF_1100 0xb012
60#endif 69#endif
@@ -67,17 +76,27 @@
67#define REG_21_SYMBOLRATE_BYTE2 0x21 76#define REG_21_SYMBOLRATE_BYTE2 0x21
68/* on my own*/ 77/* on my own*/
69#define DW2102_VOLTAGE_CTRL (0x1800) 78#define DW2102_VOLTAGE_CTRL (0x1800)
79#define SU3000_STREAM_CTRL (0x1900)
70#define DW2102_RC_QUERY (0x1a00) 80#define DW2102_RC_QUERY (0x1a00)
81#define DW2102_LED_CTRL (0x1b00)
71 82
72#define err_str "did not find the firmware file. (%s) " \ 83#define err_str "did not find the firmware file. (%s) " \
73 "Please see linux/Documentation/dvb/ for more details " \ 84 "Please see linux/Documentation/dvb/ for more details " \
74 "on firmware-problems." 85 "on firmware-problems."
75 86
76struct ir_codes_dvb_usb_table_table { 87struct rc_map_dvb_usb_table_table {
77 struct ir_scancode *rc_keys; 88 struct rc_map_table *rc_keys;
78 int rc_keys_size; 89 int rc_keys_size;
79}; 90};
80 91
92struct su3000_state {
93 u8 initialized;
94};
95
96struct s6x0_state {
97 int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
98};
99
81/* debug */ 100/* debug */
82static int dvb_usb_dw2102_debug; 101static int dvb_usb_dw2102_debug;
83module_param_named(debug, dvb_usb_dw2102_debug, int, 0644); 102module_param_named(debug, dvb_usb_dw2102_debug, int, 0644);
@@ -87,7 +106,8 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))."
87/* keymaps */ 106/* keymaps */
88static int ir_keymap; 107static int ir_keymap;
89module_param_named(keymap, ir_keymap, int, 0644); 108module_param_named(keymap, ir_keymap, int, 0644);
90MODULE_PARM_DESC(keymap, "set keymap 0=default 1=dvbworld 2=tevii 3=tbs ..."); 109MODULE_PARM_DESC(keymap, "set keymap 0=default 1=dvbworld 2=tevii 3=tbs ..."
110 " 256=none");
91 111
92/* demod probe */ 112/* demod probe */
93static int demod_probe = 1; 113static int demod_probe = 1;
@@ -101,12 +121,16 @@ static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
101 u16 index, u8 * data, u16 len, int flags) 121 u16 index, u8 * data, u16 len, int flags)
102{ 122{
103 int ret; 123 int ret;
104 u8 u8buf[len]; 124 u8 *u8buf;
105
106 unsigned int pipe = (flags == DW210X_READ_MSG) ? 125 unsigned int pipe = (flags == DW210X_READ_MSG) ?
107 usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0); 126 usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
108 u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT; 127 u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;
109 128
129 u8buf = kmalloc(len, GFP_KERNEL);
130 if (!u8buf)
131 return -ENOMEM;
132
133
110 if (flags == DW210X_WRITE_MSG) 134 if (flags == DW210X_WRITE_MSG)
111 memcpy(u8buf, data, len); 135 memcpy(u8buf, data, len);
112 ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR, 136 ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR,
@@ -114,6 +138,8 @@ static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
114 138
115 if (flags == DW210X_READ_MSG) 139 if (flags == DW210X_READ_MSG)
116 memcpy(data, u8buf, len); 140 memcpy(data, u8buf, len);
141
142 kfree(u8buf);
117 return ret; 143 return ret;
118} 144}
119 145
@@ -136,8 +162,7 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
136 /* read stv0299 register */ 162 /* read stv0299 register */
137 value = msg[0].buf[0];/* register */ 163 value = msg[0].buf[0];/* register */
138 for (i = 0; i < msg[1].len; i++) { 164 for (i = 0; i < msg[1].len; i++) {
139 value = value + i; 165 ret = dw210x_op_rw(d->udev, 0xb5, value + i, 0,
140 ret = dw210x_op_rw(d->udev, 0xb5, value, 0,
141 buf6, 2, DW210X_READ_MSG); 166 buf6, 2, DW210X_READ_MSG);
142 msg[1].buf[i] = buf6[0]; 167 msg[1].buf[i] = buf6[0];
143 } 168 }
@@ -483,10 +508,10 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
483 for (j = 0; j < num; j++) { 508 for (j = 0; j < num; j++) {
484 switch (msg[j].addr) { 509 switch (msg[j].addr) {
485 case (DW2102_RC_QUERY): { 510 case (DW2102_RC_QUERY): {
486 u8 ibuf[4]; 511 u8 ibuf[5];
487 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, 512 ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
488 ibuf, 4, DW210X_READ_MSG); 513 ibuf, 5, DW210X_READ_MSG);
489 memcpy(msg[j].buf, ibuf + 1, 2); 514 memcpy(msg[j].buf, ibuf + 3, 2);
490 break; 515 break;
491 } 516 }
492 case (DW2102_VOLTAGE_CTRL): { 517 case (DW2102_VOLTAGE_CTRL): {
@@ -502,6 +527,15 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
502 obuf, 2, DW210X_WRITE_MSG); 527 obuf, 2, DW210X_WRITE_MSG);
503 break; 528 break;
504 } 529 }
530 case (DW2102_LED_CTRL): {
531 u8 obuf[2];
532
533 obuf[0] = 5;
534 obuf[1] = msg[j].buf[0];
535 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
536 obuf, 2, DW210X_WRITE_MSG);
537 break;
538 }
505 /*case 0x55: cx24116 539 /*case 0x55: cx24116
506 case 0x6a: stv0903 540 case 0x6a: stv0903
507 case 0x68: ds3000, stv0903 541 case 0x68: ds3000, stv0903
@@ -535,14 +569,15 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
535 i += 16; 569 i += 16;
536 len -= 16; 570 len -= 16;
537 } while (len > 0); 571 } while (len > 0);
538 } else if ((udev->descriptor.idProduct == 0x7500) 572 } else if (j < (num - 1)) {
539 && (j < (num - 1))) {
540 /* write register addr before read */ 573 /* write register addr before read */
541 u8 obuf[msg[j].len + 2]; 574 u8 obuf[msg[j].len + 2];
542 obuf[0] = msg[j + 1].len; 575 obuf[0] = msg[j + 1].len;
543 obuf[1] = (msg[j].addr << 1); 576 obuf[1] = (msg[j].addr << 1);
544 memcpy(obuf + 2, msg[j].buf, msg[j].len); 577 memcpy(obuf + 2, msg[j].buf, msg[j].len);
545 ret = dw210x_op_rw(d->udev, 0x92, 0, 0, 578 ret = dw210x_op_rw(d->udev,
579 udev->descriptor.idProduct ==
580 0x7500 ? 0x92 : 0x90, 0, 0,
546 obuf, msg[j].len + 2, 581 obuf, msg[j].len + 2,
547 DW210X_WRITE_MSG); 582 DW210X_WRITE_MSG);
548 break; 583 break;
@@ -552,8 +587,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
552 obuf[0] = msg[j].len + 1; 587 obuf[0] = msg[j].len + 1;
553 obuf[1] = (msg[j].addr << 1); 588 obuf[1] = (msg[j].addr << 1);
554 memcpy(obuf + 2, msg[j].buf, msg[j].len); 589 memcpy(obuf + 2, msg[j].buf, msg[j].len);
555 ret = dw210x_op_rw(d->udev, 590 ret = dw210x_op_rw(d->udev, 0x80, 0, 0,
556 (num > 1 ? 0x90 : 0x80), 0, 0,
557 obuf, msg[j].len + 2, 591 obuf, msg[j].len + 2,
558 DW210X_WRITE_MSG); 592 DW210X_WRITE_MSG);
559 break; 593 break;
@@ -561,14 +595,76 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
561 break; 595 break;
562 } 596 }
563 } 597 }
564
565 msleep(3);
566 } 598 }
567 599
568 mutex_unlock(&d->i2c_mutex); 600 mutex_unlock(&d->i2c_mutex);
569 return num; 601 return num;
570} 602}
571 603
604static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
605 int num)
606{
607 struct dvb_usb_device *d = i2c_get_adapdata(adap);
608 u8 obuf[0x40], ibuf[0x40];
609
610 if (!d)
611 return -ENODEV;
612 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
613 return -EAGAIN;
614
615 switch (num) {
616 case 1:
617 switch (msg[0].addr) {
618 case SU3000_STREAM_CTRL:
619 obuf[0] = msg[0].buf[0] + 0x36;
620 obuf[1] = 3;
621 obuf[2] = 0;
622 if (dvb_usb_generic_rw(d, obuf, 3, ibuf, 0, 0) < 0)
623 err("i2c transfer failed.");
624 break;
625 case DW2102_RC_QUERY:
626 obuf[0] = 0x10;
627 if (dvb_usb_generic_rw(d, obuf, 1, ibuf, 2, 0) < 0)
628 err("i2c transfer failed.");
629 msg[0].buf[1] = ibuf[0];
630 msg[0].buf[0] = ibuf[1];
631 break;
632 default:
633 /* always i2c write*/
634 obuf[0] = 0x08;
635 obuf[1] = msg[0].addr;
636 obuf[2] = msg[0].len;
637
638 memcpy(&obuf[3], msg[0].buf, msg[0].len);
639
640 if (dvb_usb_generic_rw(d, obuf, msg[0].len + 3,
641 ibuf, 1, 0) < 0)
642 err("i2c transfer failed.");
643
644 }
645 break;
646 case 2:
647 /* always i2c read */
648 obuf[0] = 0x09;
649 obuf[1] = msg[0].len;
650 obuf[2] = msg[1].len;
651 obuf[3] = msg[0].addr;
652 memcpy(&obuf[4], msg[0].buf, msg[0].len);
653
654 if (dvb_usb_generic_rw(d, obuf, msg[0].len + 4,
655 ibuf, msg[1].len + 1, 0) < 0)
656 err("i2c transfer failed.");
657
658 memcpy(msg[1].buf, &ibuf[1], msg[1].len);
659 break;
660 default:
661 warn("more than 2 i2c messages at a time is not handled yet.");
662 break;
663 }
664 mutex_unlock(&d->i2c_mutex);
665 return num;
666}
667
572static u32 dw210x_i2c_func(struct i2c_adapter *adapter) 668static u32 dw210x_i2c_func(struct i2c_adapter *adapter)
573{ 669{
574 return I2C_FUNC_I2C; 670 return I2C_FUNC_I2C;
@@ -604,6 +700,11 @@ static struct i2c_algorithm s6x0_i2c_algo = {
604 .functionality = dw210x_i2c_func, 700 .functionality = dw210x_i2c_func,
605}; 701};
606 702
703static struct i2c_algorithm su3000_i2c_algo = {
704 .master_xfer = su3000_i2c_transfer,
705 .functionality = dw210x_i2c_func,
706};
707
607static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) 708static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
608{ 709{
609 int i; 710 int i;
@@ -668,6 +769,82 @@ static int s6x0_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
668 return 0; 769 return 0;
669}; 770};
670 771
772static int su3000_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
773{
774 static u8 command_start[] = {0x00};
775 static u8 command_stop[] = {0x01};
776 struct i2c_msg msg = {
777 .addr = SU3000_STREAM_CTRL,
778 .flags = 0,
779 .buf = onoff ? command_start : command_stop,
780 .len = 1
781 };
782
783 i2c_transfer(&adap->dev->i2c_adap, &msg, 1);
784
785 return 0;
786}
787
788static int su3000_power_ctrl(struct dvb_usb_device *d, int i)
789{
790 struct su3000_state *state = (struct su3000_state *)d->priv;
791 u8 obuf[] = {0xde, 0};
792
793 info("%s: %d, initialized %d\n", __func__, i, state->initialized);
794
795 if (i && !state->initialized) {
796 state->initialized = 1;
797 /* reset board */
798 dvb_usb_generic_rw(d, obuf, 2, NULL, 0, 0);
799 }
800
801 return 0;
802}
803
804static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
805{
806 int i;
807 u8 obuf[] = { 0x1f, 0xf0 };
808 u8 ibuf[] = { 0 };
809 struct i2c_msg msg[] = {
810 {
811 .addr = 0x51,
812 .flags = 0,
813 .buf = obuf,
814 .len = 2,
815 }, {
816 .addr = 0x51,
817 .flags = I2C_M_RD,
818 .buf = ibuf,
819 .len = 1,
820
821 }
822 };
823
824 for (i = 0; i < 6; i++) {
825 obuf[1] = 0xf0 + i;
826 if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)
827 break;
828 else
829 mac[i] = ibuf[0];
830
831 debug_dump(mac, 6, printk);
832 }
833
834 return 0;
835}
836
837static int su3000_identify_state(struct usb_device *udev,
838 struct dvb_usb_device_properties *props,
839 struct dvb_usb_device_description **desc,
840 int *cold)
841{
842 info("%s\n", __func__);
843
844 *cold = 0;
845 return 0;
846}
847
671static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) 848static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
672{ 849{
673 static u8 command_13v[] = {0x00, 0x01}; 850 static u8 command_13v[] = {0x00, 0x01};
@@ -692,6 +869,37 @@ static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
692 return 0; 869 return 0;
693} 870}
694 871
872static int s660_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
873{
874 struct dvb_usb_adapter *d =
875 (struct dvb_usb_adapter *)(fe->dvb->priv);
876 struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
877
878 dw210x_set_voltage(fe, voltage);
879 if (st->old_set_voltage)
880 st->old_set_voltage(fe, voltage);
881
882 return 0;
883}
884
885static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon)
886{
887 static u8 led_off[] = { 0 };
888 static u8 led_on[] = { 1 };
889 struct i2c_msg msg = {
890 .addr = DW2102_LED_CTRL,
891 .flags = 0,
892 .buf = led_off,
893 .len = 1
894 };
895 struct dvb_usb_adapter *udev_adap =
896 (struct dvb_usb_adapter *)(fe->dvb->priv);
897
898 if (offon)
899 msg.buf = led_on;
900 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
901}
902
695static struct stv0299_config sharp_z0194a_config = { 903static struct stv0299_config sharp_z0194a_config = {
696 .demod_address = 0x68, 904 .demod_address = 0x68,
697 .inittab = sharp_z0194a_inittab, 905 .inittab = sharp_z0194a_inittab,
@@ -771,6 +979,12 @@ static struct stv0900_config prof_7500_stv0900_config = {
771 .tun1_adc = 0,/* 2 Vpp */ 979 .tun1_adc = 0,/* 2 Vpp */
772 .path1_mode = 3, 980 .path1_mode = 3,
773 .tun1_type = 3, 981 .tun1_type = 3,
982 .set_lock_led = dw210x_led_ctrl,
983};
984
985static struct ds3000_config su3000_ds3000_config = {
986 .demod_address = 0x68,
987 .ci_mode = 1,
774}; 988};
775 989
776static int dw2104_frontend_attach(struct dvb_usb_adapter *d) 990static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
@@ -885,7 +1099,7 @@ static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
885 return -EIO; 1099 return -EIO;
886} 1100}
887 1101
888static int s6x0_frontend_attach(struct dvb_usb_adapter *d) 1102static int zl100313_frontend_attach(struct dvb_usb_adapter *d)
889{ 1103{
890 d->fe = dvb_attach(mt312_attach, &zl313_config, 1104 d->fe = dvb_attach(mt312_attach, &zl313_config,
891 &d->dev->i2c_adap); 1105 &d->dev->i2c_adap);
@@ -898,41 +1112,108 @@ static int s6x0_frontend_attach(struct dvb_usb_adapter *d)
898 } 1112 }
899 } 1113 }
900 1114
1115 return -EIO;
1116}
1117
1118static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
1119{
1120 u8 obuf[] = {7, 1};
1121
901 d->fe = dvb_attach(stv0288_attach, &earda_config, 1122 d->fe = dvb_attach(stv0288_attach, &earda_config,
902 &d->dev->i2c_adap); 1123 &d->dev->i2c_adap);
903 if (d->fe != NULL) { 1124
904 if (dvb_attach(stb6000_attach, d->fe, 0x61, 1125 if (d->fe == NULL)
905 &d->dev->i2c_adap)) { 1126 return -EIO;
906 d->fe->ops.set_voltage = dw210x_set_voltage; 1127
907 info("Attached stv0288+stb6000!\n"); 1128 if (NULL == dvb_attach(stb6000_attach, d->fe, 0x61, &d->dev->i2c_adap))
908 return 0; 1129 return -EIO;
909 } 1130
910 } 1131 d->fe->ops.set_voltage = dw210x_set_voltage;
1132
1133 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1134
1135 info("Attached stv0288+stb6000!\n");
1136
1137 return 0;
1138
1139}
1140
1141static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
1142{
1143 struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
1144 u8 obuf[] = {7, 1};
911 1145
912 d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, 1146 d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
913 &d->dev->i2c_adap); 1147 &d->dev->i2c_adap);
914 if (d->fe != NULL) {
915 d->fe->ops.set_voltage = dw210x_set_voltage;
916 info("Attached ds3000+ds2020!\n");
917 return 0;
918 }
919 1148
920 return -EIO; 1149 if (d->fe == NULL)
1150 return -EIO;
1151
1152 st->old_set_voltage = d->fe->ops.set_voltage;
1153 d->fe->ops.set_voltage = s660_set_voltage;
1154
1155 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1156
1157 info("Attached ds3000+ds2020!\n");
1158
1159 return 0;
921} 1160}
922 1161
923static int prof_7500_frontend_attach(struct dvb_usb_adapter *d) 1162static int prof_7500_frontend_attach(struct dvb_usb_adapter *d)
924{ 1163{
1164 u8 obuf[] = {7, 1};
1165
925 d->fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config, 1166 d->fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
926 &d->dev->i2c_adap, 0); 1167 &d->dev->i2c_adap, 0);
927 if (d->fe == NULL) 1168 if (d->fe == NULL)
928 return -EIO; 1169 return -EIO;
1170
929 d->fe->ops.set_voltage = dw210x_set_voltage; 1171 d->fe->ops.set_voltage = dw210x_set_voltage;
930 1172
1173 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
1174
931 info("Attached STV0900+STB6100A!\n"); 1175 info("Attached STV0900+STB6100A!\n");
932 1176
933 return 0; 1177 return 0;
934} 1178}
935 1179
1180static int su3000_frontend_attach(struct dvb_usb_adapter *d)
1181{
1182 u8 obuf[3] = { 0xe, 0x80, 0 };
1183 u8 ibuf[] = { 0 };
1184
1185 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1186 err("command 0x0e transfer failed.");
1187
1188 obuf[0] = 0xe;
1189 obuf[1] = 0x83;
1190 obuf[2] = 0;
1191
1192 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1193 err("command 0x0e transfer failed.");
1194
1195 obuf[0] = 0xe;
1196 obuf[1] = 0x83;
1197 obuf[2] = 1;
1198
1199 if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1200 err("command 0x0e transfer failed.");
1201
1202 obuf[0] = 0x51;
1203
1204 if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
1205 err("command 0x51 transfer failed.");
1206
1207 d->fe = dvb_attach(ds3000_attach, &su3000_ds3000_config,
1208 &d->dev->i2c_adap);
1209 if (d->fe == NULL)
1210 return -EIO;
1211
1212 info("Attached DS3000!\n");
1213
1214 return 0;
1215}
1216
936static int dw2102_tuner_attach(struct dvb_usb_adapter *adap) 1217static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
937{ 1218{
938 dvb_attach(dvb_pll_attach, adap->fe, 0x60, 1219 dvb_attach(dvb_pll_attach, adap->fe, 0x60,
@@ -948,9 +1229,9 @@ static int dw3101_tuner_attach(struct dvb_usb_adapter *adap)
948 return 0; 1229 return 0;
949} 1230}
950 1231
951static struct ir_scancode ir_codes_dw210x_table[] = { 1232static struct rc_map_table rc_map_dw210x_table[] = {
952 { 0xf80a, KEY_Q }, /*power*/ 1233 { 0xf80a, KEY_POWER2 }, /*power*/
953 { 0xf80c, KEY_M }, /*mute*/ 1234 { 0xf80c, KEY_MUTE }, /*mute*/
954 { 0xf811, KEY_1 }, 1235 { 0xf811, KEY_1 },
955 { 0xf812, KEY_2 }, 1236 { 0xf812, KEY_2 },
956 { 0xf813, KEY_3 }, 1237 { 0xf813, KEY_3 },
@@ -961,28 +1242,28 @@ static struct ir_scancode ir_codes_dw210x_table[] = {
961 { 0xf818, KEY_8 }, 1242 { 0xf818, KEY_8 },
962 { 0xf819, KEY_9 }, 1243 { 0xf819, KEY_9 },
963 { 0xf810, KEY_0 }, 1244 { 0xf810, KEY_0 },
964 { 0xf81c, KEY_PAGEUP }, /*ch+*/ 1245 { 0xf81c, KEY_CHANNELUP }, /*ch+*/
965 { 0xf80f, KEY_PAGEDOWN }, /*ch-*/ 1246 { 0xf80f, KEY_CHANNELDOWN }, /*ch-*/
966 { 0xf81a, KEY_O }, /*vol+*/ 1247 { 0xf81a, KEY_VOLUMEUP }, /*vol+*/
967 { 0xf80e, KEY_Z }, /*vol-*/ 1248 { 0xf80e, KEY_VOLUMEDOWN }, /*vol-*/
968 { 0xf804, KEY_R }, /*rec*/ 1249 { 0xf804, KEY_RECORD }, /*rec*/
969 { 0xf809, KEY_D }, /*fav*/ 1250 { 0xf809, KEY_FAVORITES }, /*fav*/
970 { 0xf808, KEY_BACKSPACE }, /*rewind*/ 1251 { 0xf808, KEY_REWIND }, /*rewind*/
971 { 0xf807, KEY_A }, /*fast*/ 1252 { 0xf807, KEY_FASTFORWARD }, /*fast*/
972 { 0xf80b, KEY_P }, /*pause*/ 1253 { 0xf80b, KEY_PAUSE }, /*pause*/
973 { 0xf802, KEY_ESC }, /*cancel*/ 1254 { 0xf802, KEY_ESC }, /*cancel*/
974 { 0xf803, KEY_G }, /*tab*/ 1255 { 0xf803, KEY_TAB }, /*tab*/
975 { 0xf800, KEY_UP }, /*up*/ 1256 { 0xf800, KEY_UP }, /*up*/
976 { 0xf81f, KEY_ENTER }, /*ok*/ 1257 { 0xf81f, KEY_OK }, /*ok*/
977 { 0xf801, KEY_DOWN }, /*down*/ 1258 { 0xf801, KEY_DOWN }, /*down*/
978 { 0xf805, KEY_C }, /*cap*/ 1259 { 0xf805, KEY_CAMERA }, /*cap*/
979 { 0xf806, KEY_S }, /*stop*/ 1260 { 0xf806, KEY_STOP }, /*stop*/
980 { 0xf840, KEY_F }, /*full*/ 1261 { 0xf840, KEY_ZOOM }, /*full*/
981 { 0xf81e, KEY_W }, /*tvmode*/ 1262 { 0xf81e, KEY_TV }, /*tvmode*/
982 { 0xf81b, KEY_B }, /*recall*/ 1263 { 0xf81b, KEY_LAST }, /*recall*/
983}; 1264};
984 1265
985static struct ir_scancode ir_codes_tevii_table[] = { 1266static struct rc_map_table rc_map_tevii_table[] = {
986 { 0xf80a, KEY_POWER }, 1267 { 0xf80a, KEY_POWER },
987 { 0xf80c, KEY_MUTE }, 1268 { 0xf80c, KEY_MUTE },
988 { 0xf811, KEY_1 }, 1269 { 0xf811, KEY_1 },
@@ -1032,7 +1313,7 @@ static struct ir_scancode ir_codes_tevii_table[] = {
1032 { 0xf858, KEY_SWITCHVIDEOMODE }, 1313 { 0xf858, KEY_SWITCHVIDEOMODE },
1033}; 1314};
1034 1315
1035static struct ir_scancode ir_codes_tbs_table[] = { 1316static struct rc_map_table rc_map_tbs_table[] = {
1036 { 0xf884, KEY_POWER }, 1317 { 0xf884, KEY_POWER },
1037 { 0xf894, KEY_MUTE }, 1318 { 0xf894, KEY_MUTE },
1038 { 0xf887, KEY_1 }, 1319 { 0xf887, KEY_1 },
@@ -1067,16 +1348,55 @@ static struct ir_scancode ir_codes_tbs_table[] = {
1067 { 0xf89b, KEY_MODE } 1348 { 0xf89b, KEY_MODE }
1068}; 1349};
1069 1350
1070static struct ir_codes_dvb_usb_table_table keys_tables[] = { 1351static struct rc_map_table rc_map_su3000_table[] = {
1071 { ir_codes_dw210x_table, ARRAY_SIZE(ir_codes_dw210x_table) }, 1352 { 0x25, KEY_POWER }, /* right-bottom Red */
1072 { ir_codes_tevii_table, ARRAY_SIZE(ir_codes_tevii_table) }, 1353 { 0x0a, KEY_MUTE }, /* -/-- */
1073 { ir_codes_tbs_table, ARRAY_SIZE(ir_codes_tbs_table) }, 1354 { 0x01, KEY_1 },
1355 { 0x02, KEY_2 },
1356 { 0x03, KEY_3 },
1357 { 0x04, KEY_4 },
1358 { 0x05, KEY_5 },
1359 { 0x06, KEY_6 },
1360 { 0x07, KEY_7 },
1361 { 0x08, KEY_8 },
1362 { 0x09, KEY_9 },
1363 { 0x00, KEY_0 },
1364 { 0x20, KEY_UP }, /* CH+ */
1365 { 0x21, KEY_DOWN }, /* CH+ */
1366 { 0x12, KEY_VOLUMEUP }, /* Brightness Up */
1367 { 0x13, KEY_VOLUMEDOWN },/* Brightness Down */
1368 { 0x1f, KEY_RECORD },
1369 { 0x17, KEY_PLAY },
1370 { 0x16, KEY_PAUSE },
1371 { 0x0b, KEY_STOP },
1372 { 0x27, KEY_FASTFORWARD },/* >> */
1373 { 0x26, KEY_REWIND }, /* << */
1374 { 0x0d, KEY_OK }, /* Mute */
1375 { 0x11, KEY_LEFT }, /* VOL- */
1376 { 0x10, KEY_RIGHT }, /* VOL+ */
1377 { 0x29, KEY_BACK }, /* button under 9 */
1378 { 0x2c, KEY_MENU }, /* TTX */
1379 { 0x2b, KEY_EPG }, /* EPG */
1380 { 0x1e, KEY_RED }, /* OSD */
1381 { 0x0e, KEY_GREEN }, /* Window */
1382 { 0x2d, KEY_YELLOW }, /* button under << */
1383 { 0x0f, KEY_BLUE }, /* bottom yellow button */
1384 { 0x14, KEY_AUDIO }, /* Snapshot */
1385 { 0x38, KEY_TV }, /* TV/Radio */
1386 { 0x0c, KEY_ESC } /* upper Red button */
1387};
1388
1389static struct rc_map_dvb_usb_table_table keys_tables[] = {
1390 { rc_map_dw210x_table, ARRAY_SIZE(rc_map_dw210x_table) },
1391 { rc_map_tevii_table, ARRAY_SIZE(rc_map_tevii_table) },
1392 { rc_map_tbs_table, ARRAY_SIZE(rc_map_tbs_table) },
1393 { rc_map_su3000_table, ARRAY_SIZE(rc_map_su3000_table) },
1074}; 1394};
1075 1395
1076static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 1396static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
1077{ 1397{
1078 struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; 1398 struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
1079 int keymap_size = d->props.rc.legacy.rc_key_map_size; 1399 int keymap_size = d->props.rc.legacy.rc_map_size;
1080 u8 key[2]; 1400 u8 key[2];
1081 struct i2c_msg msg = { 1401 struct i2c_msg msg = {
1082 .addr = DW2102_RC_QUERY, 1402 .addr = DW2102_RC_QUERY,
@@ -1089,7 +1409,8 @@ static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
1089 if ((ir_keymap > 0) && (ir_keymap <= ARRAY_SIZE(keys_tables))) { 1409 if ((ir_keymap > 0) && (ir_keymap <= ARRAY_SIZE(keys_tables))) {
1090 keymap = keys_tables[ir_keymap - 1].rc_keys ; 1410 keymap = keys_tables[ir_keymap - 1].rc_keys ;
1091 keymap_size = keys_tables[ir_keymap - 1].rc_keys_size; 1411 keymap_size = keys_tables[ir_keymap - 1].rc_keys_size;
1092 } 1412 } else if (ir_keymap > ARRAY_SIZE(keys_tables))
1413 return 0; /* none */
1093 1414
1094 *state = REMOTE_NO_KEY_PRESSED; 1415 *state = REMOTE_NO_KEY_PRESSED;
1095 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { 1416 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) {
@@ -1125,6 +1446,11 @@ static struct usb_device_id dw2102_table[] = {
1125 {USB_DEVICE(0x3011, USB_PID_PROF_1100)}, 1446 {USB_DEVICE(0x3011, USB_PID_PROF_1100)},
1126 {USB_DEVICE(0x9022, USB_PID_TEVII_S660)}, 1447 {USB_DEVICE(0x9022, USB_PID_TEVII_S660)},
1127 {USB_DEVICE(0x3034, 0x7500)}, 1448 {USB_DEVICE(0x3034, 0x7500)},
1449 {USB_DEVICE(0x1f4d, 0x3000)},
1450 {USB_DEVICE(USB_VID_TERRATEC, 0x00a8)},
1451 {USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)},
1452 {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
1453 {USB_DEVICE(0x1f4d, 0x3100)},
1128 { } 1454 { }
1129}; 1455};
1130 1456
@@ -1184,15 +1510,10 @@ static int dw2102_load_firmware(struct usb_device *dev,
1184 } 1510 }
1185 /* init registers */ 1511 /* init registers */
1186 switch (dev->descriptor.idProduct) { 1512 switch (dev->descriptor.idProduct) {
1187 case USB_PID_PROF_1100:
1188 s6x0_properties.rc.legacy.rc_key_map = ir_codes_tbs_table;
1189 s6x0_properties.rc.legacy.rc_key_map_size =
1190 ARRAY_SIZE(ir_codes_tbs_table);
1191 break;
1192 case USB_PID_TEVII_S650: 1513 case USB_PID_TEVII_S650:
1193 dw2104_properties.rc.legacy.rc_key_map = ir_codes_tevii_table; 1514 dw2104_properties.rc.legacy.rc_map_table = rc_map_tevii_table;
1194 dw2104_properties.rc.legacy.rc_key_map_size = 1515 dw2104_properties.rc.legacy.rc_map_size =
1195 ARRAY_SIZE(ir_codes_tevii_table); 1516 ARRAY_SIZE(rc_map_tevii_table);
1196 case USB_PID_DW2104: 1517 case USB_PID_DW2104:
1197 reset = 1; 1518 reset = 1;
1198 dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1, 1519 dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1,
@@ -1257,8 +1578,8 @@ static struct dvb_usb_device_properties dw2102_properties = {
1257 .i2c_algo = &dw2102_serit_i2c_algo, 1578 .i2c_algo = &dw2102_serit_i2c_algo,
1258 1579
1259 .rc.legacy = { 1580 .rc.legacy = {
1260 .rc_key_map = ir_codes_dw210x_table, 1581 .rc_map_table = rc_map_dw210x_table,
1261 .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), 1582 .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
1262 .rc_interval = 150, 1583 .rc_interval = 150,
1263 .rc_query = dw2102_rc_query, 1584 .rc_query = dw2102_rc_query,
1264 }, 1585 },
@@ -1271,8 +1592,6 @@ static struct dvb_usb_device_properties dw2102_properties = {
1271 .adapter = { 1592 .adapter = {
1272 { 1593 {
1273 .frontend_attach = dw2102_frontend_attach, 1594 .frontend_attach = dw2102_frontend_attach,
1274 .streaming_ctrl = NULL,
1275 .tuner_attach = NULL,
1276 .stream = { 1595 .stream = {
1277 .type = USB_BULK, 1596 .type = USB_BULK,
1278 .count = 8, 1597 .count = 8,
@@ -1310,8 +1629,8 @@ static struct dvb_usb_device_properties dw2104_properties = {
1310 1629
1311 .i2c_algo = &dw2104_i2c_algo, 1630 .i2c_algo = &dw2104_i2c_algo,
1312 .rc.legacy = { 1631 .rc.legacy = {
1313 .rc_key_map = ir_codes_dw210x_table, 1632 .rc_map_table = rc_map_dw210x_table,
1314 .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), 1633 .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
1315 .rc_interval = 150, 1634 .rc_interval = 150,
1316 .rc_query = dw2102_rc_query, 1635 .rc_query = dw2102_rc_query,
1317 }, 1636 },
@@ -1324,8 +1643,6 @@ static struct dvb_usb_device_properties dw2104_properties = {
1324 .adapter = { 1643 .adapter = {
1325 { 1644 {
1326 .frontend_attach = dw2104_frontend_attach, 1645 .frontend_attach = dw2104_frontend_attach,
1327 .streaming_ctrl = NULL,
1328 /*.tuner_attach = dw2104_tuner_attach,*/
1329 .stream = { 1646 .stream = {
1330 .type = USB_BULK, 1647 .type = USB_BULK,
1331 .count = 8, 1648 .count = 8,
@@ -1359,8 +1676,8 @@ static struct dvb_usb_device_properties dw3101_properties = {
1359 1676
1360 .i2c_algo = &dw3101_i2c_algo, 1677 .i2c_algo = &dw3101_i2c_algo,
1361 .rc.legacy = { 1678 .rc.legacy = {
1362 .rc_key_map = ir_codes_dw210x_table, 1679 .rc_map_table = rc_map_dw210x_table,
1363 .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), 1680 .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
1364 .rc_interval = 150, 1681 .rc_interval = 150,
1365 .rc_query = dw2102_rc_query, 1682 .rc_query = dw2102_rc_query,
1366 }, 1683 },
@@ -1373,7 +1690,6 @@ static struct dvb_usb_device_properties dw3101_properties = {
1373 .adapter = { 1690 .adapter = {
1374 { 1691 {
1375 .frontend_attach = dw3101_frontend_attach, 1692 .frontend_attach = dw3101_frontend_attach,
1376 .streaming_ctrl = NULL,
1377 .tuner_attach = dw3101_tuner_attach, 1693 .tuner_attach = dw3101_tuner_attach,
1378 .stream = { 1694 .stream = {
1379 .type = USB_BULK, 1695 .type = USB_BULK,
@@ -1399,13 +1715,14 @@ static struct dvb_usb_device_properties dw3101_properties = {
1399static struct dvb_usb_device_properties s6x0_properties = { 1715static struct dvb_usb_device_properties s6x0_properties = {
1400 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 1716 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1401 .usb_ctrl = DEVICE_SPECIFIC, 1717 .usb_ctrl = DEVICE_SPECIFIC,
1718 .size_of_priv = sizeof(struct s6x0_state),
1402 .firmware = "dvb-usb-s630.fw", 1719 .firmware = "dvb-usb-s630.fw",
1403 .no_reconnect = 1, 1720 .no_reconnect = 1,
1404 1721
1405 .i2c_algo = &s6x0_i2c_algo, 1722 .i2c_algo = &s6x0_i2c_algo,
1406 .rc.legacy = { 1723 .rc.legacy = {
1407 .rc_key_map = ir_codes_tevii_table, 1724 .rc_map_table = rc_map_tevii_table,
1408 .rc_key_map_size = ARRAY_SIZE(ir_codes_tevii_table), 1725 .rc_map_size = ARRAY_SIZE(rc_map_tevii_table),
1409 .rc_interval = 150, 1726 .rc_interval = 150,
1410 .rc_query = dw2102_rc_query, 1727 .rc_query = dw2102_rc_query,
1411 }, 1728 },
@@ -1416,9 +1733,7 @@ static struct dvb_usb_device_properties s6x0_properties = {
1416 .read_mac_address = s6x0_read_mac_address, 1733 .read_mac_address = s6x0_read_mac_address,
1417 .adapter = { 1734 .adapter = {
1418 { 1735 {
1419 .frontend_attach = s6x0_frontend_attach, 1736 .frontend_attach = zl100313_frontend_attach,
1420 .streaming_ctrl = NULL,
1421 .tuner_attach = NULL,
1422 .stream = { 1737 .stream = {
1423 .type = USB_BULK, 1738 .type = USB_BULK,
1424 .count = 8, 1739 .count = 8,
@@ -1431,23 +1746,41 @@ static struct dvb_usb_device_properties s6x0_properties = {
1431 }, 1746 },
1432 } 1747 }
1433 }, 1748 },
1434 .num_device_descs = 3, 1749 .num_device_descs = 1,
1435 .devices = { 1750 .devices = {
1436 {"TeVii S630 USB", 1751 {"TeVii S630 USB",
1437 {&dw2102_table[6], NULL}, 1752 {&dw2102_table[6], NULL},
1438 {NULL}, 1753 {NULL},
1439 }, 1754 },
1440 {"Prof 1100 USB ",
1441 {&dw2102_table[7], NULL},
1442 {NULL},
1443 },
1444 {"TeVii S660 USB",
1445 {&dw2102_table[8], NULL},
1446 {NULL},
1447 },
1448 } 1755 }
1449}; 1756};
1450 1757
1758struct dvb_usb_device_properties *p1100;
1759static struct dvb_usb_device_description d1100 = {
1760 "Prof 1100 USB ",
1761 {&dw2102_table[7], NULL},
1762 {NULL},
1763};
1764
1765struct dvb_usb_device_properties *s660;
1766static struct dvb_usb_device_description d660 = {
1767 "TeVii S660 USB",
1768 {&dw2102_table[8], NULL},
1769 {NULL},
1770};
1771
1772static struct dvb_usb_device_description d480_1 = {
1773 "TeVii S480.1 USB",
1774 {&dw2102_table[12], NULL},
1775 {NULL},
1776};
1777
1778static struct dvb_usb_device_description d480_2 = {
1779 "TeVii S480.2 USB",
1780 {&dw2102_table[13], NULL},
1781 {NULL},
1782};
1783
1451struct dvb_usb_device_properties *p7500; 1784struct dvb_usb_device_properties *p7500;
1452static struct dvb_usb_device_description d7500 = { 1785static struct dvb_usb_device_description d7500 = {
1453 "Prof 7500 USB DVB-S2", 1786 "Prof 7500 USB DVB-S2",
@@ -1455,21 +1788,101 @@ static struct dvb_usb_device_description d7500 = {
1455 {NULL}, 1788 {NULL},
1456}; 1789};
1457 1790
1791static struct dvb_usb_device_properties su3000_properties = {
1792 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1793 .usb_ctrl = DEVICE_SPECIFIC,
1794 .size_of_priv = sizeof(struct su3000_state),
1795 .power_ctrl = su3000_power_ctrl,
1796 .num_adapters = 1,
1797 .identify_state = su3000_identify_state,
1798 .i2c_algo = &su3000_i2c_algo,
1799
1800 .rc.legacy = {
1801 .rc_map_table = rc_map_su3000_table,
1802 .rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
1803 .rc_interval = 150,
1804 .rc_query = dw2102_rc_query,
1805 },
1806
1807 .read_mac_address = su3000_read_mac_address,
1808
1809 .generic_bulk_ctrl_endpoint = 0x01,
1810
1811 .adapter = {
1812 {
1813 .streaming_ctrl = su3000_streaming_ctrl,
1814 .frontend_attach = su3000_frontend_attach,
1815 .stream = {
1816 .type = USB_BULK,
1817 .count = 8,
1818 .endpoint = 0x82,
1819 .u = {
1820 .bulk = {
1821 .buffersize = 4096,
1822 }
1823 }
1824 }
1825 }
1826 },
1827 .num_device_descs = 3,
1828 .devices = {
1829 { "SU3000HD DVB-S USB2.0",
1830 { &dw2102_table[10], NULL },
1831 { NULL },
1832 },
1833 { "Terratec Cinergy S2 USB HD",
1834 { &dw2102_table[11], NULL },
1835 { NULL },
1836 },
1837 { "X3M TV SPC1400HD PCI",
1838 { &dw2102_table[14], NULL },
1839 { NULL },
1840 },
1841 }
1842};
1843
1458static int dw2102_probe(struct usb_interface *intf, 1844static int dw2102_probe(struct usb_interface *intf,
1459 const struct usb_device_id *id) 1845 const struct usb_device_id *id)
1460{ 1846{
1847 p1100 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1848 if (!p1100)
1849 return -ENOMEM;
1850 /* copy default structure */
1851 memcpy(p1100, &s6x0_properties,
1852 sizeof(struct dvb_usb_device_properties));
1853 /* fill only different fields */
1854 p1100->firmware = "dvb-usb-p1100.fw";
1855 p1100->devices[0] = d1100;
1856 p1100->rc.legacy.rc_map_table = rc_map_tbs_table;
1857 p1100->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
1858 p1100->adapter->frontend_attach = stv0288_frontend_attach;
1859
1860 s660 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1861 if (!s660) {
1862 kfree(p1100);
1863 return -ENOMEM;
1864 }
1865 memcpy(s660, &s6x0_properties,
1866 sizeof(struct dvb_usb_device_properties));
1867 s660->firmware = "dvb-usb-s660.fw";
1868 s660->num_device_descs = 3;
1869 s660->devices[0] = d660;
1870 s660->devices[1] = d480_1;
1871 s660->devices[2] = d480_2;
1872 s660->adapter->frontend_attach = ds3000_frontend_attach;
1461 1873
1462 p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL); 1874 p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1463 if (!p7500) 1875 if (!p7500) {
1876 kfree(p1100);
1877 kfree(s660);
1464 return -ENOMEM; 1878 return -ENOMEM;
1465 /* copy default structure */ 1879 }
1466 memcpy(p7500, &s6x0_properties, 1880 memcpy(p7500, &s6x0_properties,
1467 sizeof(struct dvb_usb_device_properties)); 1881 sizeof(struct dvb_usb_device_properties));
1468 /* fill only different fields */
1469 p7500->firmware = "dvb-usb-p7500.fw"; 1882 p7500->firmware = "dvb-usb-p7500.fw";
1470 p7500->devices[0] = d7500; 1883 p7500->devices[0] = d7500;
1471 p7500->rc.legacy.rc_key_map = ir_codes_tbs_table; 1884 p7500->rc.legacy.rc_map_table = rc_map_tbs_table;
1472 p7500->rc.legacy.rc_key_map_size = ARRAY_SIZE(ir_codes_tbs_table); 1885 p7500->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
1473 p7500->adapter->frontend_attach = prof_7500_frontend_attach; 1886 p7500->adapter->frontend_attach = prof_7500_frontend_attach;
1474 1887
1475 if (0 == dvb_usb_device_init(intf, &dw2102_properties, 1888 if (0 == dvb_usb_device_init(intf, &dw2102_properties,
@@ -1480,8 +1893,14 @@ static int dw2102_probe(struct usb_interface *intf,
1480 THIS_MODULE, NULL, adapter_nr) || 1893 THIS_MODULE, NULL, adapter_nr) ||
1481 0 == dvb_usb_device_init(intf, &s6x0_properties, 1894 0 == dvb_usb_device_init(intf, &s6x0_properties,
1482 THIS_MODULE, NULL, adapter_nr) || 1895 THIS_MODULE, NULL, adapter_nr) ||
1896 0 == dvb_usb_device_init(intf, p1100,
1897 THIS_MODULE, NULL, adapter_nr) ||
1898 0 == dvb_usb_device_init(intf, s660,
1899 THIS_MODULE, NULL, adapter_nr) ||
1483 0 == dvb_usb_device_init(intf, p7500, 1900 0 == dvb_usb_device_init(intf, p7500,
1484 THIS_MODULE, NULL, adapter_nr)) 1901 THIS_MODULE, NULL, adapter_nr) ||
1902 0 == dvb_usb_device_init(intf, &su3000_properties,
1903 THIS_MODULE, NULL, adapter_nr))
1485 return 0; 1904 return 0;
1486 1905
1487 return -ENODEV; 1906 return -ENODEV;
@@ -1514,7 +1933,8 @@ module_exit(dw2102_module_exit);
1514MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); 1933MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
1515MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," 1934MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
1516 " DVB-C 3101 USB2.0," 1935 " DVB-C 3101 USB2.0,"
1517 " TeVii S600, S630, S650, S660 USB2.0," 1936 " TeVii S600, S630, S650, S660, S480,"
1518 " Prof 1100, 7500 USB2.0 devices"); 1937 " Prof 1100, 7500 USB2.0,"
1938 " Geniatech SU3000 devices");
1519MODULE_VERSION("0.1"); 1939MODULE_VERSION("0.1");
1520MODULE_LICENSE("GPL"); 1940MODULE_LICENSE("GPL");