diff options
-rw-r--r-- | linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 25 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 4 |
2 files changed, 29 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 diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 8491913aa..0fdcb19cb 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -1284,7 +1284,11 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec) u8 b1[] = { 0x61 }; u8 *b; char idstring[21]; +#ifndef TTUSB_KERNEL u8 *firmware = NULL; +#else + const u8 *firmware = NULL; +#endif size_t firmware_size = 0; u16 firmware_csum = 0; __be16 firmware_csum_ns; |