aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dvb-usb-init.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-01-09 12:25:04 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:04 -0500
commitd3707add6158803b6463292178cd1a041857b91b (patch)
tree29fead33cb3cdb3ed5d3819475e717467967f6c9 /drivers/media/dvb/dvb-usb/dvb-usb-init.c
parente142e5107f1e4103dad16e391a41166e15b66a9c (diff)
DVB (2420): Makes integration of future devices easier
- To make the integration of future devices easier - modified the dvb-usb-part to allow a device-specific firmware download - added an option to specify whether a device reconnects after a firmware download or not. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-init.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index dd8e0b94edba..2f9c3638adcf 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/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
145 145
146 if (cold) { 146 if (cold) {
147 info("found a '%s' in cold state, will try to load a firmware",desc->name); 147 info("found a '%s' in cold state, will try to load a firmware",desc->name);
148 ret = usb_cypress_load_firmware(udev,props->firmware,props->usb_ctrl); 148 ret = dvb_usb_download_firmware(udev,props);
149 } else { 149 if (!props->no_reconnect)
150 info("found a '%s' in warm state.",desc->name);
151 d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
152 if (d == NULL) {
153 err("no memory for 'struct dvb_usb_device'");
154 return ret; 150 return ret;
151 }
152
153 info("found a '%s' in warm state.",desc->name);
154 d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
155 if (d == NULL) {
156 err("no memory for 'struct dvb_usb_device'");
157 return ret;
158 }
159 memset(d,0,sizeof(struct dvb_usb_device));
160
161 d->udev = udev;
162 memcpy(&d->props,props,sizeof(struct dvb_usb_properties));
163 d->desc = desc;
164 d->owner = owner;
165
166 if (d->props.size_of_priv > 0) {
167 d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL);
168 if (d->priv == NULL) {
169 err("no memory for priv in 'struct dvb_usb_device'");
170 kfree(d);
171 return -ENOMEM;
155 } 172 }
156 memset(d,0,sizeof(struct dvb_usb_device)); 173 memset(d->priv,0,d->props.size_of_priv);
157 174 }
158 d->udev = udev;
159 memcpy(&d->props,props,sizeof(struct dvb_usb_properties));
160 d->desc = desc;
161 d->owner = owner;
162
163 if (d->props.size_of_priv > 0) {
164 d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL);
165 if (d->priv == NULL) {
166 err("no memory for priv in 'struct dvb_usb_device'");
167 kfree(d);
168 return -ENOMEM;
169 }
170 memset(d->priv,0,d->props.size_of_priv);
171 }
172 175
173 usb_set_intfdata(intf, d); 176 usb_set_intfdata(intf, d);
174 177
175 if (du != NULL) 178 if (du != NULL)
176 *du = d; 179 *du = d;
177 180
178 ret = dvb_usb_init(d); 181 ret = dvb_usb_init(d);
179 }
180 182
181 if (ret == 0) 183 if (ret == 0)
182 info("%s successfully initialized and connected.",desc->name); 184 info("%s successfully initialized and connected.",desc->name);