Skip to content

Commit 0a2a736

Browse files
dwmw2David Woodhouse
authored andcommitted
ttusb-budget: use request_firmware()
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
1 parent 7968249 commit 0a2a736

5 files changed

Lines changed: 843 additions & 1648 deletions

File tree

‎drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/errno.h>
2020
#include <linux/jiffies.h>
2121
#include <linux/mutex.h>
22+
#include <linux/firmware.h>
2223

2324
#include "dvb_frontend.h"
2425
#include "dmxdev.h"
@@ -285,22 +286,28 @@ static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num
285286
return i;
286287
}
287288

288-
#include "dvb-ttusb-dspbootcode.h"
289-
290289
static int ttusb_boot_dsp(struct ttusb *ttusb)
291290
{
291+
const struct firmware *fw;
292292
int i, err;
293293
u8 b[40];
294294

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+
295302
/* BootBlock */
296303
b[0] = 0xaa;
297304
b[2] = 0x13;
298305
b[3] = 28;
299306

300307
/* upload dsp code in 32 byte steps (36 didn't work for me ...) */
301308
/* 32 is max packet size, no messages should be splitted. */
302-
for (i = 0; i < sizeof(dsp_bootcode); i += 28) {
303-
memcpy(&b[4], &dsp_bootcode[i], 28);
309+
for (i = 0; i < fw->size; i += 28) {
310+
memcpy(&b[4], &fw->data[i], 28);
304311

305312
b[1] = ++ttusb->c;
306313

@@ -1820,3 +1827,4 @@ module_exit(ttusb_exit);
18201827
MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>");
18211828
MODULE_DESCRIPTION("TTUSB DVB Driver");
18221829
MODULE_LICENSE("GPL");
1830+
MODULE_FIRMWARE("ttusb-budget/dspbootcode.bin");

0 commit comments

Comments
 (0)