1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for DVBSky USB2.0 receiver
5 * Copyright (C) 2013 Max nibble <nibble.max@gmail.com>
15 #define DVBSKY_MSG_DELAY 0/*2000*/
16 #define DVBSKY_BUF_LEN 64
18 static int dvb_usb_dvbsky_disable_rc
;
19 module_param_named(disable_rc
, dvb_usb_dvbsky_disable_rc
, int, 0644);
20 MODULE_PARM_DESC(disable_rc
, "Disable inbuilt IR receiver.");
22 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr
);
25 u8 ibuf
[DVBSKY_BUF_LEN
];
26 u8 obuf
[DVBSKY_BUF_LEN
];
28 struct i2c_client
*i2c_client_demod
;
29 struct i2c_client
*i2c_client_tuner
;
30 struct i2c_client
*i2c_client_ci
;
32 /* fe hook functions*/
33 int (*fe_set_voltage
)(struct dvb_frontend
*fe
,
34 enum fe_sec_voltage voltage
);
35 int (*fe_read_status
)(struct dvb_frontend
*fe
,
36 enum fe_status
*status
);
39 static int dvbsky_usb_generic_rw(struct dvb_usb_device
*d
,
40 u8
*wbuf
, u16 wlen
, u8
*rbuf
, u16 rlen
)
43 struct dvbsky_state
*state
= d_to_priv(d
);
45 mutex_lock(&d
->usb_mutex
);
47 memcpy(state
->obuf
, wbuf
, wlen
);
49 ret
= dvb_usbv2_generic_rw_locked(d
, state
->obuf
, wlen
,
52 if (!ret
&& (rlen
!= 0))
53 memcpy(rbuf
, state
->ibuf
, rlen
);
55 mutex_unlock(&d
->usb_mutex
);
59 static int dvbsky_stream_ctrl(struct dvb_usb_device
*d
, u8 onoff
)
61 struct dvbsky_state
*state
= d_to_priv(d
);
62 static const u8 obuf_pre
[3] = { 0x37, 0, 0 };
63 static const u8 obuf_post
[3] = { 0x36, 3, 0 };
66 mutex_lock(&d
->usb_mutex
);
67 memcpy(state
->obuf
, obuf_pre
, 3);
68 ret
= dvb_usbv2_generic_write_locked(d
, state
->obuf
, 3);
71 memcpy(state
->obuf
, obuf_post
, 3);
72 ret
= dvb_usbv2_generic_write_locked(d
, state
->obuf
, 3);
74 mutex_unlock(&d
->usb_mutex
);
78 static int dvbsky_streaming_ctrl(struct dvb_frontend
*fe
, int onoff
)
80 struct dvb_usb_device
*d
= fe_to_d(fe
);
82 return dvbsky_stream_ctrl(d
, (onoff
== 0) ? 0 : 1);
86 static int dvbsky_gpio_ctrl(struct dvb_usb_device
*d
, u8 gport
, u8 value
)
94 ret
= dvbsky_usb_generic_rw(d
, obuf
, 3, ibuf
, 1);
99 static int dvbsky_i2c_xfer(struct i2c_adapter
*adap
, struct i2c_msg msg
[],
102 struct dvb_usb_device
*d
= i2c_get_adapdata(adap
);
104 u8 ibuf
[64], obuf
[64];
106 if (mutex_lock_interruptible(&d
->i2c_mutex
) < 0)
110 dev_err(&d
->udev
->dev
,
111 "too many i2c messages[%d], max 2.", num
);
117 if (msg
[0].len
> 60) {
118 dev_err(&d
->udev
->dev
,
119 "too many i2c bytes[%d], max 60.",
124 if (msg
[0].flags
& I2C_M_RD
) {
128 obuf
[2] = msg
[0].len
;
129 obuf
[3] = msg
[0].addr
;
130 ret
= dvbsky_usb_generic_rw(d
, obuf
, 4,
131 ibuf
, msg
[0].len
+ 1);
133 memcpy(msg
[0].buf
, &ibuf
[1], msg
[0].len
);
137 obuf
[1] = msg
[0].addr
;
138 obuf
[2] = msg
[0].len
;
139 memcpy(&obuf
[3], msg
[0].buf
, msg
[0].len
);
140 ret
= dvbsky_usb_generic_rw(d
, obuf
,
141 msg
[0].len
+ 3, ibuf
, 1);
144 if ((msg
[0].len
> 60) || (msg
[1].len
> 60)) {
145 dev_err(&d
->udev
->dev
,
146 "too many i2c bytes[w-%d][r-%d], max 60.",
147 msg
[0].len
, msg
[1].len
);
151 /* write then read */
153 obuf
[1] = msg
[0].len
;
154 obuf
[2] = msg
[1].len
;
155 obuf
[3] = msg
[0].addr
;
156 memcpy(&obuf
[4], msg
[0].buf
, msg
[0].len
);
157 ret
= dvbsky_usb_generic_rw(d
, obuf
,
158 msg
[0].len
+ 4, ibuf
, msg
[1].len
+ 1);
160 memcpy(msg
[1].buf
, &ibuf
[1], msg
[1].len
);
163 mutex_unlock(&d
->i2c_mutex
);
164 return (ret
) ? ret
: num
;
167 static u32
dvbsky_i2c_func(struct i2c_adapter
*adapter
)
172 static struct i2c_algorithm dvbsky_i2c_algo
= {
173 .master_xfer
= dvbsky_i2c_xfer
,
174 .functionality
= dvbsky_i2c_func
,
177 #if IS_ENABLED(CONFIG_RC_CORE)
178 static int dvbsky_rc_query(struct dvb_usb_device
*d
)
180 u32 code
= 0xffff, scancode
;
181 u8 rc5_command
, rc5_system
;
182 u8 obuf
[2], ibuf
[2], toggle
;
186 ret
= dvbsky_usb_generic_rw(d
, obuf
, 1, ibuf
, 2);
188 code
= (ibuf
[0] << 8) | ibuf
[1];
189 if (code
!= 0xffff) {
190 dev_dbg(&d
->udev
->dev
, "rc code: %x\n", code
);
191 rc5_command
= code
& 0x3F;
192 rc5_system
= (code
& 0x7C0) >> 6;
193 toggle
= (code
& 0x800) ? 1 : 0;
194 scancode
= rc5_system
<< 8 | rc5_command
;
195 rc_keydown(d
->rc_dev
, RC_PROTO_RC5
, scancode
, toggle
);
200 static int dvbsky_get_rc_config(struct dvb_usb_device
*d
, struct dvb_usb_rc
*rc
)
202 if (dvb_usb_dvbsky_disable_rc
) {
207 rc
->allowed_protos
= RC_PROTO_BIT_RC5
;
208 rc
->query
= dvbsky_rc_query
;
213 #define dvbsky_get_rc_config NULL
216 static int dvbsky_usb_set_voltage(struct dvb_frontend
*fe
,
217 enum fe_sec_voltage voltage
)
219 struct dvb_usb_device
*d
= fe_to_d(fe
);
220 struct dvbsky_state
*state
= d_to_priv(d
);
223 if (voltage
== SEC_VOLTAGE_OFF
)
227 dvbsky_gpio_ctrl(d
, 0x80, value
);
229 return state
->fe_set_voltage(fe
, voltage
);
232 static int dvbsky_read_mac_addr(struct dvb_usb_adapter
*adap
, u8 mac
[6])
234 struct dvb_usb_device
*d
= adap_to_d(adap
);
235 u8 obuf
[] = { 0x1e, 0x00 };
237 struct i2c_msg msg
[] = {
251 if (i2c_transfer(&d
->i2c_adap
, msg
, 2) == 2)
252 memcpy(mac
, ibuf
, 6);
257 static int dvbsky_usb_read_status(struct dvb_frontend
*fe
,
258 enum fe_status
*status
)
260 struct dvb_usb_device
*d
= fe_to_d(fe
);
261 struct dvbsky_state
*state
= d_to_priv(d
);
264 ret
= state
->fe_read_status(fe
, status
);
266 /* it need resync slave fifo when signal change from unlock to lock.*/
267 if ((*status
& FE_HAS_LOCK
) && (!state
->last_lock
))
268 dvbsky_stream_ctrl(d
, 1);
270 state
->last_lock
= (*status
& FE_HAS_LOCK
) ? 1 : 0;
274 static int dvbsky_s960_attach(struct dvb_usb_adapter
*adap
)
276 struct dvbsky_state
*state
= adap_to_priv(adap
);
277 struct dvb_usb_device
*d
= adap_to_d(adap
);
278 struct i2c_adapter
*i2c_adapter
;
279 struct m88ds3103_platform_data m88ds3103_pdata
= {};
280 struct ts2020_config ts2020_config
= {};
283 m88ds3103_pdata
.clk
= 27000000;
284 m88ds3103_pdata
.i2c_wr_max
= 33;
285 m88ds3103_pdata
.clk_out
= 0;
286 m88ds3103_pdata
.ts_mode
= M88DS3103_TS_CI
;
287 m88ds3103_pdata
.ts_clk
= 16000;
288 m88ds3103_pdata
.ts_clk_pol
= 0;
289 m88ds3103_pdata
.agc
= 0x99;
290 m88ds3103_pdata
.lnb_hv_pol
= 1,
291 m88ds3103_pdata
.lnb_en_pol
= 1,
293 state
->i2c_client_demod
= dvb_module_probe("m88ds3103", NULL
,
295 0x68, &m88ds3103_pdata
);
296 if (!state
->i2c_client_demod
)
299 adap
->fe
[0] = m88ds3103_pdata
.get_dvb_frontend(state
->i2c_client_demod
);
300 i2c_adapter
= m88ds3103_pdata
.get_i2c_adapter(state
->i2c_client_demod
);
303 ts2020_config
.fe
= adap
->fe
[0];
304 ts2020_config
.get_agc_pwm
= m88ds3103_get_agc_pwm
;
306 state
->i2c_client_tuner
= dvb_module_probe("ts2020", NULL
,
308 0x60, &ts2020_config
);
309 if (!state
->i2c_client_tuner
) {
310 dvb_module_release(state
->i2c_client_demod
);
314 /* delegate signal strength measurement to tuner */
315 adap
->fe
[0]->ops
.read_signal_strength
=
316 adap
->fe
[0]->ops
.tuner_ops
.get_rf_strength
;
318 /* hook fe: need to resync the slave fifo when signal locks. */
319 state
->fe_read_status
= adap
->fe
[0]->ops
.read_status
;
320 adap
->fe
[0]->ops
.read_status
= dvbsky_usb_read_status
;
322 /* hook fe: LNB off/on is control by Cypress usb chip. */
323 state
->fe_set_voltage
= adap
->fe
[0]->ops
.set_voltage
;
324 adap
->fe
[0]->ops
.set_voltage
= dvbsky_usb_set_voltage
;
329 static int dvbsky_usb_ci_set_voltage(struct dvb_frontend
*fe
,
330 enum fe_sec_voltage voltage
)
332 struct dvb_usb_device
*d
= fe_to_d(fe
);
333 struct dvbsky_state
*state
= d_to_priv(d
);
336 if (voltage
== SEC_VOLTAGE_OFF
)
340 dvbsky_gpio_ctrl(d
, 0x00, value
);
342 return state
->fe_set_voltage(fe
, voltage
);
345 static int dvbsky_ci_ctrl(void *priv
, u8 read
, int addr
,
348 struct dvb_usb_device
*d
= priv
;
350 u8 command
[4], respond
[2], command_size
, respond_size
;
352 command
[1] = (u8
)((addr
>> 8) & 0xff); /*high part of address*/
353 command
[2] = (u8
)(addr
& 0xff); /*low part of address*/
364 ret
= dvbsky_usb_generic_rw(d
, command
, command_size
,
365 respond
, respond_size
);
372 dev_err(&d
->udev
->dev
, "ci control failed=%d\n", ret
);
376 static int dvbsky_s960c_attach(struct dvb_usb_adapter
*adap
)
378 struct dvbsky_state
*state
= adap_to_priv(adap
);
379 struct dvb_usb_device
*d
= adap_to_d(adap
);
380 struct i2c_adapter
*i2c_adapter
;
381 struct m88ds3103_platform_data m88ds3103_pdata
= {};
382 struct ts2020_config ts2020_config
= {};
383 struct sp2_config sp2_config
= {};
386 m88ds3103_pdata
.clk
= 27000000,
387 m88ds3103_pdata
.i2c_wr_max
= 33,
388 m88ds3103_pdata
.clk_out
= 0,
389 m88ds3103_pdata
.ts_mode
= M88DS3103_TS_CI
,
390 m88ds3103_pdata
.ts_clk
= 10000,
391 m88ds3103_pdata
.ts_clk_pol
= 1,
392 m88ds3103_pdata
.agc
= 0x99,
393 m88ds3103_pdata
.lnb_hv_pol
= 0,
394 m88ds3103_pdata
.lnb_en_pol
= 1,
396 state
->i2c_client_demod
= dvb_module_probe("m88ds3103", NULL
,
398 0x68, &m88ds3103_pdata
);
399 if (!state
->i2c_client_demod
)
402 adap
->fe
[0] = m88ds3103_pdata
.get_dvb_frontend(state
->i2c_client_demod
);
403 i2c_adapter
= m88ds3103_pdata
.get_i2c_adapter(state
->i2c_client_demod
);
406 ts2020_config
.fe
= adap
->fe
[0];
407 ts2020_config
.get_agc_pwm
= m88ds3103_get_agc_pwm
;
409 state
->i2c_client_tuner
= dvb_module_probe("ts2020", NULL
,
411 0x60, &ts2020_config
);
412 if (!state
->i2c_client_tuner
) {
413 dvb_module_release(state
->i2c_client_demod
);
417 /* attach ci controller */
418 sp2_config
.dvb_adap
= &adap
->dvb_adap
;
420 sp2_config
.ci_control
= dvbsky_ci_ctrl
;
422 state
->i2c_client_ci
= dvb_module_probe("sp2", NULL
,
426 if (!state
->i2c_client_ci
) {
427 dvb_module_release(state
->i2c_client_tuner
);
428 dvb_module_release(state
->i2c_client_demod
);
432 /* delegate signal strength measurement to tuner */
433 adap
->fe
[0]->ops
.read_signal_strength
=
434 adap
->fe
[0]->ops
.tuner_ops
.get_rf_strength
;
436 /* hook fe: need to resync the slave fifo when signal locks. */
437 state
->fe_read_status
= adap
->fe
[0]->ops
.read_status
;
438 adap
->fe
[0]->ops
.read_status
= dvbsky_usb_read_status
;
440 /* hook fe: LNB off/on is control by Cypress usb chip. */
441 state
->fe_set_voltage
= adap
->fe
[0]->ops
.set_voltage
;
442 adap
->fe
[0]->ops
.set_voltage
= dvbsky_usb_ci_set_voltage
;
447 static int dvbsky_t680c_attach(struct dvb_usb_adapter
*adap
)
449 struct dvbsky_state
*state
= adap_to_priv(adap
);
450 struct dvb_usb_device
*d
= adap_to_d(adap
);
451 struct i2c_adapter
*i2c_adapter
;
452 struct si2168_config si2168_config
= {};
453 struct si2157_config si2157_config
= {};
454 struct sp2_config sp2_config
= {};
457 si2168_config
.i2c_adapter
= &i2c_adapter
;
458 si2168_config
.fe
= &adap
->fe
[0];
459 si2168_config
.ts_mode
= SI2168_TS_PARALLEL
;
461 state
->i2c_client_demod
= dvb_module_probe("si2168", NULL
,
463 0x64, &si2168_config
);
464 if (!state
->i2c_client_demod
)
468 si2157_config
.fe
= adap
->fe
[0];
469 si2157_config
.if_port
= 1;
471 state
->i2c_client_tuner
= dvb_module_probe("si2157", NULL
,
473 0x60, &si2157_config
);
474 if (!state
->i2c_client_tuner
) {
475 dvb_module_release(state
->i2c_client_demod
);
479 /* attach ci controller */
480 sp2_config
.dvb_adap
= &adap
->dvb_adap
;
482 sp2_config
.ci_control
= dvbsky_ci_ctrl
;
484 state
->i2c_client_ci
= dvb_module_probe("sp2", NULL
,
488 if (!state
->i2c_client_ci
) {
489 dvb_module_release(state
->i2c_client_tuner
);
490 dvb_module_release(state
->i2c_client_demod
);
497 static int dvbsky_t330_attach(struct dvb_usb_adapter
*adap
)
499 struct dvbsky_state
*state
= adap_to_priv(adap
);
500 struct dvb_usb_device
*d
= adap_to_d(adap
);
501 struct i2c_adapter
*i2c_adapter
;
502 struct si2168_config si2168_config
= {};
503 struct si2157_config si2157_config
= {};
506 si2168_config
.i2c_adapter
= &i2c_adapter
;
507 si2168_config
.fe
= &adap
->fe
[0];
508 si2168_config
.ts_mode
= SI2168_TS_PARALLEL
;
509 si2168_config
.ts_clock_gapped
= true;
511 state
->i2c_client_demod
= dvb_module_probe("si2168", NULL
,
513 0x64, &si2168_config
);
514 if (!state
->i2c_client_demod
)
518 si2157_config
.fe
= adap
->fe
[0];
519 si2157_config
.if_port
= 1;
521 state
->i2c_client_tuner
= dvb_module_probe("si2157", NULL
,
523 0x60, &si2157_config
);
524 if (!state
->i2c_client_tuner
) {
525 dvb_module_release(state
->i2c_client_demod
);
532 static int dvbsky_mygica_t230c_attach(struct dvb_usb_adapter
*adap
)
534 struct dvbsky_state
*state
= adap_to_priv(adap
);
535 struct dvb_usb_device
*d
= adap_to_d(adap
);
536 struct i2c_adapter
*i2c_adapter
;
537 struct si2168_config si2168_config
= {};
538 struct si2157_config si2157_config
= {};
541 si2168_config
.i2c_adapter
= &i2c_adapter
;
542 si2168_config
.fe
= &adap
->fe
[0];
543 si2168_config
.ts_mode
= SI2168_TS_PARALLEL
;
544 if (le16_to_cpu(d
->udev
->descriptor
.idProduct
) == USB_PID_MYGICA_T230C2
)
545 si2168_config
.ts_mode
|= SI2168_TS_CLK_MANUAL
;
546 si2168_config
.ts_clock_inv
= 1;
548 state
->i2c_client_demod
= dvb_module_probe("si2168", NULL
,
550 0x64, &si2168_config
);
551 if (!state
->i2c_client_demod
)
555 si2157_config
.fe
= adap
->fe
[0];
556 if (le16_to_cpu(d
->udev
->descriptor
.idProduct
) == USB_PID_MYGICA_T230
) {
557 si2157_config
.if_port
= 1;
558 state
->i2c_client_tuner
= dvb_module_probe("si2157", NULL
,
563 si2157_config
.if_port
= 0;
564 state
->i2c_client_tuner
= dvb_module_probe("si2157", "si2141",
569 if (!state
->i2c_client_tuner
) {
570 dvb_module_release(state
->i2c_client_demod
);
578 static int dvbsky_identify_state(struct dvb_usb_device
*d
, const char **name
)
580 dvbsky_gpio_ctrl(d
, 0x04, 1);
582 dvbsky_gpio_ctrl(d
, 0x83, 0);
583 dvbsky_gpio_ctrl(d
, 0xc0, 1);
585 dvbsky_gpio_ctrl(d
, 0x83, 1);
586 dvbsky_gpio_ctrl(d
, 0xc0, 0);
592 static int dvbsky_init(struct dvb_usb_device
*d
)
594 struct dvbsky_state
*state
= d_to_priv(d
);
595 state
->last_lock
= 0;
599 static int dvbsky_frontend_detach(struct dvb_usb_adapter
*adap
)
601 struct dvb_usb_device
*d
= adap_to_d(adap
);
602 struct dvbsky_state
*state
= d_to_priv(d
);
604 dev_dbg(&d
->udev
->dev
, "%s: adap=%d\n", __func__
, adap
->id
);
606 dvb_module_release(state
->i2c_client_tuner
);
607 dvb_module_release(state
->i2c_client_demod
);
608 dvb_module_release(state
->i2c_client_ci
);
613 /* DVB USB Driver stuff */
614 static struct dvb_usb_device_properties dvbsky_s960_props
= {
615 .driver_name
= KBUILD_MODNAME
,
616 .owner
= THIS_MODULE
,
617 .adapter_nr
= adapter_nr
,
618 .size_of_priv
= sizeof(struct dvbsky_state
),
620 .generic_bulk_ctrl_endpoint
= 0x01,
621 .generic_bulk_ctrl_endpoint_response
= 0x81,
622 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
624 .i2c_algo
= &dvbsky_i2c_algo
,
625 .frontend_attach
= dvbsky_s960_attach
,
626 .frontend_detach
= dvbsky_frontend_detach
,
628 .get_rc_config
= dvbsky_get_rc_config
,
629 .streaming_ctrl
= dvbsky_streaming_ctrl
,
630 .identify_state
= dvbsky_identify_state
,
631 .read_mac_address
= dvbsky_read_mac_addr
,
636 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
641 static struct dvb_usb_device_properties dvbsky_s960c_props
= {
642 .driver_name
= KBUILD_MODNAME
,
643 .owner
= THIS_MODULE
,
644 .adapter_nr
= adapter_nr
,
645 .size_of_priv
= sizeof(struct dvbsky_state
),
647 .generic_bulk_ctrl_endpoint
= 0x01,
648 .generic_bulk_ctrl_endpoint_response
= 0x81,
649 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
651 .i2c_algo
= &dvbsky_i2c_algo
,
652 .frontend_attach
= dvbsky_s960c_attach
,
653 .frontend_detach
= dvbsky_frontend_detach
,
655 .get_rc_config
= dvbsky_get_rc_config
,
656 .streaming_ctrl
= dvbsky_streaming_ctrl
,
657 .identify_state
= dvbsky_identify_state
,
658 .read_mac_address
= dvbsky_read_mac_addr
,
663 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
668 static struct dvb_usb_device_properties dvbsky_t680c_props
= {
669 .driver_name
= KBUILD_MODNAME
,
670 .owner
= THIS_MODULE
,
671 .adapter_nr
= adapter_nr
,
672 .size_of_priv
= sizeof(struct dvbsky_state
),
674 .generic_bulk_ctrl_endpoint
= 0x01,
675 .generic_bulk_ctrl_endpoint_response
= 0x81,
676 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
678 .i2c_algo
= &dvbsky_i2c_algo
,
679 .frontend_attach
= dvbsky_t680c_attach
,
680 .frontend_detach
= dvbsky_frontend_detach
,
682 .get_rc_config
= dvbsky_get_rc_config
,
683 .streaming_ctrl
= dvbsky_streaming_ctrl
,
684 .identify_state
= dvbsky_identify_state
,
685 .read_mac_address
= dvbsky_read_mac_addr
,
690 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
695 static struct dvb_usb_device_properties dvbsky_t330_props
= {
696 .driver_name
= KBUILD_MODNAME
,
697 .owner
= THIS_MODULE
,
698 .adapter_nr
= adapter_nr
,
699 .size_of_priv
= sizeof(struct dvbsky_state
),
701 .generic_bulk_ctrl_endpoint
= 0x01,
702 .generic_bulk_ctrl_endpoint_response
= 0x81,
703 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
705 .i2c_algo
= &dvbsky_i2c_algo
,
706 .frontend_attach
= dvbsky_t330_attach
,
707 .frontend_detach
= dvbsky_frontend_detach
,
709 .get_rc_config
= dvbsky_get_rc_config
,
710 .streaming_ctrl
= dvbsky_streaming_ctrl
,
711 .identify_state
= dvbsky_identify_state
,
712 .read_mac_address
= dvbsky_read_mac_addr
,
717 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
722 static struct dvb_usb_device_properties mygica_t230c_props
= {
723 .driver_name
= KBUILD_MODNAME
,
724 .owner
= THIS_MODULE
,
725 .adapter_nr
= adapter_nr
,
726 .size_of_priv
= sizeof(struct dvbsky_state
),
728 .generic_bulk_ctrl_endpoint
= 0x01,
729 .generic_bulk_ctrl_endpoint_response
= 0x81,
730 .generic_bulk_ctrl_delay
= DVBSKY_MSG_DELAY
,
732 .i2c_algo
= &dvbsky_i2c_algo
,
733 .frontend_attach
= dvbsky_mygica_t230c_attach
,
734 .frontend_detach
= dvbsky_frontend_detach
,
736 .get_rc_config
= dvbsky_get_rc_config
,
737 .streaming_ctrl
= dvbsky_streaming_ctrl
,
738 .identify_state
= dvbsky_identify_state
,
743 .stream
= DVB_USB_STREAM_BULK(0x82, 8, 4096),
748 static const struct usb_device_id dvbsky_id_table
[] = {
749 { DVB_USB_DEVICE(0x0572, 0x6831,
750 &dvbsky_s960_props
, "DVBSky S960/S860", RC_MAP_DVBSKY
) },
751 { DVB_USB_DEVICE(0x0572, 0x960c,
752 &dvbsky_s960c_props
, "DVBSky S960CI", RC_MAP_DVBSKY
) },
753 { DVB_USB_DEVICE(0x0572, 0x680c,
754 &dvbsky_t680c_props
, "DVBSky T680CI", RC_MAP_DVBSKY
) },
755 { DVB_USB_DEVICE(0x0572, 0x0320,
756 &dvbsky_t330_props
, "DVBSky T330", RC_MAP_DVBSKY
) },
757 { DVB_USB_DEVICE(USB_VID_TECHNOTREND
,
758 USB_PID_TECHNOTREND_TVSTICK_CT2_4400
,
759 &dvbsky_t330_props
, "TechnoTrend TVStick CT2-4400",
761 { DVB_USB_DEVICE(USB_VID_TECHNOTREND
,
762 USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI
,
763 &dvbsky_t680c_props
, "TechnoTrend TT-connect CT2-4650 CI",
765 { DVB_USB_DEVICE(USB_VID_TECHNOTREND
,
766 USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI_2
,
767 &dvbsky_t680c_props
, "TechnoTrend TT-connect CT2-4650 CI v1.1",
769 { DVB_USB_DEVICE(USB_VID_TECHNOTREND
,
770 USB_PID_TECHNOTREND_CONNECT_S2_4650_CI
,
771 &dvbsky_s960c_props
, "TechnoTrend TT-connect S2-4650 CI",
773 { DVB_USB_DEVICE(USB_VID_TERRATEC
,
774 USB_PID_TERRATEC_H7_3
,
775 &dvbsky_t680c_props
, "Terratec H7 Rev.4",
777 { DVB_USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_S2_R4
,
778 &dvbsky_s960_props
, "Terratec Cinergy S2 Rev.4",
780 { DVB_USB_DEVICE(USB_VID_CONEXANT
, USB_PID_MYGICA_T230
,
781 &mygica_t230c_props
, "MyGica Mini DVB-T2 USB Stick T230",
782 RC_MAP_TOTAL_MEDIA_IN_HAND_02
) },
783 { DVB_USB_DEVICE(USB_VID_CONEXANT
, USB_PID_MYGICA_T230C
,
784 &mygica_t230c_props
, "MyGica Mini DVB-T2 USB Stick T230C",
785 RC_MAP_TOTAL_MEDIA_IN_HAND_02
) },
786 { DVB_USB_DEVICE(USB_VID_CONEXANT
, USB_PID_MYGICA_T230C_LITE
,
787 &mygica_t230c_props
, "MyGica Mini DVB-T2 USB Stick T230C Lite",
789 { DVB_USB_DEVICE(USB_VID_CONEXANT
, USB_PID_MYGICA_T230C2
,
790 &mygica_t230c_props
, "MyGica Mini DVB-T2 USB Stick T230C v2",
791 RC_MAP_TOTAL_MEDIA_IN_HAND_02
) },
794 MODULE_DEVICE_TABLE(usb
, dvbsky_id_table
);
796 static struct usb_driver dvbsky_usb_driver
= {
797 .name
= KBUILD_MODNAME
,
798 .id_table
= dvbsky_id_table
,
799 .probe
= dvb_usbv2_probe
,
800 .disconnect
= dvb_usbv2_disconnect
,
801 .suspend
= dvb_usbv2_suspend
,
802 .resume
= dvb_usbv2_resume
,
803 .reset_resume
= dvb_usbv2_reset_resume
,
808 module_usb_driver(dvbsky_usb_driver
);
810 MODULE_AUTHOR("Max nibble <nibble.max@gmail.com>");
811 MODULE_DESCRIPTION("Driver for DVBSky USB");
812 MODULE_LICENSE("GPL");