diff options
author | David Woodhouse <dwmw2@infradead.org> | 2008-05-29 12:50:06 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-07-10 09:47:53 -0400 |
commit | 0a2a736afa91e8a0402c9dbdaf2ee28481a50bd3 (patch) | |
tree | 97c3ad0cd3e0f6aaa8360ce8288ab7470e9e572a /drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |
parent | 79682499d9f3eaea4e6a970d8aa0b9bc1ac2a97f (diff) |
ttusb-budget: use request_firmware()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c')
-rw-r--r-- | drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 5d2d81ab2371..bc2043e44ebd 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/jiffies.h> | 20 | #include <linux/jiffies.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/firmware.h> | ||
22 | 23 | ||
23 | #include "dvb_frontend.h" | 24 | #include "dvb_frontend.h" |
24 | #include "dmxdev.h" | 25 | #include "dmxdev.h" |
@@ -285,13 +286,19 @@ static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num | |||
285 | return i; | 286 | return i; |
286 | } | 287 | } |
287 | 288 | ||
288 | #include "dvb-ttusb-dspbootcode.h" | ||
289 | |||
290 | static int ttusb_boot_dsp(struct ttusb *ttusb) | 289 | static int ttusb_boot_dsp(struct ttusb *ttusb) |
291 | { | 290 | { |
291 | const struct firmware *fw; | ||
292 | int i, err; | 292 | int i, err; |
293 | u8 b[40]; | 293 | u8 b[40]; |
294 | 294 | ||
295 | err = request_firmware(&fw, "ttusb-budget/dspbootcode.bin", | ||
296 | &ttusb->dev->dev); | ||
297 | if (err) { | ||
298 | printk(KERN_ERR "ttusb-budget: failed to request firmware\n"); | ||
299 | return err; | ||
300 | } | ||
301 | |||
295 | /* BootBlock */ | 302 | /* BootBlock */ |
296 | b[0] = 0xaa; | 303 | b[0] = 0xaa; |
297 | b[2] = 0x13; | 304 | b[2] = 0x13; |
@@ -299,8 +306,8 @@ static int ttusb_boot_dsp(struct ttusb *ttusb) | |||
299 | 306 | ||
300 | /* upload dsp code in 32 byte steps (36 didn't work for me ...) */ | 307 | /* upload dsp code in 32 byte steps (36 didn't work for me ...) */ |
301 | /* 32 is max packet size, no messages should be splitted. */ | 308 | /* 32 is max packet size, no messages should be splitted. */ |
302 | for (i = 0; i < sizeof(dsp_bootcode); i += 28) { | 309 | for (i = 0; i < fw->size; i += 28) { |
303 | memcpy(&b[4], &dsp_bootcode[i], 28); | 310 | memcpy(&b[4], &fw->data[i], 28); |
304 | 311 | ||
305 | b[1] = ++ttusb->c; | 312 | b[1] = ++ttusb->c; |
306 | 313 | ||
@@ -1820,3 +1827,4 @@ module_exit(ttusb_exit); | |||
1820 | MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); | 1827 | MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); |
1821 | MODULE_DESCRIPTION("TTUSB DVB Driver"); | 1828 | MODULE_DESCRIPTION("TTUSB DVB Driver"); |
1822 | MODULE_LICENSE("GPL"); | 1829 | MODULE_LICENSE("GPL"); |
1830 | MODULE_FIRMWARE("ttusb-budget/dspbootcode.bin"); | ||