2 * Driver for DVBSky USB2.0 receiver
4 * Copyright (C) 2013 Max nibble <nibble.max@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "m88ds3103.h"
28 #define DVBSKY_MSG_DELAY 0/*2000*/
29 #define DVBSKY_BUF_LEN 64
31 static int dvb_usb_dvbsky_disable_rc
;
32 module_param_named(disable_rc
, dvb_usb_dvbsky_disable_rc
, int, 0644);
33 MODULE_PARM_DESC(disable_rc
, "Disable inbuilt IR receiver.");
35 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr
);
38 struct mutex stream_mutex
;
39 u8 ibuf
[DVBSKY_BUF_LEN
];
40 u8 obuf
[DVBSKY_BUF_LEN
];
42 struct i2c_client
*i2c_client_demod
;
43 struct i2c_client
*i2c_client_tuner
;
44 struct i2c_client
*i2c_client_ci
;
46 /* fe hook functions*/
47 int (*fe_set_voltage
)(struct dvb_frontend
*fe
,
48 enum fe_sec_voltage voltage
);
49 int (*fe_read_status
)(struct dvb_frontend
*fe
,
50 enum fe_status
*status
);
53 static int dvbsky_usb_generic_rw(struct dvb_usb_device
*d
,
54 u8
*wbuf
, u16 wlen
, u8
*rbuf
, u16 rlen
)
57 struct dvbsky_state
*state
= d_to_priv(d
);
59 mutex_lock(&d
->usb_mutex
);
61 memcpy(state
->obuf
, wbuf
, wlen
);
63 ret
= dvb_usbv2_generic_rw_locked(d
, state
->obuf
, wlen
,
66 if (!ret
&& (rlen
!= 0))
67 memcpy(rbuf
, state
->ibuf
, rlen
);
69 mutex_unlock(&d
->usb_mutex
);
73 static int dvbsky_stream_ctrl(struct dvb_usb_device
*d
, u8 onoff
)
75 struct dvbsky_state
*state
= d_to_priv(d
);
77 u8 obuf_pre
[3] = { 0x37, 0, 0 };
78 u8 obuf_post
[3] = { 0x36, 3, 0 };
80 mutex_lock(&state
->stream_mutex
);
81 ret
= dvbsky_usb_generic_rw(d
, obuf_pre
, 3, NULL
, 0);
84 ret
= dvbsky_usb_generic_rw(d
, obuf_post
, 3, NULL
, 0);
86 mutex_unlock(&state
->stream_mutex
);
90 static int dvbsky_streaming_ctrl(struct dvb_frontend
*fe
, int onoff
)
92 struct dvb_usb_device
*d
= fe_to_d(fe
);
94 return dvbsky_stream_ctrl(d
, (onoff
== 0) ? 0 : 1);
98 static int dvbsky_gpio_ctrl(struct dvb_usb_device
*d
, u8 gport
, u8 value
)
106 ret
= dvbsky_usb_generic_rw(d
, obuf
, 3, ibuf
, 1);
108 dev_err(&d
->udev
->dev
, "failed=%d\n", ret
);
113 static int dvbsky_i2c_xfer(struct i2c_adapter
*adap
, struct i2c_msg msg
[],
116 struct dvb_usb_device
*d
= i2c_get_adapdata(adap
);
118 u8 ibuf
[64], obuf
[64];
120 if (mutex_lock_interruptible(&d
->i2c_mutex
) < 0)
124 dev_err(&d
->udev
->dev
,
125 "too many i2c messages[%d], max 2.", num
);
131 if (msg
[0].len
> 60) {
132 dev_err(&d
->udev
->dev
,
133 "too many i2c bytes[%d], max 60.",
138 if (msg
[0].flags
& I2C_M_RD
) {
142 obuf
[2] = msg
[0].len
;
143 obuf
[3] = msg
[0].addr
;
144 ret
= dvbsky_usb_generic_rw(d
, obuf
, 4,
145 ibuf
, msg
[0].len
+ 1);
147 dev_err(&d
->udev
->dev
, "failed=%d\n", ret
);
149 memcpy(msg
[0].buf
, &ibuf
[1], msg
[0].len
);
153 obuf
[1] = msg
[0].addr
;
154 obuf
[2] = msg
[0].len
;
155 memcpy(&obuf
[3], msg
[0].buf
, msg
[0].len
);
156 ret
= dvbsky_usb_generic_rw(d
, obuf
,
157 msg
[0].len
+ 3, ibuf
, 1);
159 dev_err(&d
->udev
->dev
, "failed=%d\n", ret
);
162 if ((msg
[0].len
> 60) || (msg
[1].len
> 60)) {
163 dev_err(&d
->udev
->dev
,
164 "too many i2c bytes[w-%d][r-%d], max 60.",
165 msg
[0].len
, msg
[1].len
);
169 /* write then read */
171 obuf
[1] = msg
[0].len
;
172 obuf
[2] = msg
[1].len
;
173 obuf
[3] = msg
[0].addr
;
174 memcpy(&obuf
[4], msg
[0].buf
, msg
[0].len
);
175 ret
= dvbsky_usb_generic_rw(d
, obuf
,
176 msg
[0].len
+ 4, ibuf
, msg
[1].len
+ 1);
178 dev_err(&d
->udev
->dev
, "failed=%d\n", ret
);
181 memcpy(msg
[1].buf
, &ibuf
[1], msg
[1].len
);
184 mutex_unlock(&d
->i2c_mutex
);
185 return (ret
) ? ret
: num
;
188 static u32
dvbsky_i2c_func(struct i2c_adapter
*adapter
)
193 static struct i2c_algorithm dvbsky_i2c_algo
= {
194 .master_xfer
= dvbsky_i2c_xfer
,
195 .functionality
= dvbsky_i2c_func
,
198 #if IS_ENABLED(CONFIG_RC_CORE)
199 static int dvbsky_rc_query(struct dvb_usb_device
*d
)
201 u32 code
= 0xffff, scancode
;
202 u8 rc5_command
, rc5_system
;
203 u8 obuf
[2], ibuf
[2], toggle
;
207 ret
= dvbsky_usb_generic_rw(d
, obuf
, 1, ibuf
, 2);
209 dev_err(&d
->udev
->dev
, "failed=%d\n", ret
);
211 code
= (ibuf
[0] << 8) | ibuf
[1];
212 if (code
!= 0xffff) {
213 dev_dbg(&d
->udev
->dev
, "rc code: %x\n", code
);
214 rc5_command
= code
& 0x3F;
215 rc5_system
= (code
& 0x7C0) >> 6;
216 toggle
= (code
& 0x800) ? 1 : 0;
217 scancode
= rc5_system
<< 8 | rc5_command
;
218 rc_keydown(d
->rc_dev
, RC_TYPE_RC5
, scancode
, toggle
);
223 static int dvbsky_get_rc_config(struct dvb_usb_device
*d
, struct dvb_usb_rc
*rc
)
225 if (dvb_usb_dvbsky_disable_rc
) {
230 rc
->allowed_protos
= RC_BIT_RC5
;
231 rc
->query
= dvbsky_rc_query
;
236 #define dvbsky_get_rc_config NULL
239 static int dvbsky_usb_set_voltage(struct dvb_frontend
*fe
,
240 enum fe_sec_voltage voltage
)
242 struct dvb_usb_device
*d
= fe_to_d(fe
);
243 struct dvbsky_state
*state
= d_to_priv(d
);
246 if (voltage
== SEC_VOLTAGE_OFF
)
250 dvbsky_gpio_ctrl(d
, 0x80, value
);
252 return state
->fe_set_voltage(fe
, voltage
);
255 static int dvbsky_read_mac_addr(struct dvb_usb_adapter
*adap
, u8 mac
[6])
257 struct dvb_usb_device
*d
= adap_to_d(adap
);
258 u8 obuf
[] = { 0x1e, 0x00 };
260 struct i2c_msg msg
[] = {
274 if (i2c_transfer(&d
->i2c_adap
, msg
, 2) == 2)
275 memcpy(mac
, ibuf
, 6);
280 static int dvbsky_usb_read_status(struct dvb_frontend
*fe
,
281 enum fe_status
*status
)
283 struct dvb_usb_device
*d
= fe_to_d(fe
);
284 struct dvbsky_state
*state
= d_to_priv(d
);
287 ret
= state
->fe_read_status(fe
, status
);
289 /* it need resync slave fifo when signal change from unlock to lock.*/
290 if ((*status
& FE_HAS_LOCK
) && (!state
->last_lock
))
291 dvbsky_stream_ctrl(d
, 1);
293 state
->last_lock
= (*status
& FE_HAS_LOCK
) ? 1 : 0;
297 static const struct m88ds3103_config dvbsky_s960_m88ds3103_config
= {
302 .ts_mode
= M88DS3103_TS_CI
,
310 static int dvbsky_s960_attach(struct dvb_usb_adapter
*adap
)
312 struct dvbsky_state
*state
= adap_to_priv(adap
);
313 struct dvb_usb_device
*d
= adap_to_d(adap
);
315 /* demod I2C adapter */
316 struct i2c_adapter
*i2c_adapter
;
317 struct i2c_client
*client
;
318 struct i2c_board_info info
;
319 struct ts2020_config ts2020_config
= {};
320 memset(&info
, 0, sizeof(struct i2c_board_info
));
323 adap
->fe
[0] = dvb_attach(m88ds3103_attach
,
324 &dvbsky_s960_m88ds3103_config
,
328 dev_err(&d
->udev
->dev
, "dvbsky_s960_attach fail.\n");
334 ts2020_config
.fe
= adap
->fe
[0];
335 ts2020_config
.get_agc_pwm
= m88ds3103_get_agc_pwm
;
336 strlcpy(info
.type
, "ts2020", I2C_NAME_SIZE
);
338 info
.platform_data
= &ts2020_config
;
339 request_module("ts2020");
340 client
= i2c_new_device(i2c_adapter
, &info
);
341 if (client
== NULL
|| client
->dev
.driver
== NULL
) {
342 dvb_frontend_detach(adap
->fe
[0]);
347 if (!try_module_get(client
->dev
.driver
->owner
)) {
348 i2c_unregister_device(client
);
349 dvb_frontend_detach(adap
->fe
[0]);
354 /* delegate signal strength measurement to tuner */
355 adap
->fe
[0]->ops
.read_signal_strength
=
356 adap
->fe
[0]->ops
.tuner_ops
.get_rf_strength
;
358 /* hook fe: need to resync the slave fifo when signal locks. */
359 state
->fe_read_status
= adap
->fe
[0]->ops
.read_status
;
360 adap
->fe
[0]->ops
.read_status
= dvbsky_usb_read_status
;
362 /* hook fe: LNB off/on is control by Cypress usb chip. */
363 state
->fe_set_voltage
= adap
->fe
[0]->ops
.set_voltage
;
364 adap
->fe
[0]->ops
.set_voltage
= dvbsky_usb_set_voltage
;
366 state
->i2c_client_tuner
= client
;
372 static int dvbsky_usb_ci_set_voltage(struct dvb_frontend
*fe
,
373 enum fe_sec_voltage voltage
)
375 struct dvb_usb_device
*d
= fe_to_d(fe
);
376 struct dvbsky_state
*state
= d_to_priv(d
);
379 if (voltage
== SEC_VOLTAGE_OFF
)
383 dvbsky_gpio_ctrl(d
, 0x00, value
);
385 return state
->fe_set_voltage(fe
, voltage
);
388 static int dvbsky_ci_ctrl(void *priv
, u8 read
, int addr
,
391 struct dvb_usb_device
*d
= priv
;
393 u8 command
[4], respond
[2], command_size
, respond_size
;
395 command
[1] = (u8
)((addr
>> 8) & 0xff); /*high part of address*/
396 command
[2] = (u8
)(addr
& 0xff); /*low part of address*/
407 ret
= dvbsky_usb_generic_rw(d
, command
, command_size
,
408 respond
, respond_size
);
415 dev_err(&d
->udev
->dev
, "ci control failed=%d\n", ret
);
419 static const struct m88ds3103_config dvbsky_s960c_m88ds3103_config
= {
424 .ts_mode
= M88DS3103_TS_CI
,
432 static int dvbsky_s960c_attach(struct dvb_usb_adapter
*adap
)
434 struct dvbsky_state
*state
= adap_to_priv(adap
);
435 struct dvb_usb_device
*d
= adap_to_d(adap
);
437 /* demod I2C adapter */
438 struct i2c_adapter
*i2c_adapter
;
439 struct i2c_client
*client_tuner
, *client_ci
;
440 struct i2c_board_info info
;
441 struct sp2_config sp2_config
;
442 struct ts2020_config ts2020_config
= {};
443 memset(&info
, 0, sizeof(struct i2c_board_info
));
446 adap
->fe
[0] = dvb_attach(m88ds3103_attach
,
447 &dvbsky_s960c_m88ds3103_config
,
451 dev_err(&d
->udev
->dev
, "dvbsky_s960ci_attach fail.\n");
457 ts2020_config
.fe
= adap
->fe
[0];
458 ts2020_config
.get_agc_pwm
= m88ds3103_get_agc_pwm
;
459 strlcpy(info
.type
, "ts2020", I2C_NAME_SIZE
);
461 info
.platform_data
= &ts2020_config
;
462 request_module("ts2020");
463 client_tuner
= i2c_new_device(i2c_adapter
, &info
);
464 if (client_tuner
== NULL
|| client_tuner
->dev
.driver
== NULL
) {
466 goto fail_tuner_device
;
469 if (!try_module_get(client_tuner
->dev
.driver
->owner
)) {
471 goto fail_tuner_module
;
474 /* attach ci controller */
475 memset(&sp2_config
, 0, sizeof(sp2_config
));
476 sp2_config
.dvb_adap
= &adap
->dvb_adap
;
478 sp2_config
.ci_control
= dvbsky_ci_ctrl
;
479 memset(&info
, 0, sizeof(struct i2c_board_info
));
480 strlcpy(info
.type
, "sp2", I2C_NAME_SIZE
);
482 info
.platform_data
= &sp2_config
;
483 request_module("sp2");
484 client_ci
= i2c_new_device(&d
->i2c_adap
, &info
);
485 if (client_ci
== NULL
|| client_ci
->dev
.driver
== NULL
) {
490 if (!try_module_get(client_ci
->dev
.driver
->owner
)) {
495 /* delegate signal strength measurement to tuner */
496 adap
->fe
[0]->ops
.read_signal_strength
=
497 adap
->fe
[0]->ops
.tuner_ops
.get_rf_strength
;
499 /* hook fe: need to resync the slave fifo when signal locks. */
500 state
->fe_read_status
= adap
->fe
[0]->ops
.read_status
;
501 adap
->fe
[0]->ops
.read_status
= dvbsky_usb_read_status
;
503 /* hook fe: LNB off/on is control by Cypress usb chip. */
504 state
->fe_set_voltage
= adap
->fe
[0]->ops
.set_voltage
;
505 adap
->fe
[0]->ops
.set_voltage
= dvbsky_usb_ci_set_voltage
;
507 state
->i2c_client_tuner
= client_tuner
;
508 state
->i2c_client_ci
= client_ci
;
511 i2c_unregister_device(client_ci
);
513 module_put(client_tuner
->dev
.driver
->owner
);
515 i2c_unregister_device(client_tuner
);
517 dvb_frontend_detach(adap
->fe
[0]);
522 static int dvbsky_t680c_attach(struct dvb_usb_adapter
*adap
)
524 struct dvbsky_state
*state
= adap_to_priv(adap
);
525 struct dvb_usb_device
*d
= adap_to_d(adap
);
527 struct i2c_adapter
*i2c_adapter
;
528 struct i2c_client
*client_demod
, *client_tuner
, *client_ci
;
529 struct i2c_board_info info
;
530 struct si2168_config si2168_config
;
531 struct si2157_config si2157_config
;
532 struct sp2_config sp2_config
;
535 memset(&si2168_config
, 0, sizeof(si2168_config
));
536 si2168_config
.i2c_adapter
= &i2c_adapter
;
537 si2168_config
.fe
= &adap
->fe
[0];
538 si2168_config
.ts_mode
= SI2168_TS_PARALLEL
;
539 memset(&info
, 0, sizeof(struct i2c_board_info
));
540 strlcpy(info
.type
, "si2168", I2C_NAME_SIZE
);
542 info
.platform_data
= &si2168_config
;
544 request_module(info
.type
);
545 client_demod
= i2c_new_device(&d
->i2c_adap
, &info
);
546 if (client_demod
== NULL
||
547 client_demod
->dev
.driver
== NULL
)
548 goto fail_demod_device
;
549 if (!try_module_get(client_demod
->dev
.driver
->owner
))
550 goto fail_demod_module
;
553 memset(&si2157_config
, 0, sizeof(si2157_config
));
554 si2157_config
.fe
= adap
->fe
[0];
555 si2157_config
.if_port
= 1;
556 memset(&info
, 0, sizeof(struct i2c_board_info
));
557 strlcpy(info
.type
, "si2157", I2C_NAME_SIZE
);
559 info
.platform_data
= &si2157_config
;
561 request_module(info
.type
);
562 client_tuner
= i2c_new_device(i2c_adapter
, &info
);
563 if (client_tuner
== NULL
||
564 client_tuner
->dev
.driver
== NULL
)
565 goto fail_tuner_device
;
566 if (!try_module_get(client_tuner
->dev
.driver
->owner
))
567 goto fail_tuner_module
;
569 /* attach ci controller */
570 memset(&sp2_config
, 0, sizeof(sp2_config
));
571 sp2_config
.dvb_adap
= &adap
->dvb_adap
;
573 sp2_config
.ci_control
= dvbsky_ci_ctrl
;
574 memset(&info
, 0, sizeof(struct i2c_board_info
));
575 strlcpy(info
.type
, "sp2", I2C_NAME_SIZE
);
577 info
.platform_data
= &sp2_config
;
579 request_module(info
.type
);
580 client_ci
= i2c_new_device(&d
->i2c_adap
, &info
);
582 if (client_ci
== NULL
|| client_ci
->dev
.driver
== NULL
)
585 if (!try_module_get(client_ci
->dev
.driver
->owner
))
588 state
->i2c_client_demod
= client_demod
;
589 state
->i2c_client_tuner
= client_tuner
;
590 state
->i2c_client_ci
= client_ci
;
593 i2c_unregister_device(client_ci
);
595 module_put(client_tuner
->dev
.driver
->owner
);
597 i2c_unregister_device(client_tuner
);
599 module_put(client_demod
->dev
.driver
->owner
);
601 i2c_unregister_device(client_demod
);
607 static int dvbsky_t330_attach(struct dvb_usb_adapter
*adap
)
609 struct dvbsky_state
*state
= adap_to_priv(adap
);
610 struct dvb_usb_device
*d
= adap_to_d(adap
);
612 struct i2c_adapter
*i2c_adapter
;
613 struct i2c_client
*client_demod
, *client_tuner
;
614 struct i2c_board_info info
;
615 struct si2168_config si2168_config
;
616 struct si2157_config si2157_config
;
619 memset(&si2168_config
, 0, sizeof(si2168_config
));
620 si2168_config
.i2c_adapter
= &i2c_adapter
;
621 si2168_config
.fe
= &adap
->fe
[0];
622 si2168_config
.ts_mode
= SI2168_TS_PARALLEL
;
623 si2168_config
.ts_clock_gapped
= true;
624 memset(&info
, 0, sizeof(struct i2c_board_info
));
625 strlcpy(info
.type
, "si2168", I2C_NAME_SIZE
);
627 info
.platform_data
= &si2168_config
;
629 request_module(info
.type
);
630 client_demod
= i2c_new_device(&d
->i2c_adap
, &info
);
631 if (client_demod
== NULL
||
632 client_demod
->dev
.driver
== NULL
)
633 goto fail_demod_device
;
634 if (!try_module_get(client_demod
->dev
.driver
->owner
))
635 goto fail_demod_module
;
638 memset(&si2157_config
, 0, sizeof(si2157_config
));
639 si2157_config
.fe
= adap
->fe
[0];
640 si2157_config
.if_port
= 1;
641 memset(&info
, 0, sizeof(struct i2c_board_info
));
642 strlcpy(info
.type
, "si2157", I2C_NAME_SIZE
);
644 info
.platform_data
= &si2157_config
;
646 request_module(info
.type
);
647 client_tuner
= i2c_new_device(i2c_adapter
, &info
);
648 if (client_tuner
== NULL
||
649 client_tuner
->dev
.driver
== NULL
)
650 goto fail_tuner_device
;
651 if (!try_module_get(client_tuner
->dev
.driver
->owner
))
652 goto fail_tuner_module
;
654 state
->i2c_client_demod
= client_demod
;
655 state
->i2c_client_tuner
= client_tuner
;
658 i2c_unregister_device(client_tuner
);
660 module_put(client_demod
->dev
.driver
->owner
);
662 i2c_unregister_device(client_demod
);
668 static int dvbsky_identify_state(struct dvb_usb_device
*d
, const char **name
)
670 dvbsky_gpio_ctrl(d
, 0x04, 1);
672 dvbsky_gpio_ctrl(d
, 0x83, 0);
673 dvbsky_gpio_ctrl(d
, 0xc0, 1);
675 dvbsky_gpio_ctrl(d
, 0x83, 1);
676 dvbsky_gpio_ctrl(d
, 0xc0, 0);
682 static int dvbsky_init(struct dvb_usb_device
*d
)
684 struct dvbsky_state
*state
= d_to_priv(d
);
686 /* use default interface */
688 ret = usb_set_interface(d->udev, 0, 0);
692 mutex_init(&state
->stream_mutex
);
694 state
->last_lock
= 0;
699 static void dvbsky_exit(struct dvb_usb_device
*d
)
701 struct dvbsky_state
*state
= d_to_priv(d
);
702 struct i2c_client
*client
;
704 client
= state
->i2c_client_tuner
;
705 /* remove I2C tuner */
707 module_put(client
->dev
.driver
->owner
);
708 i2c_unregister_device(client
);
710 client
= state
->i2c_client_demod
;
711 /* remove I2C demod */
713 module_put(client
->dev
.driver
->owner
);
714 i2c_unregister_device(client
);
716 client
= state
->i2c_client_ci
;
719 module_put(client
->dev
.driver
->owner
);
720 i2c_unregister_device(client
);
724 /* DVB USB Driver stuff */
725 static struct dvb_usb_device_properties dvbsky_s960_props
= {
726 .driver_name
= KBUILD_MODNAME
,
727 .owner
= THIS_MODULE
,
728 .adapter_nr
= adapter_nr
,
729 .size_of_priv
= sizeof(struct dvbsky_state
),
731 .generic_bulk_ctrl_endpoint
= 0x01,
732 .generic_bulk_ctrl_endpoint_response
= 0x81,
733 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
735 .i2c_algo
= &dvbsky_i2c_algo
,
736 .frontend_attach
= dvbsky_s960_attach
,
738 .get_rc_config
= dvbsky_get_rc_config
,
739 .streaming_ctrl
= dvbsky_streaming_ctrl
,
740 .identify_state
= dvbsky_identify_state
,
742 .read_mac_address
= dvbsky_read_mac_addr
,
747 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
752 static struct dvb_usb_device_properties dvbsky_s960c_props
= {
753 .driver_name
= KBUILD_MODNAME
,
754 .owner
= THIS_MODULE
,
755 .adapter_nr
= adapter_nr
,
756 .size_of_priv
= sizeof(struct dvbsky_state
),
758 .generic_bulk_ctrl_endpoint
= 0x01,
759 .generic_bulk_ctrl_endpoint_response
= 0x81,
760 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
762 .i2c_algo
= &dvbsky_i2c_algo
,
763 .frontend_attach
= dvbsky_s960c_attach
,
765 .get_rc_config
= dvbsky_get_rc_config
,
766 .streaming_ctrl
= dvbsky_streaming_ctrl
,
767 .identify_state
= dvbsky_identify_state
,
769 .read_mac_address
= dvbsky_read_mac_addr
,
774 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
779 static struct dvb_usb_device_properties dvbsky_t680c_props
= {
780 .driver_name
= KBUILD_MODNAME
,
781 .owner
= THIS_MODULE
,
782 .adapter_nr
= adapter_nr
,
783 .size_of_priv
= sizeof(struct dvbsky_state
),
785 .generic_bulk_ctrl_endpoint
= 0x01,
786 .generic_bulk_ctrl_endpoint_response
= 0x81,
787 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
789 .i2c_algo
= &dvbsky_i2c_algo
,
790 .frontend_attach
= dvbsky_t680c_attach
,
792 .get_rc_config
= dvbsky_get_rc_config
,
793 .streaming_ctrl
= dvbsky_streaming_ctrl
,
794 .identify_state
= dvbsky_identify_state
,
796 .read_mac_address
= dvbsky_read_mac_addr
,
801 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
806 static struct dvb_usb_device_properties dvbsky_t330_props
= {
807 .driver_name
= KBUILD_MODNAME
,
808 .owner
= THIS_MODULE
,
809 .adapter_nr
= adapter_nr
,
810 .size_of_priv
= sizeof(struct dvbsky_state
),
812 .generic_bulk_ctrl_endpoint
= 0x01,
813 .generic_bulk_ctrl_endpoint_response
= 0x81,
814 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
816 .i2c_algo
= &dvbsky_i2c_algo
,
817 .frontend_attach
= dvbsky_t330_attach
,
819 .get_rc_config
= dvbsky_get_rc_config
,
820 .streaming_ctrl
= dvbsky_streaming_ctrl
,
821 .identify_state
= dvbsky_identify_state
,
823 .read_mac_address
= dvbsky_read_mac_addr
,
828 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
833 static const struct usb_device_id dvbsky_id_table
[] = {
834 { DVB_USB_DEVICE(0x0572, 0x6831,
835 &dvbsky_s960_props
, "DVBSky S960/S860", RC_MAP_DVBSKY
) },
836 { DVB_USB_DEVICE(0x0572, 0x960c,
837 &dvbsky_s960c_props
, "DVBSky S960CI", RC_MAP_DVBSKY
) },
838 { DVB_USB_DEVICE(0x0572, 0x680c,
839 &dvbsky_t680c_props
, "DVBSky T680CI", RC_MAP_DVBSKY
) },
840 { DVB_USB_DEVICE(0x0572, 0x0320,
841 &dvbsky_t330_props
, "DVBSky T330", RC_MAP_DVBSKY
) },
842 { DVB_USB_DEVICE(USB_VID_TECHNOTREND
,
843 USB_PID_TECHNOTREND_TVSTICK_CT2_4400
,
844 &dvbsky_t330_props
, "TechnoTrend TVStick CT2-4400",
846 { DVB_USB_DEVICE(USB_VID_TECHNOTREND
,
847 USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI
,
848 &dvbsky_t680c_props
, "TechnoTrend TT-connect CT2-4650 CI",
850 { DVB_USB_DEVICE(USB_VID_TERRATEC
,
851 USB_PID_TERRATEC_H7_3
,
852 &dvbsky_t680c_props
, "Terratec H7 Rev.4",
856 MODULE_DEVICE_TABLE(usb
, dvbsky_id_table
);
858 static struct usb_driver dvbsky_usb_driver
= {
859 .name
= KBUILD_MODNAME
,
860 .id_table
= dvbsky_id_table
,
861 .probe
= dvb_usbv2_probe
,
862 .disconnect
= dvb_usbv2_disconnect
,
863 .suspend
= dvb_usbv2_suspend
,
864 .resume
= dvb_usbv2_resume
,
865 .reset_resume
= dvb_usbv2_reset_resume
,
870 module_usb_driver(dvbsky_usb_driver
);
872 MODULE_AUTHOR("Max nibble <nibble.max@gmail.com>");
873 MODULE_DESCRIPTION("Driver for DVBSky USB");
874 MODULE_LICENSE("GPL");