diff options
author | Marco Gittler <g.marco@freenet.de> | 2007-07-04 19:18:34 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-18 14:24:41 -0300 |
commit | 59800555f79a52394c3c29e19e448b4635daf14c (patch) | |
tree | a6540f53684f2939bc89b26f2d72770a09d5c53e /drivers/media | |
parent | b31c33bd8b339e426138dd267ec969291f802a0d (diff) | |
download | kernel_samsung_smdk4412-59800555f79a52394c3c29e19e448b4635daf14c.zip kernel_samsung_smdk4412-59800555f79a52394c3c29e19e448b4635daf14c.tar.gz kernel_samsung_smdk4412-59800555f79a52394c3c29e19e448b4635daf14c.tar.bz2 |
V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update
Better way of creating and loading the firmware used.
Update for get_dvb_firmware script to extract the files for opera usb-box
Help file for creating the firmware added
Signed-off-by: Marco Gittler <g.marco@freenet.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/opera1.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index cdb0221..d7c0495 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c @@ -435,9 +435,9 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, { const struct firmware *fw = NULL; u8 *b, *p; - int ret = 0, i; + int ret = 0, i,fpgasize=40; u8 testval; - info("start downloading fpga firmware"); + info("start downloading fpga firmware %s",filename); if ((ret = request_firmware(&fw, filename, &dev->dev)) != 0) { err("did not find the firmware file. (%s) " @@ -454,17 +454,20 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, /* clear fpga ? */ opera1_xilinx_rw(dev, 0xbc, 0xaa, &fpga_command, 1, OPERA_WRITE_MSG); - for (i = 0; p[i] != 0 && i < fw->size;) { + for (i = 0; i < fw->size;) { + if ( (fw->size - i) <fpgasize){ + fpgasize=fw->size-i; + } b = (u8 *) p + i; if (opera1_xilinx_rw - (dev, OPERA_WRITE_FX2, 0x0, b + 1, b[0], - OPERA_WRITE_MSG) != b[0] + (dev, OPERA_WRITE_FX2, 0x0, b , fpgasize, + OPERA_WRITE_MSG) != fpgasize ) { err("error while transferring firmware"); ret = -EINVAL; break; } - i = i + 1 + b[0]; + i = i + fpgasize; } /* restart the CPU */ if (ret || opera1_xilinx_rw @@ -538,7 +541,7 @@ static int opera1_probe(struct usb_interface *intf, if (udev->descriptor.idProduct == USB_PID_OPERA1_WARM && udev->descriptor.idVendor == USB_VID_OPERA1 && - opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga.fw") != 0 + opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga-01.fw") != 0 ) { return -EINVAL; } |