1 // SPDX-License-Identifier: GPL-2.0-only
3 * Driver for AzureWave 6007 DVB-C/T USB2.0 and clones
5 * Copyright (c) Henry Wang <Henry.wang@AzureWave.com>
7 * This driver was made publicly available by Terratec, at:
8 * http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz
9 * The original driver's license is GPL, as declared with MODULE_LICENSE()
11 * Copyright (c) 2010-2012 Mauro Carvalho Chehab
12 * Driver modified by in order to work with upstream drxk driver, and
13 * tons of bugs got fixed, and converted to use dvb-usb-v2.
18 #include <media/dvb_ca_en50221.h>
20 #include "cypress_firmware.h"
22 #define AZ6007_FIRMWARE "dvb-usb-terratec-h7-az6007.fw"
24 static int az6007_xfer_debug
;
25 module_param_named(xfer_debug
, az6007_xfer_debug
, int, 0644);
26 MODULE_PARM_DESC(xfer_debug
, "Enable xfer debug");
28 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr
);
30 /* Known requests (Cypress FX2 firmware + az6007 "private" ones*/
33 #define AZ6007_READ_DATA 0xb7
34 #define AZ6007_I2C_RD 0xb9
35 #define AZ6007_POWER 0xbc
36 #define AZ6007_I2C_WR 0xbd
37 #define FX2_SCON1 0xc0
38 #define AZ6007_TS_THROUGH 0xc7
39 #define AZ6007_READ_IR 0xb4
41 struct az6007_device_state
{
43 struct mutex ca_mutex
;
44 struct dvb_ca_en50221 ca
;
46 int (*gate_ctrl
) (struct dvb_frontend
*, int);
47 unsigned char data
[4096];
50 static struct drxk_config terratec_h7_drxk
= {
54 .single_master
= true,
55 .enable_merr_cfg
= true,
56 .no_i2c_bridge
= false,
58 .mpeg_out_clk_strength
= 0x02,
59 .qam_demod_parameter_count
= 2,
60 .microcode_name
= "dvb-usb-terratec-h7-drxk.fw",
63 static struct drxk_config cablestar_hdci_drxk
= {
67 .single_master
= true,
68 .enable_merr_cfg
= true,
69 .no_i2c_bridge
= false,
71 .mpeg_out_clk_strength
= 0x02,
72 .qam_demod_parameter_count
= 2,
73 .microcode_name
= "dvb-usb-technisat-cablestar-hdci-drxk.fw",
76 static int drxk_gate_ctrl(struct dvb_frontend
*fe
, int enable
)
78 struct az6007_device_state
*st
= fe_to_priv(fe
);
79 struct dvb_usb_adapter
*adap
= fe
->sec_priv
;
82 pr_debug("%s: %s\n", __func__
, enable
? "enable" : "disable");
88 status
= st
->gate_ctrl(fe
, 1);
90 status
= st
->gate_ctrl(fe
, 0);
95 static struct mt2063_config az6007_mt2063_config
= {
96 .tuner_address
= 0x60,
100 static int __az6007_read(struct usb_device
*udev
, u8 req
, u16 value
,
101 u16 index
, u8
*b
, int blen
)
105 ret
= usb_control_msg(udev
,
106 usb_rcvctrlpipe(udev
, 0),
108 USB_TYPE_VENDOR
| USB_DIR_IN
,
109 value
, index
, b
, blen
, 5000);
111 pr_warn("usb read operation failed. (%d)\n", ret
);
115 if (az6007_xfer_debug
) {
116 printk(KERN_DEBUG
"az6007: IN req: %02x, value: %04x, index: %04x\n",
118 print_hex_dump_bytes("az6007: payload: ",
119 DUMP_PREFIX_NONE
, b
, blen
);
125 static int az6007_read(struct dvb_usb_device
*d
, u8 req
, u16 value
,
126 u16 index
, u8
*b
, int blen
)
128 struct az6007_device_state
*st
= d
->priv
;
131 if (mutex_lock_interruptible(&st
->mutex
) < 0)
134 ret
= __az6007_read(d
->udev
, req
, value
, index
, b
, blen
);
136 mutex_unlock(&st
->mutex
);
141 static int __az6007_write(struct usb_device
*udev
, u8 req
, u16 value
,
142 u16 index
, u8
*b
, int blen
)
146 if (az6007_xfer_debug
) {
147 printk(KERN_DEBUG
"az6007: OUT req: %02x, value: %04x, index: %04x\n",
149 print_hex_dump_bytes("az6007: payload: ",
150 DUMP_PREFIX_NONE
, b
, blen
);
154 pr_err("az6007: tried to write %d bytes, but I2C max size is 64 bytes\n",
159 ret
= usb_control_msg(udev
,
160 usb_sndctrlpipe(udev
, 0),
162 USB_TYPE_VENDOR
| USB_DIR_OUT
,
163 value
, index
, b
, blen
, 5000);
165 pr_err("usb write operation failed. (%d)\n", ret
);
172 static int az6007_write(struct dvb_usb_device
*d
, u8 req
, u16 value
,
173 u16 index
, u8
*b
, int blen
)
175 struct az6007_device_state
*st
= d
->priv
;
178 if (mutex_lock_interruptible(&st
->mutex
) < 0)
181 ret
= __az6007_write(d
->udev
, req
, value
, index
, b
, blen
);
183 mutex_unlock(&st
->mutex
);
188 static int az6007_streaming_ctrl(struct dvb_frontend
*fe
, int onoff
)
190 struct dvb_usb_device
*d
= fe_to_d(fe
);
192 pr_debug("%s: %s\n", __func__
, onoff
? "enable" : "disable");
194 return az6007_write(d
, 0xbc, onoff
, 0, NULL
, 0);
197 #if IS_ENABLED(CONFIG_RC_CORE)
198 /* remote control stuff (does not work with my box) */
199 static int az6007_rc_query(struct dvb_usb_device
*d
)
201 struct az6007_device_state
*st
= d_to_priv(d
);
205 az6007_read(d
, AZ6007_READ_IR
, 0, 0, st
->data
, 10);
207 if (st
->data
[1] == 0x44)
210 if ((st
->data
[3] ^ st
->data
[4]) == 0xff) {
211 if ((st
->data
[1] ^ st
->data
[2]) == 0xff) {
212 code
= RC_SCANCODE_NEC(st
->data
[1], st
->data
[3]);
213 proto
= RC_PROTO_NEC
;
215 code
= RC_SCANCODE_NECX(st
->data
[1] << 8 | st
->data
[2],
217 proto
= RC_PROTO_NECX
;
220 code
= RC_SCANCODE_NEC32(st
->data
[1] << 24 |
224 proto
= RC_PROTO_NEC32
;
227 rc_keydown(d
->rc_dev
, proto
, code
, st
->data
[5]);
232 static int az6007_get_rc_config(struct dvb_usb_device
*d
, struct dvb_usb_rc
*rc
)
234 pr_debug("Getting az6007 Remote Control properties\n");
236 rc
->allowed_protos
= RC_PROTO_BIT_NEC
| RC_PROTO_BIT_NECX
|
238 rc
->query
= az6007_rc_query
;
244 #define az6007_get_rc_config NULL
247 static int az6007_ci_read_attribute_mem(struct dvb_ca_en50221
*ca
,
251 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
252 struct az6007_device_state
*state
= d_to_priv(d
);
264 b
= kmalloc(12, GFP_KERNEL
);
268 mutex_lock(&state
->ca_mutex
);
275 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
277 pr_warn("usb in operation failed. (%d)\n", ret
);
283 mutex_unlock(&state
->ca_mutex
);
288 static int az6007_ci_write_attribute_mem(struct dvb_ca_en50221
*ca
,
293 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
294 struct az6007_device_state
*state
= d_to_priv(d
);
302 pr_debug("%s(), slot %d\n", __func__
, slot
);
306 mutex_lock(&state
->ca_mutex
);
312 ret
= az6007_write(d
, req
, value1
, index
, NULL
, blen
);
314 pr_warn("usb out operation failed. (%d)\n", ret
);
316 mutex_unlock(&state
->ca_mutex
);
320 static int az6007_ci_read_cam_control(struct dvb_ca_en50221
*ca
,
324 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
325 struct az6007_device_state
*state
= d_to_priv(d
);
337 b
= kmalloc(12, GFP_KERNEL
);
341 mutex_lock(&state
->ca_mutex
);
348 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
350 pr_warn("usb in operation failed. (%d)\n", ret
);
354 pr_warn("Read CI IO error\n");
357 pr_debug("read cam data = %x from 0x%x\n", b
[1], value
);
360 mutex_unlock(&state
->ca_mutex
);
365 static int az6007_ci_write_cam_control(struct dvb_ca_en50221
*ca
,
370 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
371 struct az6007_device_state
*state
= d_to_priv(d
);
382 mutex_lock(&state
->ca_mutex
);
388 ret
= az6007_write(d
, req
, value1
, index
, NULL
, blen
);
390 pr_warn("usb out operation failed. (%d)\n", ret
);
395 mutex_unlock(&state
->ca_mutex
);
399 static int CI_CamReady(struct dvb_ca_en50221
*ca
, int slot
)
401 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
410 b
= kmalloc(12, GFP_KERNEL
);
419 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
421 pr_warn("usb in operation failed. (%d)\n", ret
);
430 static int az6007_ci_slot_reset(struct dvb_ca_en50221
*ca
, int slot
)
432 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
433 struct az6007_device_state
*state
= d_to_priv(d
);
441 mutex_lock(&state
->ca_mutex
);
448 ret
= az6007_write(d
, req
, value
, index
, NULL
, blen
);
450 pr_warn("usb out operation failed. (%d)\n", ret
);
460 ret
= az6007_write(d
, req
, value
, index
, NULL
, blen
);
462 pr_warn("usb out operation failed. (%d)\n", ret
);
466 for (i
= 0; i
< 15; i
++) {
469 if (CI_CamReady(ca
, slot
)) {
470 pr_debug("CAM Ready\n");
477 mutex_unlock(&state
->ca_mutex
);
481 static int az6007_ci_slot_shutdown(struct dvb_ca_en50221
*ca
, int slot
)
486 static int az6007_ci_slot_ts_enable(struct dvb_ca_en50221
*ca
, int slot
)
488 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
489 struct az6007_device_state
*state
= d_to_priv(d
);
497 pr_debug("%s()\n", __func__
);
498 mutex_lock(&state
->ca_mutex
);
504 ret
= az6007_write(d
, req
, value
, index
, NULL
, blen
);
506 pr_warn("usb out operation failed. (%d)\n", ret
);
511 mutex_unlock(&state
->ca_mutex
);
515 static int az6007_ci_poll_slot_status(struct dvb_ca_en50221
*ca
, int slot
, int open
)
517 struct dvb_usb_device
*d
= (struct dvb_usb_device
*)ca
->data
;
518 struct az6007_device_state
*state
= d_to_priv(d
);
526 b
= kmalloc(12, GFP_KERNEL
);
529 mutex_lock(&state
->ca_mutex
);
536 ret
= az6007_read(d
, req
, value
, index
, b
, blen
);
538 pr_warn("usb in operation failed. (%d)\n", ret
);
543 if (!ret
&& b
[0] == 1) {
544 ret
= DVB_CA_EN50221_POLL_CAM_PRESENT
|
545 DVB_CA_EN50221_POLL_CAM_READY
;
548 mutex_unlock(&state
->ca_mutex
);
554 static void az6007_ci_uninit(struct dvb_usb_device
*d
)
556 struct az6007_device_state
*state
;
558 pr_debug("%s()\n", __func__
);
563 state
= d_to_priv(d
);
567 if (NULL
== state
->ca
.data
)
570 dvb_ca_en50221_release(&state
->ca
);
572 memset(&state
->ca
, 0, sizeof(state
->ca
));
576 static int az6007_ci_init(struct dvb_usb_adapter
*adap
)
578 struct dvb_usb_device
*d
= adap_to_d(adap
);
579 struct az6007_device_state
*state
= adap_to_priv(adap
);
582 pr_debug("%s()\n", __func__
);
584 mutex_init(&state
->ca_mutex
);
585 state
->ca
.owner
= THIS_MODULE
;
586 state
->ca
.read_attribute_mem
= az6007_ci_read_attribute_mem
;
587 state
->ca
.write_attribute_mem
= az6007_ci_write_attribute_mem
;
588 state
->ca
.read_cam_control
= az6007_ci_read_cam_control
;
589 state
->ca
.write_cam_control
= az6007_ci_write_cam_control
;
590 state
->ca
.slot_reset
= az6007_ci_slot_reset
;
591 state
->ca
.slot_shutdown
= az6007_ci_slot_shutdown
;
592 state
->ca
.slot_ts_enable
= az6007_ci_slot_ts_enable
;
593 state
->ca
.poll_slot_status
= az6007_ci_poll_slot_status
;
596 ret
= dvb_ca_en50221_init(&adap
->dvb_adap
,
601 pr_err("Cannot initialize CI: Error %d.\n", ret
);
602 memset(&state
->ca
, 0, sizeof(state
->ca
));
606 pr_debug("CI initialized.\n");
611 static int az6007_read_mac_addr(struct dvb_usb_adapter
*adap
, u8 mac
[6])
613 struct dvb_usb_device
*d
= adap_to_d(adap
);
614 struct az6007_device_state
*st
= adap_to_priv(adap
);
617 ret
= az6007_read(d
, AZ6007_READ_DATA
, 6, 0, st
->data
, 6);
618 memcpy(mac
, st
->data
, 6);
621 pr_debug("%s: mac is %pM\n", __func__
, mac
);
626 static int az6007_frontend_attach(struct dvb_usb_adapter
*adap
)
628 struct az6007_device_state
*st
= adap_to_priv(adap
);
629 struct dvb_usb_device
*d
= adap_to_d(adap
);
631 pr_debug("attaching demod drxk\n");
633 adap
->fe
[0] = dvb_attach(drxk_attach
, &terratec_h7_drxk
,
638 adap
->fe
[0]->sec_priv
= adap
;
639 st
->gate_ctrl
= adap
->fe
[0]->ops
.i2c_gate_ctrl
;
640 adap
->fe
[0]->ops
.i2c_gate_ctrl
= drxk_gate_ctrl
;
642 az6007_ci_init(adap
);
647 static int az6007_cablestar_hdci_frontend_attach(struct dvb_usb_adapter
*adap
)
649 struct az6007_device_state
*st
= adap_to_priv(adap
);
650 struct dvb_usb_device
*d
= adap_to_d(adap
);
652 pr_debug("attaching demod drxk\n");
654 adap
->fe
[0] = dvb_attach(drxk_attach
, &cablestar_hdci_drxk
,
659 adap
->fe
[0]->sec_priv
= adap
;
660 st
->gate_ctrl
= adap
->fe
[0]->ops
.i2c_gate_ctrl
;
661 adap
->fe
[0]->ops
.i2c_gate_ctrl
= drxk_gate_ctrl
;
663 az6007_ci_init(adap
);
668 static int az6007_tuner_attach(struct dvb_usb_adapter
*adap
)
670 struct dvb_usb_device
*d
= adap_to_d(adap
);
672 pr_debug("attaching tuner mt2063\n");
674 /* Attach mt2063 to DVB-C frontend */
675 if (adap
->fe
[0]->ops
.i2c_gate_ctrl
)
676 adap
->fe
[0]->ops
.i2c_gate_ctrl(adap
->fe
[0], 1);
677 if (!dvb_attach(mt2063_attach
, adap
->fe
[0],
678 &az6007_mt2063_config
,
682 if (adap
->fe
[0]->ops
.i2c_gate_ctrl
)
683 adap
->fe
[0]->ops
.i2c_gate_ctrl(adap
->fe
[0], 0);
688 static int az6007_power_ctrl(struct dvb_usb_device
*d
, int onoff
)
690 struct az6007_device_state
*state
= d_to_priv(d
);
693 pr_debug("%s()\n", __func__
);
696 mutex_init(&state
->mutex
);
698 ret
= az6007_write(d
, AZ6007_POWER
, 0, 2, NULL
, 0);
702 ret
= az6007_write(d
, AZ6007_POWER
, 1, 4, NULL
, 0);
706 ret
= az6007_write(d
, AZ6007_POWER
, 1, 3, NULL
, 0);
710 ret
= az6007_write(d
, AZ6007_POWER
, 1, 4, NULL
, 0);
715 ret
= az6007_write(d
, FX2_SCON1
, 0, 3, NULL
, 0);
719 ret
= az6007_write(d
, FX2_SCON1
, 1, 3, NULL
, 0);
723 ret
= az6007_write(d
, AZ6007_POWER
, 0, 0, NULL
, 0);
735 az6007_write(d
, AZ6007_POWER
, 0, 0, NULL
, 0);
736 az6007_write(d
, AZ6007_TS_THROUGH
, 0, 0, NULL
, 0);
742 static int az6007_i2c_xfer(struct i2c_adapter
*adap
, struct i2c_msg msgs
[],
745 struct dvb_usb_device
*d
= i2c_get_adapdata(adap
);
746 struct az6007_device_state
*st
= d_to_priv(d
);
754 if (mutex_lock_interruptible(&st
->mutex
) < 0)
757 for (i
= 0; i
< num
; i
++) {
758 addr
= msgs
[i
].addr
<< 1;
760 && (msgs
[i
].len
== 1)
761 && ((msgs
[i
].flags
& I2C_M_RD
) != I2C_M_RD
)
762 && (msgs
[i
+ 1].flags
& I2C_M_RD
)
763 && (msgs
[i
].addr
== msgs
[i
+ 1].addr
)) {
765 * A write + read xfer for the same address, where
766 * the first xfer has just 1 byte length.
767 * Need to join both into one operation
769 if (az6007_xfer_debug
)
770 printk(KERN_DEBUG
"az6007: I2C W/R addr=0x%x len=%d/%d\n",
771 addr
, msgs
[i
].len
, msgs
[i
+ 1].len
);
773 index
= msgs
[i
].buf
[0];
774 value
= addr
| (1 << 8);
775 length
= 6 + msgs
[i
+ 1].len
;
776 len
= msgs
[i
+ 1].len
;
777 ret
= __az6007_read(d
->udev
, req
, value
, index
,
780 for (j
= 0; j
< len
; j
++)
781 msgs
[i
+ 1].buf
[j
] = st
->data
[j
+ 5];
785 } else if (!(msgs
[i
].flags
& I2C_M_RD
)) {
787 if (az6007_xfer_debug
)
788 printk(KERN_DEBUG
"az6007: I2C W addr=0x%x len=%d\n",
791 index
= msgs
[i
].buf
[0];
792 value
= addr
| (1 << 8);
793 length
= msgs
[i
].len
- 1;
794 len
= msgs
[i
].len
- 1;
795 for (j
= 0; j
< len
; j
++)
796 st
->data
[j
] = msgs
[i
].buf
[j
+ 1];
797 ret
= __az6007_write(d
->udev
, req
, value
, index
,
801 if (az6007_xfer_debug
)
802 printk(KERN_DEBUG
"az6007: I2C R addr=0x%x len=%d\n",
805 index
= msgs
[i
].buf
[0];
807 length
= msgs
[i
].len
+ 6;
809 ret
= __az6007_read(d
->udev
, req
, value
, index
,
811 for (j
= 0; j
< len
; j
++)
812 msgs
[i
].buf
[j
] = st
->data
[j
+ 5];
818 mutex_unlock(&st
->mutex
);
821 pr_info("%s ERROR: %i\n", __func__
, ret
);
827 static u32
az6007_i2c_func(struct i2c_adapter
*adapter
)
832 static struct i2c_algorithm az6007_i2c_algo
= {
833 .master_xfer
= az6007_i2c_xfer
,
834 .functionality
= az6007_i2c_func
,
837 static int az6007_identify_state(struct dvb_usb_device
*d
, const char **name
)
842 pr_debug("Identifying az6007 state\n");
844 mac
= kmalloc(6, GFP_ATOMIC
);
848 /* Try to read the mac address */
849 ret
= __az6007_read(d
->udev
, AZ6007_READ_DATA
, 6, 0, mac
, 6);
858 __az6007_write(d
->udev
, 0x09, 1, 0, NULL
, 0);
859 __az6007_write(d
->udev
, 0x00, 0, 0, NULL
, 0);
860 __az6007_write(d
->udev
, 0x00, 0, 0, NULL
, 0);
863 pr_debug("Device is on %s state\n",
864 ret
== WARM
? "warm" : "cold");
868 static void az6007_usb_disconnect(struct usb_interface
*intf
)
870 struct dvb_usb_device
*d
= usb_get_intfdata(intf
);
872 dvb_usbv2_disconnect(intf
);
875 static int az6007_download_firmware(struct dvb_usb_device
*d
,
876 const struct firmware
*fw
)
878 pr_debug("Loading az6007 firmware\n");
880 return cypress_load_firmware(d
->udev
, fw
, CYPRESS_FX2
);
883 /* DVB USB Driver stuff */
884 static struct dvb_usb_device_properties az6007_props
= {
885 .driver_name
= KBUILD_MODNAME
,
886 .owner
= THIS_MODULE
,
887 .firmware
= AZ6007_FIRMWARE
,
889 .adapter_nr
= adapter_nr
,
890 .size_of_priv
= sizeof(struct az6007_device_state
),
891 .i2c_algo
= &az6007_i2c_algo
,
892 .tuner_attach
= az6007_tuner_attach
,
893 .frontend_attach
= az6007_frontend_attach
,
894 .streaming_ctrl
= az6007_streaming_ctrl
,
895 .get_rc_config
= az6007_get_rc_config
,
896 .read_mac_address
= az6007_read_mac_addr
,
897 .download_firmware
= az6007_download_firmware
,
898 .identify_state
= az6007_identify_state
,
899 .power_ctrl
= az6007_power_ctrl
,
902 { .stream
= DVB_USB_STREAM_BULK(0x02, 10, 4096), }
906 static struct dvb_usb_device_properties az6007_cablestar_hdci_props
= {
907 .driver_name
= KBUILD_MODNAME
,
908 .owner
= THIS_MODULE
,
909 .firmware
= AZ6007_FIRMWARE
,
911 .adapter_nr
= adapter_nr
,
912 .size_of_priv
= sizeof(struct az6007_device_state
),
913 .i2c_algo
= &az6007_i2c_algo
,
914 .tuner_attach
= az6007_tuner_attach
,
915 .frontend_attach
= az6007_cablestar_hdci_frontend_attach
,
916 .streaming_ctrl
= az6007_streaming_ctrl
,
917 /* ditch get_rc_config as it can't work (TS35 remote, I believe it's rc5) */
918 .get_rc_config
= NULL
,
919 .read_mac_address
= az6007_read_mac_addr
,
920 .download_firmware
= az6007_download_firmware
,
921 .identify_state
= az6007_identify_state
,
922 .power_ctrl
= az6007_power_ctrl
,
925 { .stream
= DVB_USB_STREAM_BULK(0x02, 10, 4096), }
929 static const struct usb_device_id az6007_usb_table
[] = {
930 {DVB_USB_DEVICE(USB_VID_AZUREWAVE
, USB_PID_AZUREWAVE_6007
,
931 &az6007_props
, "Azurewave 6007", RC_MAP_EMPTY
)},
932 {DVB_USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_H7
,
933 &az6007_props
, "Terratec H7", RC_MAP_NEC_TERRATEC_CINERGY_XS
)},
934 {DVB_USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_H7_2
,
935 &az6007_props
, "Terratec H7", RC_MAP_NEC_TERRATEC_CINERGY_XS
)},
936 {DVB_USB_DEVICE(USB_VID_TECHNISAT
, USB_PID_TECHNISAT_USB2_CABLESTAR_HDCI
,
937 &az6007_cablestar_hdci_props
, "Technisat CableStar Combo HD CI", RC_MAP_EMPTY
)},
941 MODULE_DEVICE_TABLE(usb
, az6007_usb_table
);
943 static int az6007_suspend(struct usb_interface
*intf
, pm_message_t msg
)
945 struct dvb_usb_device
*d
= usb_get_intfdata(intf
);
948 return dvb_usbv2_suspend(intf
, msg
);
951 static int az6007_resume(struct usb_interface
*intf
)
953 struct dvb_usb_device
*d
= usb_get_intfdata(intf
);
954 struct dvb_usb_adapter
*adap
= &d
->adapter
[0];
956 az6007_ci_init(adap
);
957 return dvb_usbv2_resume(intf
);
960 /* usb specific object needed to register this driver with the usb subsystem */
961 static struct usb_driver az6007_usb_driver
= {
962 .name
= KBUILD_MODNAME
,
963 .id_table
= az6007_usb_table
,
964 .probe
= dvb_usbv2_probe
,
965 .disconnect
= az6007_usb_disconnect
,
969 * FIXME: need to implement reset_resume, likely with
970 * dvb-usb-v2 core support
972 .suspend
= az6007_suspend
,
973 .resume
= az6007_resume
,
976 module_usb_driver(az6007_usb_driver
);
978 MODULE_AUTHOR("Henry Wang <Henry.wang@AzureWave.com>");
979 MODULE_AUTHOR("Mauro Carvalho Chehab");
980 MODULE_DESCRIPTION("Driver for AzureWave 6007 DVB-C/T USB2.0 and clones");
981 MODULE_VERSION("2.0");
982 MODULE_LICENSE("GPL");
983 MODULE_FIRMWARE(AZ6007_FIRMWARE
);