summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
diff options
context:
space:
mode:
authorChristopher Pascoe <devnull@localhost>2006-01-08 03:23:04 +0000
committerChristopher Pascoe <devnull@localhost>2006-01-08 03:23:04 +0000
commitb92a5b6bf9b5fce795809ef4ab8ef94a1927c7ea (patch)
tree976ffcdd9090eaa01ec58a5ff03ddf2e313303c7 /linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
parent3c0895a37511816c7ded2787e119e016705ff160 (diff)
downloadmediapointer-dvb-s2-b92a5b6bf9b5fce795809ef4ab8ef94a1927c7ea.tar.gz
mediapointer-dvb-s2-b92a5b6bf9b5fce795809ef4ab8ef94a1927c7ea.tar.bz2
DViCO Dual Digital DVB-T / USB bluebird updates
Add support for the USB portion of the DViCO Dual Digital board. Patch correct "warm" USB IDs into bluebird firmware before download. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c')
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
index 51ce74039..b2670476c 100644
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
+++ b/linux/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
return ret;
}
+/*
+ * DViCO bluebird firmware needs the "warm" product ID to be patched into the
+ * firmware file before download.
+ */
+#define BLUEBIRD_01_ID_OFFSET 6638
+static int dvb_usb_patch_dvico_firmware(struct usb_device *udev, const struct firmware *fw)
+{
+ if (fw->size < BLUEBIRD_01_ID_OFFSET + 4)
+ return -EINVAL;
+
+ if (fw->data[BLUEBIRD_01_ID_OFFSET] == (USB_VID_DVICO & 0xff) &&
+ fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) {
+ fw->data[BLUEBIRD_01_ID_OFFSET + 2] = udev->descriptor.idProduct + 1;
+ fw->data[BLUEBIRD_01_ID_OFFSET + 3] = udev->descriptor.idProduct >> 8;
+
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties *props)
{
int ret;
@@ -88,6 +109,12 @@ int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties
info("downloading firmware from file '%s'",props->firmware);
+ if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_DVICO) {
+ ret = dvb_usb_patch_dvico_firmware(udev, fw);
+ if (ret != 0)
+ warn("this firmware file not recognised");
+ }
+
switch (props->usb_ctrl) {
case CYPRESS_AN2135:
case CYPRESS_AN2235: