2 * Driver for AzureWave 6007 DVB-C/T USB2.0 and clones
4 * Copyright (c) Henry Wang <Henry.wang@AzureWave.com>
6 * This driver was made publicly available by Terratec, at:
7 * http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz
8 * The original driver's license is GPL, as declared with MODULE_LICENSE()
10 * Copyright (c) 2010-2012 Mauro Carvalho Chehab
11 * Driver modified by in order to work with upstream drxk driver, and
12 * tons of bugs got fixed, and converted to use dvb-usb-v2.
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation under version 2 of the License.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
26 #include <media/dvb_ca_en50221.h>
28 #include "cypress_firmware.h"
30 #define AZ6007_FIRMWARE "dvb-usb-terratec-h7-az6007.fw"
32 static int az6007_xfer_debug
;
33 module_param_named(xfer_debug
, az6007_xfer_debug
, int, 0644);
34 MODULE_PARM_DESC(xfer_debug
, "Enable xfer debug");
36 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr
);
38 /* Known requests (Cypress FX2 firmware + az6007 "private" ones*/
41 #define AZ6007_READ_DATA 0xb7
42 #define AZ6007_I2C_RD 0xb9
43 #define AZ6007_POWER 0xbc
44 #define AZ6007_I2C_WR 0xbd
45 #define FX2_SCON1 0xc0
46 #define AZ6007_TS_THROUGH 0xc7
47 #define AZ6007_READ_IR 0xb4
49 struct az6007_device_state
{
51 struct mutex ca_mutex
;
52 struct dvb_ca_en50221 ca
;
54 int (*gate_ctrl
) (struct dvb_frontend
*, int);
55 unsigned char data
[4096];
58 static struct drxk_config terratec_h7_drxk
= {
62 .single_master
= true,
63 .enable_merr_cfg
= true,
64 .no_i2c_bridge
= false,
66 .mpeg_out_clk_strength
= 0x02,
67 .qam_demod_parameter_count
= 2,
68 .microcode_name
= "dvb-usb-terratec-h7-drxk.fw",
71 static struct drxk_config cablestar_hdci_drxk
= {
75 .single_master
= true,
76 .enable_merr_cfg
= true,
77 .no_i2c_bridge
= false,
79 .mpeg_out_clk_strength
= 0x02,
80 .qam_demod_parameter_count
= 2,
81 .microcode_name
= "dvb-usb-technisat-cablestar-hdci-drxk.fw",
84 static int drxk_gate_ctrl(struct dvb_frontend
*fe
, int enable
)
86 struct az6007_device_state
*st
= fe_to_priv(fe
);
87 struct dvb_usb_adapter
*adap
= fe
->sec_priv
;
90 pr_debug("%s: %s\n", __func__
, enable
? "enable" : "disable");
96 status
= st
->gate_ctrl(fe
, 1);
98 status
= st
->gate_ctrl(fe
, 0);
103 static struct mt2063_config az6007_mt2063_config
= {
104 .tuner_address
= 0x60,
105 .refclock
= 36125000,
108 static int __az6007_read(struct usb_device
*udev
, u8 req
, u16 value
,
109 u16 index
, u8
*b
, int blen
)
113 ret
= usb_control_msg(udev
,
114 usb_rcvctrlpipe(udev
, 0),
116 USB_TYPE_VENDOR
| USB_DIR_IN
,
117 value
, index
, b
, blen
, 5000);
119 pr_warn("usb read operation failed. (%d)\n", ret
);
123 if (az6007_xfer_debug
) {
124 printk(KERN_DEBUG
"az6007: IN req: %02x, value: %04x, index: %04x\n",
126 print_hex_dump_bytes("az6007: payload: ",
127 DUMP_PREFIX_NONE
, b
, blen
);
133 static int az6007_read(struct dvb_usb_device
*d
, u8 req
, u16 value
,
134 u16 index
, u8
*b
, int blen
)
136 struct az6007_device_state
*st
= d
->priv
;
139 if (mutex_lock_interruptible(&st
->mutex
) < 0)
142 ret
= __az6007_read(d
->udev
, req
, value
, index
, b
, blen
);
144 mutex_unlock(&st
->mutex
);
149 static int __az6007_write(struct usb_device
*udev
, u8 req
, u16 value
,
150 u16 index
, u8
*b
, int blen
)
154 if (az6007_xfer_debug
) {
155 printk(KERN_DEBUG
"az6007: OUT req: %02x, value: %04x, index: %04x\n",
157 print_hex_dump_bytes("az6007: payload: ",
158 DUMP_PREFIX_NONE
, b
, blen
);
162 pr_err("az6007: tried to write %d bytes, but I2C max size is 64 bytes\n",
167 ret
= usb_control_msg(udev
,
168 usb_sndctrlpipe(udev
, 0),
170 USB_TYPE_VENDOR
| USB_DIR_OUT
,
171 value
, index
, b
, blen
, 5000);
173 pr_err("usb write operation failed. (%d)\n", ret
);
180 static int az6007_write(struct dvb_usb_device
*d
, u8 req
, u16 value
,
181 u16 index
, u8
*b
, int blen
)
183 struct az6007_device_state
*st
= d
->priv
;
186 if (mutex_lock_interruptible(&st
->mutex
) < 0)
189 ret
= __az6007_write(d
->udev
, req
, value
, index
, b
, blen
);
191 mutex_unlock(&st
->mutex
);
196 static int az6007_streaming_ctrl(struct dvb_frontend
*fe
, int onoff
)
198 struct dvb_usb_device
*d
= fe_to_d(fe
);
200 pr_debug("%s: %s\n", __func__
, onoff
? "enable" : "disable");
202 return az6007_write(d
, 0xbc, onoff
, 0, NULL
, 0);
205 #if IS_ENABLED(CONFIG_RC_CORE)
206 /* remote control stuff (does not work with my box) */
207 static int az6007_rc_query(struct dvb_usb_device
*d
)
209 struct az6007_device_state
*st
= d_to_priv(d
);
213 az6007_read(d
, AZ6007_READ_IR
, 0, 0, st
->data
, 10);
215 if (st
->data
[1] == 0x44)
218 if ((st
->data
[3] ^ st
->data
[4]) == 0xff) {
219 if ((st
->data
[1] ^ st
->data
[2]) == 0xff) {
220 code
= RC_SCANCODE_NEC(st
->data
[1], st
->data
[3]);
221 proto
= RC_PROTO_NEC
;
223 code
= RC_SCANCODE_NECX(st
->data
[1] << 8 | st
->data
[2],
225 proto
= RC_PROTO_NECX
;
228 code
= RC_SCANCODE_NEC32(st
->data
[1] << 24 |
232 proto
= RC_PROTO_NEC32
;
235 rc_keydown(d
->rc_dev
, proto
, code
, st
->data
[5]);
240 static int az6007_get_rc_config(struct dvb_usb_device
*d
, struct dvb_usb_rc
*rc
)
242 pr_debug("Getting az6007 Remote Control properties\n");
244 rc
->allowed_protos
= RC_PROTO_BIT_NEC
| RC_PROTO_BIT_NECX
|
246 rc
->query
= az6007_rc_query
;
252 #define az6007_get_rc_config NULL
255 static int az6007_ci_read_attribute_mem(struct dvb_ca_en50221
*ca
,
259 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
260 struct az6007_device_state
*state
= d_to_priv(d
);
272 b
= kmalloc(12, GFP_KERNEL
);
276 mutex_lock(&state
->ca_mutex
);
283 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
285 pr_warn("usb in operation failed. (%d)\n", ret
);
291 mutex_unlock(&state
->ca_mutex
);
296 static int az6007_ci_write_attribute_mem(struct dvb_ca_en50221
*ca
,
301 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
302 struct az6007_device_state
*state
= d_to_priv(d
);
310 pr_debug("%s(), slot %d\n", __func__
, slot
);
314 mutex_lock(&state
->ca_mutex
);
320 ret
= az6007_write(d
, req
, value1
, index
, NULL
, blen
);
322 pr_warn("usb out operation failed. (%d)\n", ret
);
324 mutex_unlock(&state
->ca_mutex
);
328 static int az6007_ci_read_cam_control(struct dvb_ca_en50221
*ca
,
332 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
333 struct az6007_device_state
*state
= d_to_priv(d
);
345 b
= kmalloc(12, GFP_KERNEL
);
349 mutex_lock(&state
->ca_mutex
);
356 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
358 pr_warn("usb in operation failed. (%d)\n", ret
);
362 pr_warn("Read CI IO error\n");
365 pr_debug("read cam data = %x from 0x%x\n", b
[1], value
);
368 mutex_unlock(&state
->ca_mutex
);
373 static int az6007_ci_write_cam_control(struct dvb_ca_en50221
*ca
,
378 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
379 struct az6007_device_state
*state
= d_to_priv(d
);
390 mutex_lock(&state
->ca_mutex
);
396 ret
= az6007_write(d
, req
, value1
, index
, NULL
, blen
);
398 pr_warn("usb out operation failed. (%d)\n", ret
);
403 mutex_unlock(&state
->ca_mutex
);
407 static int CI_CamReady(struct dvb_ca_en50221
*ca
, int slot
)
409 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
418 b
= kmalloc(12, GFP_KERNEL
);
427 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
429 pr_warn("usb in operation failed. (%d)\n", ret
);
438 static int az6007_ci_slot_reset(struct dvb_ca_en50221
*ca
, int slot
)
440 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
441 struct az6007_device_state
*state
= d_to_priv(d
);
449 mutex_lock(&state
->ca_mutex
);
456 ret
= az6007_write(d
, req
, value
, index
, NULL
, blen
);
458 pr_warn("usb out operation failed. (%d)\n", ret
);
468 ret
= az6007_write(d
, req
, value
, index
, NULL
, blen
);
470 pr_warn("usb out operation failed. (%d)\n", ret
);
474 for (i
= 0; i
< 15; i
++) {
477 if (CI_CamReady(ca
, slot
)) {
478 pr_debug("CAM Ready\n");
485 mutex_unlock(&state
->ca_mutex
);
489 static int az6007_ci_slot_shutdown(struct dvb_ca_en50221
*ca
, int slot
)
494 static int az6007_ci_slot_ts_enable(struct dvb_ca_en50221
*ca
, int slot
)
496 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
497 struct az6007_device_state
*state
= d_to_priv(d
);
505 pr_debug("%s()\n", __func__
);
506 mutex_lock(&state
->ca_mutex
);
512 ret
= az6007_write(d
, req
, value
, index
, NULL
, blen
);
514 pr_warn("usb out operation failed. (%d)\n", ret
);
519 mutex_unlock(&state
->ca_mutex
);
523 static int az6007_ci_poll_slot_status(struct dvb_ca_en50221
*ca
, int slot
, int open
)
525 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
526 struct az6007_device_state
*state
= d_to_priv(d
);
534 b
= kmalloc(12, GFP_KERNEL
);
537 mutex_lock(&state
->ca_mutex
);
544 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
546 pr_warn("usb in operation failed. (%d)\n", ret
);
551 if (!ret
&& b
[0] == 1) {
552 ret
= DVB_CA_EN50221_POLL_CAM_PRESENT
|
553 DVB_CA_EN50221_POLL_CAM_READY
;
556 mutex_unlock(&state
->ca_mutex
);
562 static void az6007_ci_uninit(struct dvb_usb_device
*d
)
564 struct az6007_device_state
*state
;
566 pr_debug("%s()\n", __func__
);
571 state
= d_to_priv(d
);
575 if (NULL
== state
->ca
.data
)
578 dvb_ca_en50221_release(&state
->ca
);
580 memset(&state
->ca
, 0, sizeof(state
->ca
));
584 static int az6007_ci_init(struct dvb_usb_adapter
*adap
)
586 struct dvb_usb_device
*d
= adap_to_d(adap
);
587 struct az6007_device_state
*state
= adap_to_priv(adap
);
590 pr_debug("%s()\n", __func__
);
592 mutex_init(&state
->ca_mutex
);
593 state
->ca
.owner
= THIS_MODULE
;
594 state
->ca
.read_attribute_mem
= az6007_ci_read_attribute_mem
;
595 state
->ca
.write_attribute_mem
= az6007_ci_write_attribute_mem
;
596 state
->ca
.read_cam_control
= az6007_ci_read_cam_control
;
597 state
->ca
.write_cam_control
= az6007_ci_write_cam_control
;
598 state
->ca
.slot_reset
= az6007_ci_slot_reset
;
599 state
->ca
.slot_shutdown
= az6007_ci_slot_shutdown
;
600 state
->ca
.slot_ts_enable
= az6007_ci_slot_ts_enable
;
601 state
->ca
.poll_slot_status
= az6007_ci_poll_slot_status
;
604 ret
= dvb_ca_en50221_init(&adap
->dvb_adap
,
609 pr_err("Cannot initialize CI: Error %d.\n", ret
);
610 memset(&state
->ca
, 0, sizeof(state
->ca
));
614 pr_debug("CI initialized.\n");
619 static int az6007_read_mac_addr(struct dvb_usb_adapter
*adap
, u8 mac
[6])
621 struct dvb_usb_device
*d
= adap_to_d(adap
);
622 struct az6007_device_state
*st
= adap_to_priv(adap
);
625 ret
= az6007_read(d
, AZ6007_READ_DATA
, 6, 0, st
->data
, 6);
626 memcpy(mac
, st
->data
, 6);
629 pr_debug("%s: mac is %pM\n", __func__
, mac
);
634 static int az6007_frontend_attach(struct dvb_usb_adapter
*adap
)
636 struct az6007_device_state
*st
= adap_to_priv(adap
);
637 struct dvb_usb_device
*d
= adap_to_d(adap
);
639 pr_debug("attaching demod drxk\n");
641 adap
->fe
[0] = dvb_attach(drxk_attach
, &terratec_h7_drxk
,
646 adap
->fe
[0]->sec_priv
= adap
;
647 st
->gate_ctrl
= adap
->fe
[0]->ops
.i2c_gate_ctrl
;
648 adap
->fe
[0]->ops
.i2c_gate_ctrl
= drxk_gate_ctrl
;
650 az6007_ci_init(adap
);
655 static int az6007_cablestar_hdci_frontend_attach(struct dvb_usb_adapter
*adap
)
657 struct az6007_device_state
*st
= adap_to_priv(adap
);
658 struct dvb_usb_device
*d
= adap_to_d(adap
);
660 pr_debug("attaching demod drxk\n");
662 adap
->fe
[0] = dvb_attach(drxk_attach
, &cablestar_hdci_drxk
,
667 adap
->fe
[0]->sec_priv
= adap
;
668 st
->gate_ctrl
= adap
->fe
[0]->ops
.i2c_gate_ctrl
;
669 adap
->fe
[0]->ops
.i2c_gate_ctrl
= drxk_gate_ctrl
;
671 az6007_ci_init(adap
);
676 static int az6007_tuner_attach(struct dvb_usb_adapter
*adap
)
678 struct dvb_usb_device
*d
= adap_to_d(adap
);
680 pr_debug("attaching tuner mt2063\n");
682 /* Attach mt2063 to DVB-C frontend */
683 if (adap
->fe
[0]->ops
.i2c_gate_ctrl
)
684 adap
->fe
[0]->ops
.i2c_gate_ctrl(adap
->fe
[0], 1);
685 if (!dvb_attach(mt2063_attach
, adap
->fe
[0],
686 &az6007_mt2063_config
,
690 if (adap
->fe
[0]->ops
.i2c_gate_ctrl
)
691 adap
->fe
[0]->ops
.i2c_gate_ctrl(adap
->fe
[0], 0);
696 static int az6007_power_ctrl(struct dvb_usb_device
*d
, int onoff
)
698 struct az6007_device_state
*state
= d_to_priv(d
);
701 pr_debug("%s()\n", __func__
);
704 mutex_init(&state
->mutex
);
706 ret
= az6007_write(d
, AZ6007_POWER
, 0, 2, NULL
, 0);
710 ret
= az6007_write(d
, AZ6007_POWER
, 1, 4, NULL
, 0);
714 ret
= az6007_write(d
, AZ6007_POWER
, 1, 3, NULL
, 0);
718 ret
= az6007_write(d
, AZ6007_POWER
, 1, 4, NULL
, 0);
723 ret
= az6007_write(d
, FX2_SCON1
, 0, 3, NULL
, 0);
727 ret
= az6007_write(d
, FX2_SCON1
, 1, 3, NULL
, 0);
731 ret
= az6007_write(d
, AZ6007_POWER
, 0, 0, NULL
, 0);
743 az6007_write(d
, AZ6007_POWER
, 0, 0, NULL
, 0);
744 az6007_write(d
, AZ6007_TS_THROUGH
, 0, 0, NULL
, 0);
750 static int az6007_i2c_xfer(struct i2c_adapter
*adap
, struct i2c_msg msgs
[],
753 struct dvb_usb_device
*d
= i2c_get_adapdata(adap
);
754 struct az6007_device_state
*st
= d_to_priv(d
);
762 if (mutex_lock_interruptible(&st
->mutex
) < 0)
765 for (i
= 0; i
< num
; i
++) {
766 addr
= msgs
[i
].addr
<< 1;
768 && (msgs
[i
].len
== 1)
769 && ((msgs
[i
].flags
& I2C_M_RD
) != I2C_M_RD
)
770 && (msgs
[i
+ 1].flags
& I2C_M_RD
)
771 && (msgs
[i
].addr
== msgs
[i
+ 1].addr
)) {
773 * A write + read xfer for the same address, where
774 * the first xfer has just 1 byte length.
775 * Need to join both into one operation
777 if (az6007_xfer_debug
)
778 printk(KERN_DEBUG
"az6007: I2C W/R addr=0x%x len=%d/%d\n",
779 addr
, msgs
[i
].len
, msgs
[i
+ 1].len
);
781 index
= msgs
[i
].buf
[0];
782 value
= addr
| (1 << 8);
783 length
= 6 + msgs
[i
+ 1].len
;
784 len
= msgs
[i
+ 1].len
;
785 ret
= __az6007_read(d
->udev
, req
, value
, index
,
788 for (j
= 0; j
< len
; j
++)
789 msgs
[i
+ 1].buf
[j
] = st
->data
[j
+ 5];
793 } else if (!(msgs
[i
].flags
& I2C_M_RD
)) {
795 if (az6007_xfer_debug
)
796 printk(KERN_DEBUG
"az6007: I2C W addr=0x%x len=%d\n",
799 index
= msgs
[i
].buf
[0];
800 value
= addr
| (1 << 8);
801 length
= msgs
[i
].len
- 1;
802 len
= msgs
[i
].len
- 1;
803 for (j
= 0; j
< len
; j
++)
804 st
->data
[j
] = msgs
[i
].buf
[j
+ 1];
805 ret
= __az6007_write(d
->udev
, req
, value
, index
,
809 if (az6007_xfer_debug
)
810 printk(KERN_DEBUG
"az6007: I2C R addr=0x%x len=%d\n",
813 index
= msgs
[i
].buf
[0];
815 length
= msgs
[i
].len
+ 6;
817 ret
= __az6007_read(d
->udev
, req
, value
, index
,
819 for (j
= 0; j
< len
; j
++)
820 msgs
[i
].buf
[j
] = st
->data
[j
+ 5];
826 mutex_unlock(&st
->mutex
);
829 pr_info("%s ERROR: %i\n", __func__
, ret
);
835 static u32
az6007_i2c_func(struct i2c_adapter
*adapter
)
840 static struct i2c_algorithm az6007_i2c_algo
= {
841 .master_xfer
= az6007_i2c_xfer
,
842 .functionality
= az6007_i2c_func
,
845 static int az6007_identify_state(struct dvb_usb_device
*d
, const char **name
)
850 pr_debug("Identifying az6007 state\n");
852 mac
= kmalloc(6, GFP_ATOMIC
);
856 /* Try to read the mac address */
857 ret
= __az6007_read(d
->udev
, AZ6007_READ_DATA
, 6, 0, mac
, 6);
866 __az6007_write(d
->udev
, 0x09, 1, 0, NULL
, 0);
867 __az6007_write(d
->udev
, 0x00, 0, 0, NULL
, 0);
868 __az6007_write(d
->udev
, 0x00, 0, 0, NULL
, 0);
871 pr_debug("Device is on %s state\n",
872 ret
== WARM
? "warm" : "cold");
876 static void az6007_usb_disconnect(struct usb_interface
*intf
)
878 struct dvb_usb_device
*d
= usb_get_intfdata(intf
);
880 dvb_usbv2_disconnect(intf
);
883 static int az6007_download_firmware(struct dvb_usb_device
*d
,
884 const struct firmware
*fw
)
886 pr_debug("Loading az6007 firmware\n");
888 return cypress_load_firmware(d
->udev
, fw
, CYPRESS_FX2
);
891 /* DVB USB Driver stuff */
892 static struct dvb_usb_device_properties az6007_props
= {
893 .driver_name
= KBUILD_MODNAME
,
894 .owner
= THIS_MODULE
,
895 .firmware
= AZ6007_FIRMWARE
,
897 .adapter_nr
= adapter_nr
,
898 .size_of_priv
= sizeof(struct az6007_device_state
),
899 .i2c_algo
= &az6007_i2c_algo
,
900 .tuner_attach
= az6007_tuner_attach
,
901 .frontend_attach
= az6007_frontend_attach
,
902 .streaming_ctrl
= az6007_streaming_ctrl
,
903 .get_rc_config
= az6007_get_rc_config
,
904 .read_mac_address
= az6007_read_mac_addr
,
905 .download_firmware
= az6007_download_firmware
,
906 .identify_state
= az6007_identify_state
,
907 .power_ctrl
= az6007_power_ctrl
,
910 { .stream
= DVB_USB_STREAM_BULK(0x02, 10, 4096), }
914 static struct dvb_usb_device_properties az6007_cablestar_hdci_props
= {
915 .driver_name
= KBUILD_MODNAME
,
916 .owner
= THIS_MODULE
,
917 .firmware
= AZ6007_FIRMWARE
,
919 .adapter_nr
= adapter_nr
,
920 .size_of_priv
= sizeof(struct az6007_device_state
),
921 .i2c_algo
= &az6007_i2c_algo
,
922 .tuner_attach
= az6007_tuner_attach
,
923 .frontend_attach
= az6007_cablestar_hdci_frontend_attach
,
924 .streaming_ctrl
= az6007_streaming_ctrl
,
925 /* ditch get_rc_config as it can't work (TS35 remote, I believe it's rc5) */
926 .get_rc_config
= NULL
,
927 .read_mac_address
= az6007_read_mac_addr
,
928 .download_firmware
= az6007_download_firmware
,
929 .identify_state
= az6007_identify_state
,
930 .power_ctrl
= az6007_power_ctrl
,
933 { .stream
= DVB_USB_STREAM_BULK(0x02, 10, 4096), }
937 static const struct usb_device_id az6007_usb_table
[] = {
938 {DVB_USB_DEVICE(USB_VID_AZUREWAVE
, USB_PID_AZUREWAVE_6007
,
939 &az6007_props
, "Azurewave 6007", RC_MAP_EMPTY
)},
940 {DVB_USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_H7
,
941 &az6007_props
, "Terratec H7", RC_MAP_NEC_TERRATEC_CINERGY_XS
)},
942 {DVB_USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_H7_2
,
943 &az6007_props
, "Terratec H7", RC_MAP_NEC_TERRATEC_CINERGY_XS
)},
944 {DVB_USB_DEVICE(USB_VID_TECHNISAT
, USB_PID_TECHNISAT_USB2_CABLESTAR_HDCI
,
945 &az6007_cablestar_hdci_props
, "Technisat CableStar Combo HD CI", RC_MAP_EMPTY
)},
949 MODULE_DEVICE_TABLE(usb
, az6007_usb_table
);
951 static int az6007_suspend(struct usb_interface
*intf
, pm_message_t msg
)
953 struct dvb_usb_device
*d
= usb_get_intfdata(intf
);
956 return dvb_usbv2_suspend(intf
, msg
);
959 static int az6007_resume(struct usb_interface
*intf
)
961 struct dvb_usb_device
*d
= usb_get_intfdata(intf
);
962 struct dvb_usb_adapter
*adap
= &d
->adapter
[0];
964 az6007_ci_init(adap
);
965 return dvb_usbv2_resume(intf
);
968 /* usb specific object needed to register this driver with the usb subsystem */
969 static struct usb_driver az6007_usb_driver
= {
970 .name
= KBUILD_MODNAME
,
971 .id_table
= az6007_usb_table
,
972 .probe
= dvb_usbv2_probe
,
973 .disconnect
= az6007_usb_disconnect
,
977 * FIXME: need to implement reset_resume, likely with
978 * dvb-usb-v2 core support
980 .suspend
= az6007_suspend
,
981 .resume
= az6007_resume
,
984 module_usb_driver(az6007_usb_driver
);
986 MODULE_AUTHOR("Henry Wang <Henry.wang@AzureWave.com>");
987 MODULE_AUTHOR("Mauro Carvalho Chehab");
988 MODULE_DESCRIPTION("Driver for AzureWave 6007 DVB-C/T USB2.0 and clones");
989 MODULE_VERSION("2.0");
990 MODULE_LICENSE("GPL");
991 MODULE_FIRMWARE(AZ6007_FIRMWARE
);