/* dvb-usb-firmware.c is part of the DVB USB library.
*
- * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
+ * Copyright (C) 2004-6 Patrick Boettcher (patrick.boettcher@desy.de)
* see dvb-usb-init.c for copyright information.
*
* This file contains functions for downloading the firmware to Cypress FX 1 and 2 based devices.
0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5000);
}
-static int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
+int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
{
struct hexline hx;
u8 reset;
return ret;
}
+EXPORT_SYMBOL(usb_cypress_load_firmware);
-/*
- * 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 dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_device_properties *props)
{
int ret;
const struct firmware *fw = NULL;
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:
return ret;
}
-int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, int *pos)
+int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
+ int *pos)
{
u8 *b = (u8 *) &fw->data[*pos];
int data_offs = 4;
return *pos;
}
EXPORT_SYMBOL(dvb_usb_get_hexline);
-