diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-firmware.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c index 51ce7403999b..b2670476c3f2 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | |||
@@ -74,6 +74,27 @@ static int usb_cypress_load_firmware(struct usb_device *udev, const struct firmw | |||
74 | return ret; | 74 | return ret; |
75 | } | 75 | } |
76 | 76 | ||
77 | /* | ||
78 | * DViCO bluebird firmware needs the "warm" product ID to be patched into the | ||
79 | * firmware file before download. | ||
80 | */ | ||
81 | #define BLUEBIRD_01_ID_OFFSET 6638 | ||
82 | static int dvb_usb_patch_dvico_firmware(struct usb_device *udev, const struct firmware *fw) | ||
83 | { | ||
84 | if (fw->size < BLUEBIRD_01_ID_OFFSET + 4) | ||
85 | return -EINVAL; | ||
86 | |||
87 | if (fw->data[BLUEBIRD_01_ID_OFFSET] == (USB_VID_DVICO & 0xff) && | ||
88 | fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) { | ||
89 | fw->data[BLUEBIRD_01_ID_OFFSET + 2] = udev->descriptor.idProduct + 1; | ||
90 | fw->data[BLUEBIRD_01_ID_OFFSET + 3] = udev->descriptor.idProduct >> 8; | ||
91 | |||
92 | return 0; | ||
93 | } | ||
94 | |||
95 | return -EINVAL; | ||
96 | } | ||
97 | |||
77 | int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties *props) | 98 | int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties *props) |
78 | { | 99 | { |
79 | int ret; | 100 | int ret; |
@@ -88,6 +109,12 @@ int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties | |||
88 | 109 | ||
89 | info("downloading firmware from file '%s'",props->firmware); | 110 | info("downloading firmware from file '%s'",props->firmware); |
90 | 111 | ||
112 | if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_DVICO) { | ||
113 | ret = dvb_usb_patch_dvico_firmware(udev, fw); | ||
114 | if (ret != 0) | ||
115 | warn("this firmware file not recognised"); | ||
116 | } | ||
117 | |||
91 | switch (props->usb_ctrl) { | 118 | switch (props->usb_ctrl) { |
92 | case CYPRESS_AN2135: | 119 | case CYPRESS_AN2135: |
93 | case CYPRESS_AN2235: | 120 | case CYPRESS_AN2235: |