diff options
author | Patrick Boettcher <devnull@localhost> | 2005-11-02 10:26:11 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-11-02 10:26:11 +0000 |
commit | fd69d9f4e45e595e6c5c6c6652ca413dd67b6b13 (patch) | |
tree | af20ed1cce64c905ae7517c46ba572cd248ea551 /linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |
parent | b53255819b26c80b4e8f1f85efd3f663b369a1f7 (diff) | |
download | mediapointer-dvb-s2-fd69d9f4e45e595e6c5c6c6652ca413dd67b6b13.tar.gz mediapointer-dvb-s2-fd69d9f4e45e595e6c5c6c6652ca413dd67b6b13.tar.bz2 |
To make the integration of future devices easier I
- modified the dvb-usb-part to allow a device-specific firmware download and
- added an option to specify whether a device reconnects after a firmware download or not.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c index a90205981..c19a50171 100644 --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c @@ -145,38 +145,40 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties if (cold) { info("found a '%s' in cold state, will try to load a firmware",desc->name); - ret = usb_cypress_load_firmware(udev,props->firmware,props->usb_ctrl); - } else { - info("found a '%s' in warm state.",desc->name); - d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); - if (d == NULL) { - err("no memory for 'struct dvb_usb_device'"); + ret = dvb_usb_download_firmware(udev,props); + if (!props->no_reconnect) return ret; + } + + info("found a '%s' in warm state.",desc->name); + d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); + if (d == NULL) { + err("no memory for 'struct dvb_usb_device'"); + return ret; + } + memset(d,0,sizeof(struct dvb_usb_device)); + + d->udev = udev; + memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); + d->desc = desc; + d->owner = owner; + + if (d->props.size_of_priv > 0) { + d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); + if (d->priv == NULL) { + err("no memory for priv in 'struct dvb_usb_device'"); + kfree(d); + return -ENOMEM; } - memset(d,0,sizeof(struct dvb_usb_device)); - - d->udev = udev; - memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); - d->desc = desc; - d->owner = owner; - - if (d->props.size_of_priv > 0) { - d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); - if (d->priv == NULL) { - err("no memory for priv in 'struct dvb_usb_device'"); - kfree(d); - return -ENOMEM; - } - memset(d->priv,0,d->props.size_of_priv); - } + memset(d->priv,0,d->props.size_of_priv); + } - usb_set_intfdata(intf, d); + usb_set_intfdata(intf, d); - if (du != NULL) - *du = d; + if (du != NULL) + *du = d; - ret = dvb_usb_init(d); - } + ret = dvb_usb_init(d); if (ret == 0) info("%s successfully initialized and connected.",desc->name); |