V4L/DVB (4650): Misc fixes for dib0700 download
authorPatrick Boettcher <pb@linuxtv.org>
Tue, 19 Sep 2006 15:51:46 +0000 (12:51 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 3 Oct 2006 18:12:42 +0000 (15:12 -0300)
Several fixes for dib0700-module. (Firmware error checking, dependency)

Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/dib0700_core.c
drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
drivers/media/dvb/dvb-usb/dvb-usb-init.c

index 135f287510c712c37ded2e273587f91c4f2511b1..67cefdd2334a5d31ec486f9e1cf996b70acc0852 100644 (file)
@@ -70,6 +70,7 @@ config DVB_USB_DIB0700
        tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)"
        depends on DVB_USB
        select DVB_DIB7000M
+       select DVB_DIB3000MC
        select DVB_TUNER_MT2060
        help
          Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The
index 75e8570f4ad83ea6b08024c676abbec936fc8bdc..a1a8165ab27242c07a18fad8be489d347904f1d9 100644 (file)
@@ -138,8 +138,6 @@ int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_proper
                buf[0], USB_TYPE_VENDOR | USB_DIR_OUT, 0, 0, buf, 3, USB_CTRL_GET_TIMEOUT) != 3;
 
        deb_info("cold: %d\n", *cold);
-
-       *cold = 0;
        return 0;
 }
 
@@ -171,11 +169,11 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw
        u8 buf[260];
 
        while ((ret = dvb_usb_get_hexline(fw, &hx, &pos)) > 0) {
-               deb_fwdata("writing to address 0x%04x (buffer: 0x%02x %02x)\n",hx.addr, hx.len, hx.chk);
+               deb_fwdata("writing to address 0x%08x (buffer: 0x%02x %02x)\n",hx.addr, hx.len, hx.chk);
 
                buf[0] = hx.len;
-               buf[1] = hx.addr >> 8;
-               buf[2] = hx.addr & 0xff;
+               buf[1] = (hx.addr >> 8) & 0xff;
+               buf[2] =  hx.addr       & 0xff;
                buf[3] = hx.type;
                memcpy(&buf[4],hx.data,hx.len);
                buf[4+hx.len] = hx.chk;
index 4e986f12b674b5e6d6a4ec0c948eebe9c14b1060..e1112e39fb638e4d9731510afd7a22667ba434ea 100644 (file)
@@ -80,7 +80,6 @@ int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_device_pro
        int ret;
        const struct firmware *fw = NULL;
 
-
        if ((ret = request_firmware(&fw, props->firmware, &udev->dev)) != 0) {
                err("did not find the firmware file. (%s) "
                        "Please see linux/Documentation/dvb/ for more details on firmware-problems. (%d)",
index 6babdcd4c1ab8530143e69e6f1c180ef5ce5c9d7..0dd90d1fe67c30006abb85ee8488bcf2d2c6604b 100644 (file)
@@ -228,7 +228,7 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_proper
        if (cold) {
                info("found a '%s' in cold state, will try to load a firmware",desc->name);
                ret = dvb_usb_download_firmware(udev,props);
-               if (!props->no_reconnect)
+               if (!props->no_reconnect || ret != 0)
                        return ret;
        }