summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttusb-budget
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-24 13:15:47 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-24 13:15:47 -0300
commit72f297be4182a7ebc0db2f38eb7ada75ad7b2ee4 (patch)
tree25840a83ed6e07ec2ef82dc842884021ad66a4d2 /linux/drivers/media/dvb/ttusb-budget
parent132006918b3990079761954e1c88e46ac2b52e45 (diff)
downloadmediapointer-dvb-s2-72f297be4182a7ebc0db2f38eb7ada75ad7b2ee4.tar.gz
mediapointer-dvb-s2-72f297be4182a7ebc0db2f38eb7ada75ad7b2ee4.tar.bz2
backport commit 0a2a736afa91e8a0402c9dbdaf2ee28481a50bd3
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Author: David Woodhouse <dwmw2@infradead.org> Date: Thu May 29 19:50:06 2008 +0300 ttusb-budget: use request_firmware() This patch will keep using the enclosed .h firmware for out-of-kernel compilations. For in-kernel compilation, it will use the firmware on a .bin file that is linkedited together with dvb-ttusb-budget target. On both cases, the firmware will be inside dvb-ttusb-budget.ko module. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb/ttusb-budget')
-rw-r--r--linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c25
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