diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c')
-rw-r--r-- | linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 133648277..ceae085cb 100644 --- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -21,6 +21,9 @@ #include <linux/jiffies.h> #include "compat.h" #include <linux/mutex.h> +#ifdef TTUSB_KERNEL +#include <linux/firmware.h> +#endif #include "dvb_frontend.h" #include "dmxdev.h" @@ -287,13 +290,27 @@ static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num return i; } +#ifndef TTUSB_KERNEL #include "dvb-ttusb-dspbootcode.h" +#endif static int ttusb_boot_dsp(struct ttusb *ttusb) { +#ifdef TTUSB_KERNEL + const struct firmware *fw; +#endif int i, err; u8 b[40]; +#ifdef TTUSB_KERNEL + err = request_firmware(&fw, "ttusb-budget/dspbootcode.bin", + &ttusb->dev->dev); + if (err) { + printk(KERN_ERR "ttusb-budget: failed to request firmware\n"); + return err; + } + +#endif /* BootBlock */ b[0] = 0xaa; b[2] = 0x13; @@ -301,8 +318,13 @@ static int ttusb_boot_dsp(struct ttusb *ttusb) /* upload dsp code in 32 byte steps (36 didn't work for me ...) */ /* 32 is max packet size, no messages should be splitted. */ +#ifndef TTUSB_KERNEL for (i = 0; i < sizeof(dsp_bootcode); i += 28) { memcpy(&b[4], &dsp_bootcode[i], 28); +#else + for (i = 0; i < fw->size; i += 28) { + memcpy(&b[4], &fw->data[i], 28); +#endif b[1] = ++ttusb->c; @@ -1809,3 +1831,6 @@ module_exit(ttusb_exit); MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); MODULE_DESCRIPTION("TTUSB DVB Driver"); MODULE_LICENSE("GPL"); +#ifdef TTUSB_KERNEL +MODULE_FIRMWARE("ttusb-budget/dspbootcode.bin"); +#endif |