|
11 | 11 | * design, so it can be reused for the "analogue-only" device (if it will
|
12 | 12 | * appear at all).
|
13 | 13 | *
|
14 |
| - * TODO: check if the cx25840-driver (from ivtv) can be used for the analogue |
15 |
| - * part |
| 14 | + * Use the cx25840-driver for the analogue part |
16 | 15 | *
|
17 | 16 | * Copyright (C) 2005 Patrick Boettcher ([email protected])
|
18 | 17 | * Copyright (C) 2005 Michael Krufky ([email protected])
|
@@ -343,6 +342,30 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
|
343 | 342 | return -EIO;
|
344 | 343 | }
|
345 | 344 |
|
| 345 | +/* |
| 346 | + * DViCO bluebird firmware needs the "warm" product ID to be patched into the |
| 347 | + * firmware file before download. |
| 348 | + */ |
| 349 | + |
| 350 | +#define BLUEBIRD_01_ID_OFFSET 6638 |
| 351 | +static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const struct firmware *fw) |
| 352 | +{ |
| 353 | + if (fw->size < BLUEBIRD_01_ID_OFFSET + 4) |
| 354 | + return -EINVAL; |
| 355 | + |
| 356 | + if (fw->data[BLUEBIRD_01_ID_OFFSET] == (USB_VID_DVICO & 0xff) && |
| 357 | + fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) { |
| 358 | + |
| 359 | + /* FIXME: are we allowed to change the fw-data ? */ |
| 360 | + fw->data[BLUEBIRD_01_ID_OFFSET + 2] = udev->descriptor.idProduct + 1; |
| 361 | + fw->data[BLUEBIRD_01_ID_OFFSET + 3] = udev->descriptor.idProduct >> 8; |
| 362 | + |
| 363 | + return usb_cypress_load_firmware(udev,fw,CYPRESS_FX2); |
| 364 | + } |
| 365 | + |
| 366 | + return -EINVAL; |
| 367 | +} |
| 368 | + |
346 | 369 | /* DVB USB Driver stuff */
|
347 | 370 | static struct dvb_usb_properties cxusb_medion_properties;
|
348 | 371 | static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
|
@@ -409,8 +432,9 @@ static struct dvb_usb_properties cxusb_medion_properties = {
|
409 | 432 | static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
|
410 | 433 | .caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
411 | 434 |
|
412 |
| - .usb_ctrl = CYPRESS_FX2, |
413 |
| - .firmware = "dvb-usb-bluebird-01.fw", |
| 435 | + .usb_ctrl = DEVICE_SPECIFIC, |
| 436 | + .firmware = "dvb-usb-bluebird-01.fw", |
| 437 | + .download_firmware = bluebird_patch_dvico_firmware_download, |
414 | 438 | /* use usb alt setting 0 for EP4 transfer (dvb-t),
|
415 | 439 | use usb alt setting 7 for EP2 transfer (atsc) */
|
416 | 440 |
|
@@ -448,8 +472,9 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
|
448 | 472 | static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
|
449 | 473 | .caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
450 | 474 |
|
451 |
| - .usb_ctrl = CYPRESS_FX2, |
452 |
| - .firmware = "dvb-usb-bluebird-01.fw", |
| 475 | + .usb_ctrl = DEVICE_SPECIFIC, |
| 476 | + .firmware = "dvb-usb-bluebird-01.fw", |
| 477 | + .download_firmware = bluebird_patch_dvico_firmware_download, |
453 | 478 | /* use usb alt setting 0 for EP4 transfer (dvb-t),
|
454 | 479 | use usb alt setting 7 for EP2 transfer (atsc) */
|
455 | 480 |
|
|
0 commit comments