diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-04 15:05:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-06 08:23:46 -0400 |
commit | 255d52f25485e8fe244d15266b76428ba545f022 (patch) | |
tree | 787cd970d72a25b3e11e594ce417c0d8e32db8be /drivers/media/dvb | |
parent | 115ad55e9c10bad551357a4f4d43d57aaa776bf0 (diff) |
[media] az6007: convert it to use dvb-usb-v2
Change it to use dvb-usb-v2. The driver should be working as before.
The only functional changes should be at the driver debug logs.
This driver needs the cypress firmware load, so, auto-selects it.
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb-v2/Kconfig | 9 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb-v2/Makefile | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb-v2/az6007.c (renamed from drivers/media/dvb/dvb-usb/az6007.c) | 382 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/Kconfig | 8 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/Makefile | 3 |
5 files changed, 174 insertions, 231 deletions
diff --git a/drivers/media/dvb/dvb-usb-v2/Kconfig b/drivers/media/dvb/dvb-usb-v2/Kconfig index 98b8fb59cd28..e7ff148e4a29 100644 --- a/drivers/media/dvb/dvb-usb-v2/Kconfig +++ b/drivers/media/dvb/dvb-usb-v2/Kconfig | |||
@@ -68,6 +68,15 @@ config DVB_USB_AU6610 | |||
68 | help | 68 | help |
69 | Say Y here to support the Sigmatek DVB-110 DVB-T USB2.0 receiver. | 69 | Say Y here to support the Sigmatek DVB-110 DVB-T USB2.0 receiver. |
70 | 70 | ||
71 | config DVB_USB_AZ6007 | ||
72 | tristate "AzureWave 6007 and clones DVB-T/C USB2.0 support" | ||
73 | depends on DVB_USB_V2 | ||
74 | select DVB_USB_CYPRESS_FIRMWARE | ||
75 | select DVB_DRXK if !DVB_FE_CUSTOMISE | ||
76 | select MEDIA_TUNER_MT2063 if !DVB_FE_CUSTOMISE | ||
77 | help | ||
78 | Say Y here to support the AZ6007 receivers like Terratec H7. | ||
79 | |||
71 | config DVB_USB_CE6230 | 80 | config DVB_USB_CE6230 |
72 | tristate "Intel CE6230 DVB-T USB2.0 support" | 81 | tristate "Intel CE6230 DVB-T USB2.0 support" |
73 | depends on DVB_USB_V2 | 82 | depends on DVB_USB_V2 |
diff --git a/drivers/media/dvb/dvb-usb-v2/Makefile b/drivers/media/dvb/dvb-usb-v2/Makefile index 4438dcd6fd49..a784bf4af4e4 100644 --- a/drivers/media/dvb/dvb-usb-v2/Makefile +++ b/drivers/media/dvb/dvb-usb-v2/Makefile | |||
@@ -16,6 +16,9 @@ obj-$(CONFIG_DVB_USB_ANYSEE) += dvb-usb-anysee.o | |||
16 | dvb-usb-au6610-objs = au6610.o | 16 | dvb-usb-au6610-objs = au6610.o |
17 | obj-$(CONFIG_DVB_USB_AU6610) += dvb-usb-au6610.o | 17 | obj-$(CONFIG_DVB_USB_AU6610) += dvb-usb-au6610.o |
18 | 18 | ||
19 | dvb-usb-az6007-objs = az6007.o | ||
20 | obj-$(CONFIG_DVB_USB_AZ6007) += dvb-usb-az6007.o | ||
21 | |||
19 | dvb-usb-ce6230-objs = ce6230.o | 22 | dvb-usb-ce6230-objs = ce6230.o |
20 | obj-$(CONFIG_DVB_USB_CE6230) += dvb-usb-ce6230.o | 23 | obj-$(CONFIG_DVB_USB_CE6230) += dvb-usb-ce6230.o |
21 | 24 | ||
diff --git a/drivers/media/dvb/dvb-usb/az6007.c b/drivers/media/dvb/dvb-usb-v2/az6007.c index 86861e6f86d2..9d2ad4965dee 100644 --- a/drivers/media/dvb/dvb-usb/az6007.c +++ b/drivers/media/dvb/dvb-usb-v2/az6007.c | |||
@@ -24,20 +24,14 @@ | |||
24 | #include "drxk.h" | 24 | #include "drxk.h" |
25 | #include "mt2063.h" | 25 | #include "mt2063.h" |
26 | #include "dvb_ca_en50221.h" | 26 | #include "dvb_ca_en50221.h" |
27 | #include "dvb_usb.h" | ||
28 | #include "cypress_firmware.h" | ||
27 | 29 | ||
28 | #define DVB_USB_LOG_PREFIX "az6007" | 30 | #define AZ6007_FIRMWARE "dvb-usb-terratec-h7-az6007.fw" |
29 | #include "dvb-usb.h" | ||
30 | 31 | ||
31 | /* debug */ | 32 | static int az6007_xfer_debug; |
32 | int dvb_usb_az6007_debug; | 33 | module_param_named(xfer_debug, az6007_xfer_debug, int, 0644); |
33 | module_param_named(debug, dvb_usb_az6007_debug, int, 0644); | 34 | MODULE_PARM_DESC(xfer_debug, "Enable xfer debug"); |
34 | MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." | ||
35 | DVB_USB_DEBUG_STATUS); | ||
36 | |||
37 | #define deb_info(args...) dprintk(dvb_usb_az6007_debug, 0x01, args) | ||
38 | #define deb_xfer(args...) dprintk(dvb_usb_az6007_debug, 0x02, args) | ||
39 | #define deb_rc(args...) dprintk(dvb_usb_az6007_debug, 0x04, args) | ||
40 | #define deb_fe(args...) dprintk(dvb_usb_az6007_debug, 0x08, args) | ||
41 | 35 | ||
42 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 36 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
43 | 37 | ||
@@ -75,18 +69,13 @@ static struct drxk_config terratec_h7_drxk = { | |||
75 | 69 | ||
76 | static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) | 70 | static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) |
77 | { | 71 | { |
72 | struct az6007_device_state *st = fe_to_priv(fe); | ||
78 | struct dvb_usb_adapter *adap = fe->sec_priv; | 73 | struct dvb_usb_adapter *adap = fe->sec_priv; |
79 | struct az6007_device_state *st; | ||
80 | int status = 0; | 74 | int status = 0; |
81 | 75 | ||
82 | deb_info("%s: %s\n", __func__, enable ? "enable" : "disable"); | 76 | pr_debug("%s: %s\n", __func__, enable ? "enable" : "disable"); |
83 | |||
84 | if (!adap) | ||
85 | return -EINVAL; | ||
86 | |||
87 | st = adap->dev->priv; | ||
88 | 77 | ||
89 | if (!st) | 78 | if (!adap || !st) |
90 | return -EINVAL; | 79 | return -EINVAL; |
91 | 80 | ||
92 | if (enable) | 81 | if (enable) |
@@ -113,13 +102,16 @@ static int __az6007_read(struct usb_device *udev, u8 req, u16 value, | |||
113 | USB_TYPE_VENDOR | USB_DIR_IN, | 102 | USB_TYPE_VENDOR | USB_DIR_IN, |
114 | value, index, b, blen, 5000); | 103 | value, index, b, blen, 5000); |
115 | if (ret < 0) { | 104 | if (ret < 0) { |
116 | warn("usb read operation failed. (%d)", ret); | 105 | pr_warn("usb read operation failed. (%d)\n", ret); |
117 | return -EIO; | 106 | return -EIO; |
118 | } | 107 | } |
119 | 108 | ||
120 | deb_xfer("in: req. %02x, val: %04x, ind: %04x, buffer: ", req, value, | 109 | if (az6007_xfer_debug) { |
121 | index); | 110 | printk(KERN_DEBUG "az6007: IN req: %02x, value: %04x, index: %04x\n", |
122 | debug_dump(b, blen, deb_xfer); | 111 | req, value, index); |
112 | print_hex_dump_bytes("az6007: payload: ", | ||
113 | DUMP_PREFIX_NONE, b, blen); | ||
114 | } | ||
123 | 115 | ||
124 | return ret; | 116 | return ret; |
125 | } | 117 | } |
@@ -145,13 +137,16 @@ static int __az6007_write(struct usb_device *udev, u8 req, u16 value, | |||
145 | { | 137 | { |
146 | int ret; | 138 | int ret; |
147 | 139 | ||
148 | deb_xfer("out: req. %02x, val: %04x, ind: %04x, buffer: ", req, value, | 140 | if (az6007_xfer_debug) { |
149 | index); | 141 | printk(KERN_DEBUG "az6007: OUT req: %02x, value: %04x, index: %04x\n", |
150 | debug_dump(b, blen, deb_xfer); | 142 | req, value, index); |
143 | print_hex_dump_bytes("az6007: payload: ", | ||
144 | DUMP_PREFIX_NONE, b, blen); | ||
145 | } | ||
151 | 146 | ||
152 | if (blen > 64) { | 147 | if (blen > 64) { |
153 | err("az6007: tried to write %d bytes, but I2C max size is 64 bytes\n", | 148 | pr_err("az6007: tried to write %d bytes, but I2C max size is 64 bytes\n", |
154 | blen); | 149 | blen); |
155 | return -EOPNOTSUPP; | 150 | return -EOPNOTSUPP; |
156 | } | 151 | } |
157 | 152 | ||
@@ -161,7 +156,7 @@ static int __az6007_write(struct usb_device *udev, u8 req, u16 value, | |||
161 | USB_TYPE_VENDOR | USB_DIR_OUT, | 156 | USB_TYPE_VENDOR | USB_DIR_OUT, |
162 | value, index, b, blen, 5000); | 157 | value, index, b, blen, 5000); |
163 | if (ret != blen) { | 158 | if (ret != blen) { |
164 | err("usb write operation failed. (%d)", ret); | 159 | pr_err("usb write operation failed. (%d)\n", ret); |
165 | return -EIO; | 160 | return -EIO; |
166 | } | 161 | } |
167 | 162 | ||
@@ -184,11 +179,11 @@ static int az6007_write(struct dvb_usb_device *d, u8 req, u16 value, | |||
184 | return ret; | 179 | return ret; |
185 | } | 180 | } |
186 | 181 | ||
187 | static int az6007_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | 182 | static int az6007_streaming_ctrl(struct dvb_frontend *fe, int onoff) |
188 | { | 183 | { |
189 | struct dvb_usb_device *d = adap->dev; | 184 | struct dvb_usb_device *d = fe_to_d(fe); |
190 | 185 | ||
191 | deb_info("%s: %s", __func__, onoff ? "enable" : "disable"); | 186 | pr_debug("%s: %s\n", __func__, onoff ? "enable" : "disable"); |
192 | 187 | ||
193 | return az6007_write(d, 0xbc, onoff, 0, NULL, 0); | 188 | return az6007_write(d, 0xbc, onoff, 0, NULL, 0); |
194 | } | 189 | } |
@@ -196,7 +191,7 @@ static int az6007_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
196 | /* remote control stuff (does not work with my box) */ | 191 | /* remote control stuff (does not work with my box) */ |
197 | static int az6007_rc_query(struct dvb_usb_device *d) | 192 | static int az6007_rc_query(struct dvb_usb_device *d) |
198 | { | 193 | { |
199 | struct az6007_device_state *st = d->priv; | 194 | struct az6007_device_state *st = d_to_priv(d); |
200 | unsigned code = 0; | 195 | unsigned code = 0; |
201 | 196 | ||
202 | az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10); | 197 | az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10); |
@@ -224,7 +219,7 @@ static int az6007_ci_read_attribute_mem(struct dvb_ca_en50221 *ca, | |||
224 | int address) | 219 | int address) |
225 | { | 220 | { |
226 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 221 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
227 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 222 | struct az6007_device_state *state = d_to_priv(d); |
228 | 223 | ||
229 | int ret; | 224 | int ret; |
230 | u8 req; | 225 | u8 req; |
@@ -249,7 +244,7 @@ static int az6007_ci_read_attribute_mem(struct dvb_ca_en50221 *ca, | |||
249 | 244 | ||
250 | ret = az6007_read(d, req, value, index, b, blen); | 245 | ret = az6007_read(d, req, value, index, b, blen); |
251 | if (ret < 0) { | 246 | if (ret < 0) { |
252 | warn("usb in operation failed. (%d)", ret); | 247 | pr_warn("usb in operation failed. (%d)\n", ret); |
253 | ret = -EINVAL; | 248 | ret = -EINVAL; |
254 | } else { | 249 | } else { |
255 | ret = b[0]; | 250 | ret = b[0]; |
@@ -266,7 +261,7 @@ static int az6007_ci_write_attribute_mem(struct dvb_ca_en50221 *ca, | |||
266 | u8 value) | 261 | u8 value) |
267 | { | 262 | { |
268 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 263 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
269 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 264 | struct az6007_device_state *state = d_to_priv(d); |
270 | 265 | ||
271 | int ret; | 266 | int ret; |
272 | u8 req; | 267 | u8 req; |
@@ -274,7 +269,7 @@ static int az6007_ci_write_attribute_mem(struct dvb_ca_en50221 *ca, | |||
274 | u16 index; | 269 | u16 index; |
275 | int blen; | 270 | int blen; |
276 | 271 | ||
277 | deb_info("%s %d", __func__, slot); | 272 | pr_debug("%s(), slot %d\n", __func__, slot); |
278 | if (slot != 0) | 273 | if (slot != 0) |
279 | return -EINVAL; | 274 | return -EINVAL; |
280 | 275 | ||
@@ -286,7 +281,7 @@ static int az6007_ci_write_attribute_mem(struct dvb_ca_en50221 *ca, | |||
286 | 281 | ||
287 | ret = az6007_write(d, req, value1, index, NULL, blen); | 282 | ret = az6007_write(d, req, value1, index, NULL, blen); |
288 | if (ret != 0) | 283 | if (ret != 0) |
289 | warn("usb out operation failed. (%d)", ret); | 284 | pr_warn("usb out operation failed. (%d)\n", ret); |
290 | 285 | ||
291 | mutex_unlock(&state->ca_mutex); | 286 | mutex_unlock(&state->ca_mutex); |
292 | return ret; | 287 | return ret; |
@@ -297,7 +292,7 @@ static int az6007_ci_read_cam_control(struct dvb_ca_en50221 *ca, | |||
297 | u8 address) | 292 | u8 address) |
298 | { | 293 | { |
299 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 294 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
300 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 295 | struct az6007_device_state *state = d_to_priv(d); |
301 | 296 | ||
302 | int ret; | 297 | int ret; |
303 | u8 req; | 298 | u8 req; |
@@ -322,14 +317,14 @@ static int az6007_ci_read_cam_control(struct dvb_ca_en50221 *ca, | |||
322 | 317 | ||
323 | ret = az6007_read(d, req, value, index, b, blen); | 318 | ret = az6007_read(d, req, value, index, b, blen); |
324 | if (ret < 0) { | 319 | if (ret < 0) { |
325 | warn("usb in operation failed. (%d)", ret); | 320 | pr_warn("usb in operation failed. (%d)\n", ret); |
326 | ret = -EINVAL; | 321 | ret = -EINVAL; |
327 | } else { | 322 | } else { |
328 | if (b[0] == 0) | 323 | if (b[0] == 0) |
329 | warn("Read CI IO error"); | 324 | pr_warn("Read CI IO error\n"); |
330 | 325 | ||
331 | ret = b[1]; | 326 | ret = b[1]; |
332 | deb_info("read cam data = %x from 0x%x", b[1], value); | 327 | pr_debug("read cam data = %x from 0x%x\n", b[1], value); |
333 | } | 328 | } |
334 | 329 | ||
335 | mutex_unlock(&state->ca_mutex); | 330 | mutex_unlock(&state->ca_mutex); |
@@ -343,7 +338,7 @@ static int az6007_ci_write_cam_control(struct dvb_ca_en50221 *ca, | |||
343 | u8 value) | 338 | u8 value) |
344 | { | 339 | { |
345 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 340 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
346 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 341 | struct az6007_device_state *state = d_to_priv(d); |
347 | 342 | ||
348 | int ret; | 343 | int ret; |
349 | u8 req; | 344 | u8 req; |
@@ -362,7 +357,7 @@ static int az6007_ci_write_cam_control(struct dvb_ca_en50221 *ca, | |||
362 | 357 | ||
363 | ret = az6007_write(d, req, value1, index, NULL, blen); | 358 | ret = az6007_write(d, req, value1, index, NULL, blen); |
364 | if (ret != 0) { | 359 | if (ret != 0) { |
365 | warn("usb out operation failed. (%d)", ret); | 360 | pr_warn("usb out operation failed. (%d)\n", ret); |
366 | goto failed; | 361 | goto failed; |
367 | } | 362 | } |
368 | 363 | ||
@@ -393,7 +388,7 @@ static int CI_CamReady(struct dvb_ca_en50221 *ca, int slot) | |||
393 | 388 | ||
394 | ret = az6007_read(d, req, value, index, b, blen); | 389 | ret = az6007_read(d, req, value, index, b, blen); |
395 | if (ret < 0) { | 390 | if (ret < 0) { |
396 | warn("usb in operation failed. (%d)", ret); | 391 | pr_warn("usb in operation failed. (%d)\n", ret); |
397 | ret = -EIO; | 392 | ret = -EIO; |
398 | } else{ | 393 | } else{ |
399 | ret = b[0]; | 394 | ret = b[0]; |
@@ -405,7 +400,7 @@ static int CI_CamReady(struct dvb_ca_en50221 *ca, int slot) | |||
405 | static int az6007_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot) | 400 | static int az6007_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot) |
406 | { | 401 | { |
407 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 402 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
408 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 403 | struct az6007_device_state *state = d_to_priv(d); |
409 | 404 | ||
410 | int ret, i; | 405 | int ret, i; |
411 | u8 req; | 406 | u8 req; |
@@ -422,7 +417,7 @@ static int az6007_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
422 | 417 | ||
423 | ret = az6007_write(d, req, value, index, NULL, blen); | 418 | ret = az6007_write(d, req, value, index, NULL, blen); |
424 | if (ret != 0) { | 419 | if (ret != 0) { |
425 | warn("usb out operation failed. (%d)", ret); | 420 | pr_warn("usb out operation failed. (%d)\n", ret); |
426 | goto failed; | 421 | goto failed; |
427 | } | 422 | } |
428 | 423 | ||
@@ -434,7 +429,7 @@ static int az6007_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
434 | 429 | ||
435 | ret = az6007_write(d, req, value, index, NULL, blen); | 430 | ret = az6007_write(d, req, value, index, NULL, blen); |
436 | if (ret != 0) { | 431 | if (ret != 0) { |
437 | warn("usb out operation failed. (%d)", ret); | 432 | pr_warn("usb out operation failed. (%d)\n", ret); |
438 | goto failed; | 433 | goto failed; |
439 | } | 434 | } |
440 | 435 | ||
@@ -442,7 +437,7 @@ static int az6007_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
442 | msleep(100); | 437 | msleep(100); |
443 | 438 | ||
444 | if (CI_CamReady(ca, slot)) { | 439 | if (CI_CamReady(ca, slot)) { |
445 | deb_info("CAM Ready"); | 440 | pr_debug("CAM Ready\n"); |
446 | break; | 441 | break; |
447 | } | 442 | } |
448 | } | 443 | } |
@@ -461,7 +456,7 @@ static int az6007_ci_slot_shutdown(struct dvb_ca_en50221 *ca, int slot) | |||
461 | static int az6007_ci_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot) | 456 | static int az6007_ci_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot) |
462 | { | 457 | { |
463 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 458 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
464 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 459 | struct az6007_device_state *state = d_to_priv(d); |
465 | 460 | ||
466 | int ret; | 461 | int ret; |
467 | u8 req; | 462 | u8 req; |
@@ -469,7 +464,7 @@ static int az6007_ci_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot) | |||
469 | u16 index; | 464 | u16 index; |
470 | int blen; | 465 | int blen; |
471 | 466 | ||
472 | deb_info("%s", __func__); | 467 | pr_debug("%s()\n", __func__); |
473 | mutex_lock(&state->ca_mutex); | 468 | mutex_lock(&state->ca_mutex); |
474 | req = 0xC7; | 469 | req = 0xC7; |
475 | value = 1; | 470 | value = 1; |
@@ -478,7 +473,7 @@ static int az6007_ci_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot) | |||
478 | 473 | ||
479 | ret = az6007_write(d, req, value, index, NULL, blen); | 474 | ret = az6007_write(d, req, value, index, NULL, blen); |
480 | if (ret != 0) { | 475 | if (ret != 0) { |
481 | warn("usb out operation failed. (%d)", ret); | 476 | pr_warn("usb out operation failed. (%d)\n", ret); |
482 | goto failed; | 477 | goto failed; |
483 | } | 478 | } |
484 | 479 | ||
@@ -490,7 +485,7 @@ failed: | |||
490 | static int az6007_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open) | 485 | static int az6007_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open) |
491 | { | 486 | { |
492 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; | 487 | struct dvb_usb_device *d = (struct dvb_usb_device *)ca->data; |
493 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 488 | struct az6007_device_state *state = d_to_priv(d); |
494 | int ret; | 489 | int ret; |
495 | u8 req; | 490 | u8 req; |
496 | u16 value; | 491 | u16 value; |
@@ -510,7 +505,7 @@ static int az6007_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int o | |||
510 | 505 | ||
511 | ret = az6007_read(d, req, value, index, b, blen); | 506 | ret = az6007_read(d, req, value, index, b, blen); |
512 | if (ret < 0) { | 507 | if (ret < 0) { |
513 | warn("usb in operation failed. (%d)", ret); | 508 | pr_warn("usb in operation failed. (%d)\n", ret); |
514 | ret = -EIO; | 509 | ret = -EIO; |
515 | } else | 510 | } else |
516 | ret = 0; | 511 | ret = 0; |
@@ -530,12 +525,12 @@ static void az6007_ci_uninit(struct dvb_usb_device *d) | |||
530 | { | 525 | { |
531 | struct az6007_device_state *state; | 526 | struct az6007_device_state *state; |
532 | 527 | ||
533 | deb_info("%s", __func__); | 528 | pr_debug("%s()\n", __func__); |
534 | 529 | ||
535 | if (NULL == d) | 530 | if (NULL == d) |
536 | return; | 531 | return; |
537 | 532 | ||
538 | state = (struct az6007_device_state *)d->priv; | 533 | state = d_to_priv(d); |
539 | if (NULL == state) | 534 | if (NULL == state) |
540 | return; | 535 | return; |
541 | 536 | ||
@@ -548,16 +543,15 @@ static void az6007_ci_uninit(struct dvb_usb_device *d) | |||
548 | } | 543 | } |
549 | 544 | ||
550 | 545 | ||
551 | static int az6007_ci_init(struct dvb_usb_adapter *a) | 546 | static int az6007_ci_init(struct dvb_usb_adapter *adap) |
552 | { | 547 | { |
553 | struct dvb_usb_device *d = a->dev; | 548 | struct dvb_usb_device *d = adap_to_d(adap); |
554 | struct az6007_device_state *state = (struct az6007_device_state *)d->priv; | 549 | struct az6007_device_state *state = adap_to_priv(adap); |
555 | int ret; | 550 | int ret; |
556 | 551 | ||
557 | deb_info("%s", __func__); | 552 | pr_debug("%s()\n", __func__); |
558 | 553 | ||
559 | mutex_init(&state->ca_mutex); | 554 | mutex_init(&state->ca_mutex); |
560 | |||
561 | state->ca.owner = THIS_MODULE; | 555 | state->ca.owner = THIS_MODULE; |
562 | state->ca.read_attribute_mem = az6007_ci_read_attribute_mem; | 556 | state->ca.read_attribute_mem = az6007_ci_read_attribute_mem; |
563 | state->ca.write_attribute_mem = az6007_ci_write_attribute_mem; | 557 | state->ca.write_attribute_mem = az6007_ci_write_attribute_mem; |
@@ -569,49 +563,51 @@ static int az6007_ci_init(struct dvb_usb_adapter *a) | |||
569 | state->ca.poll_slot_status = az6007_ci_poll_slot_status; | 563 | state->ca.poll_slot_status = az6007_ci_poll_slot_status; |
570 | state->ca.data = d; | 564 | state->ca.data = d; |
571 | 565 | ||
572 | ret = dvb_ca_en50221_init(&a->dvb_adap, | 566 | ret = dvb_ca_en50221_init(&adap->dvb_adap, |
573 | &state->ca, | 567 | &state->ca, |
574 | 0, /* flags */ | 568 | 0, /* flags */ |
575 | 1);/* n_slots */ | 569 | 1);/* n_slots */ |
576 | if (ret != 0) { | 570 | if (ret != 0) { |
577 | err("Cannot initialize CI: Error %d.", ret); | 571 | pr_err("Cannot initialize CI: Error %d.\n", ret); |
578 | memset(&state->ca, 0, sizeof(state->ca)); | 572 | memset(&state->ca, 0, sizeof(state->ca)); |
579 | return ret; | 573 | return ret; |
580 | } | 574 | } |
581 | 575 | ||
582 | deb_info("CI initialized."); | 576 | pr_debug("CI initialized.\n"); |
583 | 577 | ||
584 | return 0; | 578 | return 0; |
585 | } | 579 | } |
586 | 580 | ||
587 | static int az6007_read_mac_addr(struct dvb_usb_device *d, u8 mac[6]) | 581 | static int az6007_read_mac_addr(struct dvb_usb_adapter *adap, u8 mac[6]) |
588 | { | 582 | { |
589 | struct az6007_device_state *st = d->priv; | 583 | struct dvb_usb_device *d = adap_to_d(adap); |
584 | struct az6007_device_state *st = adap_to_priv(adap); | ||
590 | int ret; | 585 | int ret; |
591 | 586 | ||
592 | ret = az6007_read(d, AZ6007_READ_DATA, 6, 0, st->data, 6); | 587 | ret = az6007_read(d, AZ6007_READ_DATA, 6, 0, st->data, 6); |
593 | memcpy(mac, st->data, 6); | 588 | memcpy(mac, st->data, 6); |
594 | 589 | ||
595 | if (ret > 0) | 590 | if (ret > 0) |
596 | deb_info("%s: mac is %pM\n", __func__, mac); | 591 | pr_debug("%s: mac is %pM\n", __func__, mac); |
597 | 592 | ||
598 | return ret; | 593 | return ret; |
599 | } | 594 | } |
600 | 595 | ||
601 | static int az6007_frontend_attach(struct dvb_usb_adapter *adap) | 596 | static int az6007_frontend_attach(struct dvb_usb_adapter *adap) |
602 | { | 597 | { |
603 | struct az6007_device_state *st = adap->dev->priv; | 598 | struct az6007_device_state *st = adap_to_priv(adap); |
599 | struct dvb_usb_device *d = adap_to_d(adap); | ||
604 | 600 | ||
605 | deb_info("attaching demod drxk"); | 601 | pr_debug("attaching demod drxk\n"); |
606 | 602 | ||
607 | adap->fe_adap[0].fe = dvb_attach(drxk_attach, &terratec_h7_drxk, | 603 | adap->fe[0] = dvb_attach(drxk_attach, &terratec_h7_drxk, |
608 | &adap->dev->i2c_adap); | 604 | &d->i2c_adap); |
609 | if (!adap->fe_adap[0].fe) | 605 | if (!adap->fe[0]) |
610 | return -EINVAL; | 606 | return -EINVAL; |
611 | 607 | ||
612 | adap->fe_adap[0].fe->sec_priv = adap; | 608 | adap->fe[0]->sec_priv = adap; |
613 | st->gate_ctrl = adap->fe_adap[0].fe->ops.i2c_gate_ctrl; | 609 | st->gate_ctrl = adap->fe[0]->ops.i2c_gate_ctrl; |
614 | adap->fe_adap[0].fe->ops.i2c_gate_ctrl = drxk_gate_ctrl; | 610 | adap->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl; |
615 | 611 | ||
616 | az6007_ci_init(adap); | 612 | az6007_ci_init(adap); |
617 | 613 | ||
@@ -620,28 +616,30 @@ static int az6007_frontend_attach(struct dvb_usb_adapter *adap) | |||
620 | 616 | ||
621 | static int az6007_tuner_attach(struct dvb_usb_adapter *adap) | 617 | static int az6007_tuner_attach(struct dvb_usb_adapter *adap) |
622 | { | 618 | { |
623 | deb_info("attaching tuner mt2063"); | 619 | struct dvb_usb_device *d = adap_to_d(adap); |
620 | |||
621 | pr_debug("attaching tuner mt2063\n"); | ||
624 | 622 | ||
625 | /* Attach mt2063 to DVB-C frontend */ | 623 | /* Attach mt2063 to DVB-C frontend */ |
626 | if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl) | 624 | if (adap->fe[0]->ops.i2c_gate_ctrl) |
627 | adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1); | 625 | adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], 1); |
628 | if (!dvb_attach(mt2063_attach, adap->fe_adap[0].fe, | 626 | if (!dvb_attach(mt2063_attach, adap->fe[0], |
629 | &az6007_mt2063_config, | 627 | &az6007_mt2063_config, |
630 | &adap->dev->i2c_adap)) | 628 | &d->i2c_adap)) |
631 | return -EINVAL; | 629 | return -EINVAL; |
632 | 630 | ||
633 | if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl) | 631 | if (adap->fe[0]->ops.i2c_gate_ctrl) |
634 | adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0); | 632 | adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], 0); |
635 | 633 | ||
636 | return 0; | 634 | return 0; |
637 | } | 635 | } |
638 | 636 | ||
639 | int az6007_power_ctrl(struct dvb_usb_device *d, int onoff) | 637 | int az6007_power_ctrl(struct dvb_usb_device *d, int onoff) |
640 | { | 638 | { |
641 | struct az6007_device_state *st = d->priv; | 639 | struct az6007_device_state *st = d_to_priv(d); |
642 | int ret; | 640 | int ret; |
643 | 641 | ||
644 | deb_info("%s()\n", __func__); | 642 | pr_debug("%s()\n", __func__); |
645 | 643 | ||
646 | if (!st->warm) { | 644 | if (!st->warm) { |
647 | mutex_init(&st->mutex); | 645 | mutex_init(&st->mutex); |
@@ -694,7 +692,7 @@ static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | |||
694 | int num) | 692 | int num) |
695 | { | 693 | { |
696 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 694 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
697 | struct az6007_device_state *st = d->priv; | 695 | struct az6007_device_state *st = d_to_priv(d); |
698 | int i, j, len; | 696 | int i, j, len; |
699 | int ret = 0; | 697 | int ret = 0; |
700 | u16 index; | 698 | u16 index; |
@@ -717,9 +715,8 @@ static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | |||
717 | * the first xfer has just 1 byte length. | 715 | * the first xfer has just 1 byte length. |
718 | * Need to join both into one operation | 716 | * Need to join both into one operation |
719 | */ | 717 | */ |
720 | if (dvb_usb_az6007_debug & 2) | 718 | if (az6007_xfer_debug) |
721 | printk(KERN_DEBUG | 719 | printk(KERN_DEBUG "az6007: I2C W/R addr=0x%x len=%d/%d\n", |
722 | "az6007 I2C xfer write+read addr=0x%x len=%d/%d: ", | ||
723 | addr, msgs[i].len, msgs[i + 1].len); | 720 | addr, msgs[i].len, msgs[i + 1].len); |
724 | req = AZ6007_I2C_RD; | 721 | req = AZ6007_I2C_RD; |
725 | index = msgs[i].buf[0]; | 722 | index = msgs[i].buf[0]; |
@@ -729,42 +726,29 @@ static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | |||
729 | ret = __az6007_read(d->udev, req, value, index, | 726 | ret = __az6007_read(d->udev, req, value, index, |
730 | st->data, length); | 727 | st->data, length); |
731 | if (ret >= len) { | 728 | if (ret >= len) { |
732 | for (j = 0; j < len; j++) { | 729 | for (j = 0; j < len; j++) |
733 | msgs[i + 1].buf[j] = st->data[j + 5]; | 730 | msgs[i + 1].buf[j] = st->data[j + 5]; |
734 | if (dvb_usb_az6007_debug & 2) | ||
735 | printk(KERN_CONT | ||
736 | "0x%02x ", | ||
737 | msgs[i + 1].buf[j]); | ||
738 | } | ||
739 | } else | 731 | } else |
740 | ret = -EIO; | 732 | ret = -EIO; |
741 | i++; | 733 | i++; |
742 | } else if (!(msgs[i].flags & I2C_M_RD)) { | 734 | } else if (!(msgs[i].flags & I2C_M_RD)) { |
743 | /* write bytes */ | 735 | /* write bytes */ |
744 | if (dvb_usb_az6007_debug & 2) | 736 | if (az6007_xfer_debug) |
745 | printk(KERN_DEBUG | 737 | printk(KERN_DEBUG "az6007: I2C W addr=0x%x len=%d\n", |
746 | "az6007 I2C xfer write addr=0x%x len=%d: ", | ||
747 | addr, msgs[i].len); | 738 | addr, msgs[i].len); |
748 | req = AZ6007_I2C_WR; | 739 | req = AZ6007_I2C_WR; |
749 | index = msgs[i].buf[0]; | 740 | index = msgs[i].buf[0]; |
750 | value = addr | (1 << 8); | 741 | value = addr | (1 << 8); |
751 | length = msgs[i].len - 1; | 742 | length = msgs[i].len - 1; |
752 | len = msgs[i].len - 1; | 743 | len = msgs[i].len - 1; |
753 | if (dvb_usb_az6007_debug & 2) | 744 | for (j = 0; j < len; j++) |
754 | printk(KERN_CONT "(0x%02x) ", msgs[i].buf[0]); | ||
755 | for (j = 0; j < len; j++) { | ||
756 | st->data[j] = msgs[i].buf[j + 1]; | 745 | st->data[j] = msgs[i].buf[j + 1]; |
757 | if (dvb_usb_az6007_debug & 2) | ||
758 | printk(KERN_CONT "0x%02x ", | ||
759 | st->data[j]); | ||
760 | } | ||
761 | ret = __az6007_write(d->udev, req, value, index, | 746 | ret = __az6007_write(d->udev, req, value, index, |
762 | st->data, length); | 747 | st->data, length); |
763 | } else { | 748 | } else { |
764 | /* read bytes */ | 749 | /* read bytes */ |
765 | if (dvb_usb_az6007_debug & 2) | 750 | if (az6007_xfer_debug) |
766 | printk(KERN_DEBUG | 751 | printk(KERN_DEBUG "az6007: I2C R addr=0x%x len=%d\n", |
767 | "az6007 I2C xfer read addr=0x%x len=%d: ", | ||
768 | addr, msgs[i].len); | 752 | addr, msgs[i].len); |
769 | req = AZ6007_I2C_RD; | 753 | req = AZ6007_I2C_RD; |
770 | index = msgs[i].buf[0]; | 754 | index = msgs[i].buf[0]; |
@@ -773,15 +757,9 @@ static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | |||
773 | len = msgs[i].len; | 757 | len = msgs[i].len; |
774 | ret = __az6007_read(d->udev, req, value, index, | 758 | ret = __az6007_read(d->udev, req, value, index, |
775 | st->data, length); | 759 | st->data, length); |
776 | for (j = 0; j < len; j++) { | 760 | for (j = 0; j < len; j++) |
777 | msgs[i].buf[j] = st->data[j + 5]; | 761 | msgs[i].buf[j] = st->data[j + 5]; |
778 | if (dvb_usb_az6007_debug & 2) | ||
779 | printk(KERN_CONT | ||
780 | "0x%02x ", st->data[j + 5]); | ||
781 | } | ||
782 | } | 762 | } |
783 | if (dvb_usb_az6007_debug & 2) | ||
784 | printk(KERN_CONT "\n"); | ||
785 | if (ret < 0) | 763 | if (ret < 0) |
786 | goto err; | 764 | goto err; |
787 | } | 765 | } |
@@ -789,7 +767,7 @@ err: | |||
789 | mutex_unlock(&st->mutex); | 767 | mutex_unlock(&st->mutex); |
790 | 768 | ||
791 | if (ret < 0) { | 769 | if (ret < 0) { |
792 | info("%s ERROR: %i", __func__, ret); | 770 | pr_info("%s ERROR: %i\n", __func__, ret); |
793 | return ret; | 771 | return ret; |
794 | } | 772 | } |
795 | return num; | 773 | return num; |
@@ -805,151 +783,115 @@ static struct i2c_algorithm az6007_i2c_algo = { | |||
805 | .functionality = az6007_i2c_func, | 783 | .functionality = az6007_i2c_func, |
806 | }; | 784 | }; |
807 | 785 | ||
808 | int az6007_identify_state(struct usb_device *udev, | 786 | int az6007_identify_state(struct dvb_usb_device *d, const char **name) |
809 | struct dvb_usb_device_properties *props, | ||
810 | struct dvb_usb_device_description **desc, int *cold) | ||
811 | { | 787 | { |
812 | int ret; | 788 | int ret; |
813 | u8 *mac; | 789 | u8 *mac; |
814 | 790 | ||
791 | pr_debug("Identifying az6007 state\n"); | ||
792 | |||
815 | mac = kmalloc(6, GFP_ATOMIC); | 793 | mac = kmalloc(6, GFP_ATOMIC); |
816 | if (!mac) | 794 | if (!mac) |
817 | return -ENOMEM; | 795 | return -ENOMEM; |
818 | 796 | ||
819 | /* Try to read the mac address */ | 797 | /* Try to read the mac address */ |
820 | ret = __az6007_read(udev, AZ6007_READ_DATA, 6, 0, mac, 6); | 798 | ret = __az6007_read(d->udev, AZ6007_READ_DATA, 6, 0, mac, 6); |
821 | if (ret == 6) | 799 | if (ret == 6) |
822 | *cold = 0; | 800 | ret = WARM; |
823 | else | 801 | else |
824 | *cold = 1; | 802 | ret = COLD; |
825 | 803 | ||
826 | kfree(mac); | 804 | kfree(mac); |
827 | 805 | ||
828 | if (*cold) { | 806 | if (ret == COLD) { |
829 | __az6007_write(udev, 0x09, 1, 0, NULL, 0); | 807 | __az6007_write(d->udev, 0x09, 1, 0, NULL, 0); |
830 | __az6007_write(udev, 0x00, 0, 0, NULL, 0); | 808 | __az6007_write(d->udev, 0x00, 0, 0, NULL, 0); |
831 | __az6007_write(udev, 0x00, 0, 0, NULL, 0); | 809 | __az6007_write(d->udev, 0x00, 0, 0, NULL, 0); |
832 | } | 810 | } |
833 | 811 | ||
834 | deb_info("Device is on %s state\n", *cold ? "warm" : "cold"); | 812 | pr_debug("Device is on %s state\n", |
835 | return 0; | 813 | ret == WARM ? "warm" : "cold"); |
814 | return ret; | ||
836 | } | 815 | } |
837 | 816 | ||
838 | static struct dvb_usb_device_properties az6007_properties; | ||
839 | |||
840 | static void az6007_usb_disconnect(struct usb_interface *intf) | 817 | static void az6007_usb_disconnect(struct usb_interface *intf) |
841 | { | 818 | { |
842 | struct dvb_usb_device *d = usb_get_intfdata(intf); | 819 | struct dvb_usb_device *d = usb_get_intfdata(intf); |
843 | az6007_ci_uninit(d); | 820 | az6007_ci_uninit(d); |
844 | dvb_usb_device_exit(intf); | 821 | dvb_usbv2_disconnect(intf); |
845 | } | 822 | } |
846 | 823 | ||
847 | static int az6007_usb_probe(struct usb_interface *intf, | 824 | static int az6007_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc) |
848 | const struct usb_device_id *id) | ||
849 | { | 825 | { |
850 | return dvb_usb_device_init(intf, &az6007_properties, | 826 | pr_debug("Getting az6007 Remote Control properties\n"); |
851 | THIS_MODULE, NULL, adapter_nr); | 827 | |
828 | rc->allowed_protos = RC_TYPE_NEC; | ||
829 | rc->query = az6007_rc_query; | ||
830 | rc->interval = 400; | ||
831 | |||
832 | return 0; | ||
852 | } | 833 | } |
853 | 834 | ||
854 | static struct usb_device_id az6007_usb_table[] = { | 835 | static int az6007_download_firmware(struct dvb_usb_device *d, |
855 | {USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007)}, | 836 | const struct firmware *fw) |
856 | {USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7)}, | 837 | { |
857 | {USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7_2)}, | 838 | pr_debug("Loading az6007 firmware\n"); |
858 | {0}, | ||
859 | }; | ||
860 | 839 | ||
861 | MODULE_DEVICE_TABLE(usb, az6007_usb_table); | 840 | return usbv2_cypress_load_firmware(d->udev, fw, CYPRESS_FX2); |
841 | } | ||
862 | 842 | ||
863 | static struct dvb_usb_device_properties az6007_properties = { | 843 | /* DVB USB Driver stuff */ |
864 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 844 | static struct dvb_usb_device_properties az6007_props = { |
865 | .usb_ctrl = CYPRESS_FX2, | 845 | .driver_name = KBUILD_MODNAME, |
866 | .firmware = "dvb-usb-terratec-h7-az6007.fw", | 846 | .owner = THIS_MODULE, |
867 | .no_reconnect = 1, | 847 | .firmware = AZ6007_FIRMWARE, |
848 | |||
849 | .adapter_nr = adapter_nr, | ||
868 | .size_of_priv = sizeof(struct az6007_device_state), | 850 | .size_of_priv = sizeof(struct az6007_device_state), |
851 | .i2c_algo = &az6007_i2c_algo, | ||
852 | .tuner_attach = az6007_tuner_attach, | ||
853 | .frontend_attach = az6007_frontend_attach, | ||
854 | .streaming_ctrl = az6007_streaming_ctrl, | ||
855 | .get_rc_config = az6007_get_rc_config, | ||
856 | .read_mac_address = az6007_read_mac_addr, | ||
857 | .download_firmware = az6007_download_firmware, | ||
869 | .identify_state = az6007_identify_state, | 858 | .identify_state = az6007_identify_state, |
870 | .num_adapters = 1, | 859 | .power_ctrl = az6007_power_ctrl, |
871 | .adapter = { | 860 | .num_adapters = 1, |
872 | { | 861 | .adapter = { |
873 | .num_frontends = 1, | 862 | { .stream = DVB_USB_STREAM_BULK(0x02, 10, 4096), } |
874 | .fe = {{ | ||
875 | .streaming_ctrl = az6007_streaming_ctrl, | ||
876 | .tuner_attach = az6007_tuner_attach, | ||
877 | .frontend_attach = az6007_frontend_attach, | ||
878 | |||
879 | /* parameter for the MPEG2-data transfer */ | ||
880 | .stream = { | ||
881 | .type = USB_BULK, | ||
882 | .count = 10, | ||
883 | .endpoint = 0x02, | ||
884 | .u = { | ||
885 | .bulk = { | ||
886 | .buffersize = 4096, | ||
887 | } | ||
888 | } | ||
889 | }, | ||
890 | } } | ||
891 | } }, | ||
892 | .power_ctrl = az6007_power_ctrl, | ||
893 | .read_mac_address = az6007_read_mac_addr, | ||
894 | |||
895 | .rc.core = { | ||
896 | .rc_interval = 400, | ||
897 | .rc_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS, | ||
898 | .module_name = "az6007", | ||
899 | .rc_query = az6007_rc_query, | ||
900 | .allowed_protos = RC_TYPE_NEC, | ||
901 | }, | ||
902 | .i2c_algo = &az6007_i2c_algo, | ||
903 | |||
904 | .num_device_descs = 2, | ||
905 | .devices = { | ||
906 | { .name = "AzureWave DTV StarBox DVB-T/C USB2.0 (az6007)", | ||
907 | .cold_ids = { &az6007_usb_table[0], NULL }, | ||
908 | .warm_ids = { NULL }, | ||
909 | }, | ||
910 | { .name = "TerraTec DTV StarBox DVB-T/C USB2.0 (az6007)", | ||
911 | .cold_ids = { &az6007_usb_table[1], &az6007_usb_table[2], NULL }, | ||
912 | .warm_ids = { NULL }, | ||
913 | }, | ||
914 | { NULL }, | ||
915 | } | 863 | } |
916 | }; | 864 | }; |
917 | 865 | ||
866 | static struct usb_device_id az6007_usb_table[] = { | ||
867 | {DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007, | ||
868 | &az6007_props, "Azurewave 6007", RC_MAP_EMPTY)}, | ||
869 | {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7, | ||
870 | &az6007_props, "Terratec H7", RC_MAP_NEC_TERRATEC_CINERGY_XS)}, | ||
871 | {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7_2, | ||
872 | &az6007_props, "Terratec H7", RC_MAP_NEC_TERRATEC_CINERGY_XS)}, | ||
873 | {0}, | ||
874 | }; | ||
875 | |||
876 | MODULE_DEVICE_TABLE(usb, az6007_usb_table); | ||
877 | |||
918 | /* usb specific object needed to register this driver with the usb subsystem */ | 878 | /* usb specific object needed to register this driver with the usb subsystem */ |
919 | static struct usb_driver az6007_usb_driver = { | 879 | static struct usb_driver az6007_usb_driver = { |
920 | .name = "dvb_usb_az6007", | 880 | .name = KBUILD_MODNAME, |
921 | .probe = az6007_usb_probe, | ||
922 | .disconnect = az6007_usb_disconnect, | ||
923 | .id_table = az6007_usb_table, | 881 | .id_table = az6007_usb_table, |
882 | .probe = dvb_usbv2_probe, | ||
883 | .disconnect = az6007_usb_disconnect, | ||
884 | .suspend = dvb_usbv2_suspend, | ||
885 | .resume = dvb_usbv2_resume, | ||
886 | .no_dynamic_id = 1, | ||
887 | .soft_unbind = 1, | ||
924 | }; | 888 | }; |
925 | 889 | ||
926 | /* module stuff */ | 890 | module_usb_driver(az6007_usb_driver); |
927 | static int __init az6007_usb_module_init(void) | ||
928 | { | ||
929 | int result; | ||
930 | deb_info("az6007 usb module init\n"); | ||
931 | |||
932 | result = usb_register(&az6007_usb_driver); | ||
933 | if (result) { | ||
934 | err("usb_register failed. (%d)", result); | ||
935 | return result; | ||
936 | } | ||
937 | |||
938 | return 0; | ||
939 | } | ||
940 | |||
941 | static void __exit az6007_usb_module_exit(void) | ||
942 | { | ||
943 | /* deregister this driver from the USB subsystem */ | ||
944 | deb_info("az6007 usb module exit\n"); | ||
945 | usb_deregister(&az6007_usb_driver); | ||
946 | } | ||
947 | |||
948 | module_init(az6007_usb_module_init); | ||
949 | module_exit(az6007_usb_module_exit); | ||
950 | 891 | ||
951 | MODULE_AUTHOR("Henry Wang <Henry.wang@AzureWave.com>"); | 892 | MODULE_AUTHOR("Henry Wang <Henry.wang@AzureWave.com>"); |
952 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); | 893 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); |
953 | MODULE_DESCRIPTION("Driver for AzureWave 6007 DVB-C/T USB2.0 and clones"); | 894 | MODULE_DESCRIPTION("Driver for AzureWave 6007 DVB-C/T USB2.0 and clones"); |
954 | MODULE_VERSION("1.1"); | 895 | MODULE_VERSION("2.0"); |
955 | MODULE_LICENSE("GPL"); | 896 | MODULE_LICENSE("GPL"); |
897 | MODULE_FIRMWARE(AZ6007_FIRMWARE); | ||
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 67b91b74976f..29bba9a24875 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -296,14 +296,6 @@ config DVB_USB_FRIIO | |||
296 | help | 296 | help |
297 | Say Y here to support the Japanese DTV receiver Friio. | 297 | Say Y here to support the Japanese DTV receiver Friio. |
298 | 298 | ||
299 | config DVB_USB_AZ6007 | ||
300 | tristate "AzureWave 6007 and clones DVB-T/C USB2.0 support" | ||
301 | depends on DVB_USB | ||
302 | select DVB_DRXK if !DVB_FE_CUSTOMISE | ||
303 | select MEDIA_TUNER_MT2063 if !DVB_FE_CUSTOMISE | ||
304 | help | ||
305 | Say Y here to support theAfatech AF9005 based DVB-T/DVB-C receivers. | ||
306 | |||
307 | config DVB_USB_AZ6027 | 299 | config DVB_USB_AZ6027 |
308 | tristate "Azurewave DVB-S/S2 USB2.0 AZ6027 support" | 300 | tristate "Azurewave DVB-S/S2 USB2.0 AZ6027 support" |
309 | depends on DVB_USB | 301 | depends on DVB_USB |
diff --git a/drivers/media/dvb/dvb-usb/Makefile b/drivers/media/dvb/dvb-usb/Makefile index 4b70599b38d9..5261c7dae982 100644 --- a/drivers/media/dvb/dvb-usb/Makefile +++ b/drivers/media/dvb/dvb-usb/Makefile | |||
@@ -69,9 +69,6 @@ obj-$(CONFIG_DVB_USB_CINERGY_T2) += dvb-usb-cinergyT2.o | |||
69 | dvb-usb-friio-objs = friio.o friio-fe.o | 69 | dvb-usb-friio-objs = friio.o friio-fe.o |
70 | obj-$(CONFIG_DVB_USB_FRIIO) += dvb-usb-friio.o | 70 | obj-$(CONFIG_DVB_USB_FRIIO) += dvb-usb-friio.o |
71 | 71 | ||
72 | dvb-usb-az6007-objs = az6007.o | ||
73 | obj-$(CONFIG_DVB_USB_AZ6007) += dvb-usb-az6007.o | ||
74 | |||
75 | dvb-usb-az6027-objs = az6027.o | 72 | dvb-usb-az6027-objs = az6027.o |
76 | obj-$(CONFIG_DVB_USB_AZ6027) += dvb-usb-az6027.o | 73 | obj-$(CONFIG_DVB_USB_AZ6027) += dvb-usb-az6027.o |
77 | 74 | ||