diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 14:25:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 14:25:58 -0400 |
commit | a267c0a887064720dfab5775a4f09b20b4f8ec37 (patch) | |
tree | 25de1f109ff6ef7f0967c22755604cc667944afd /drivers/media/dvb/dvb-usb/opera1.c | |
parent | d756d10e246a01515d07f8161181b8a14afba7cc (diff) | |
parent | 97989ada7628da262eafb4bebce0a319c7cb0f5f (diff) |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (126 commits)
V4L/DVB (5847): Clean up schedule_timeout calls in cpia2 and ivtv code
V4L/DVB (5846): Clean up setting state and scheduling timeouts
V4L/DVB (5844): ivtv: add high volume debugging flag
V4L/DVB (5843): ivtv: fix missing signal_pending check.
V4L/DVB (5842): ivtv: Add locking to ensure stream setup is atomic.
V4L/DVB (5841): tveeprom: add support for Philips FQ1216LME MK3 tuner.
V4L/DVB (5840): fix dst and cx24123: tune() callback changed signess for delay
V4L/DVB (5838): dvb-core: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
V4L/DVB (5837): stv0299: Fix signedness warning (gcc 4.1.1, kernel 2.6.22)
V4L/DVB (5836): dvb-ttpci: re-initialize aspect ratio and pan scan after arm crash
V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22)
V4L/DVB (5834): dvb-core: fix signedness warnings and const stripping
V4L/DVB (5832): ir-common: optimize bit extract function
V4L/DVB (5831): stradis: use ARRAY_SIZE
V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update
V4L/DVB (5828): Kconfig: Added GemTek USB radio and removed experimental dependency.
V4L/DVB (5826): Usbvision: video mux cleanup
V4L/DVB (5825): Alter the tuner type for the WinTV USB UK PAL model.
V4L/DVB (5824): Usbvision: Hauppauge WinTV USB SECAM_L fix
V4L/DVB (5821): Saa7134: add remote control support for LifeView FlyDVB-S LR300
...
Diffstat (limited to 'drivers/media/dvb/dvb-usb/opera1.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/opera1.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index 518d7ad217df..d7c04951ceab 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c | |||
@@ -263,7 +263,7 @@ static int opera1_tuner_attach(struct dvb_usb_adapter *adap) | |||
263 | { | 263 | { |
264 | dvb_attach( | 264 | dvb_attach( |
265 | dvb_pll_attach, adap->fe, 0xc0>>1, | 265 | dvb_pll_attach, adap->fe, 0xc0>>1, |
266 | &adap->dev->i2c_adap, &dvb_pll_opera1 | 266 | &adap->dev->i2c_adap, DVB_PLL_OPERA1 |
267 | ); | 267 | ); |
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
@@ -435,9 +435,9 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, | |||
435 | { | 435 | { |
436 | const struct firmware *fw = NULL; | 436 | const struct firmware *fw = NULL; |
437 | u8 *b, *p; | 437 | u8 *b, *p; |
438 | int ret = 0, i; | 438 | int ret = 0, i,fpgasize=40; |
439 | u8 testval; | 439 | u8 testval; |
440 | info("start downloading fpga firmware"); | 440 | info("start downloading fpga firmware %s",filename); |
441 | 441 | ||
442 | if ((ret = request_firmware(&fw, filename, &dev->dev)) != 0) { | 442 | if ((ret = request_firmware(&fw, filename, &dev->dev)) != 0) { |
443 | err("did not find the firmware file. (%s) " | 443 | err("did not find the firmware file. (%s) " |
@@ -454,17 +454,20 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev, | |||
454 | /* clear fpga ? */ | 454 | /* clear fpga ? */ |
455 | opera1_xilinx_rw(dev, 0xbc, 0xaa, &fpga_command, 1, | 455 | opera1_xilinx_rw(dev, 0xbc, 0xaa, &fpga_command, 1, |
456 | OPERA_WRITE_MSG); | 456 | OPERA_WRITE_MSG); |
457 | for (i = 0; p[i] != 0 && i < fw->size;) { | 457 | for (i = 0; i < fw->size;) { |
458 | if ( (fw->size - i) <fpgasize){ | ||
459 | fpgasize=fw->size-i; | ||
460 | } | ||
458 | b = (u8 *) p + i; | 461 | b = (u8 *) p + i; |
459 | if (opera1_xilinx_rw | 462 | if (opera1_xilinx_rw |
460 | (dev, OPERA_WRITE_FX2, 0x0, b + 1, b[0], | 463 | (dev, OPERA_WRITE_FX2, 0x0, b , fpgasize, |
461 | OPERA_WRITE_MSG) != b[0] | 464 | OPERA_WRITE_MSG) != fpgasize |
462 | ) { | 465 | ) { |
463 | err("error while transferring firmware"); | 466 | err("error while transferring firmware"); |
464 | ret = -EINVAL; | 467 | ret = -EINVAL; |
465 | break; | 468 | break; |
466 | } | 469 | } |
467 | i = i + 1 + b[0]; | 470 | i = i + fpgasize; |
468 | } | 471 | } |
469 | /* restart the CPU */ | 472 | /* restart the CPU */ |
470 | if (ret || opera1_xilinx_rw | 473 | if (ret || opera1_xilinx_rw |
@@ -534,18 +537,16 @@ static struct dvb_usb_device_properties opera1_properties = { | |||
534 | static int opera1_probe(struct usb_interface *intf, | 537 | static int opera1_probe(struct usb_interface *intf, |
535 | const struct usb_device_id *id) | 538 | const struct usb_device_id *id) |
536 | { | 539 | { |
537 | struct dvb_usb_device *d; | ||
538 | struct usb_device *udev = interface_to_usbdev(intf); | 540 | struct usb_device *udev = interface_to_usbdev(intf); |
539 | 541 | ||
540 | if (udev->descriptor.idProduct == USB_PID_OPERA1_WARM && | 542 | if (udev->descriptor.idProduct == USB_PID_OPERA1_WARM && |
541 | udev->descriptor.idVendor == USB_VID_OPERA1 && | 543 | udev->descriptor.idVendor == USB_VID_OPERA1 && |
542 | (d == NULL | 544 | opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga-01.fw") != 0 |
543 | || opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga.fw") != 0) | 545 | ) { |
544 | ) { | ||
545 | return -EINVAL; | 546 | return -EINVAL; |
546 | } | 547 | } |
547 | 548 | ||
548 | if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, &d) != 0) | 549 | if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0) |
549 | return -EINVAL; | 550 | return -EINVAL; |
550 | return 0; | 551 | return 0; |
551 | } | 552 | } |