summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/Documentation/video4linux/w9968cf.txt3
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_net.c8
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c6
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dw2102.h2
-rw-r--r--linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c25
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c4
-rw-r--r--linux/drivers/media/video/cpia2/cpia2_core.c54
-rw-r--r--linux/drivers/media/video/dabusb.c74
-rw-r--r--linux/drivers/media/video/usbvideo/vicam.c37
-rwxr-xr-xv4l/scripts/gentree.pl2
10 files changed, 211 insertions, 4 deletions
diff --git a/linux/Documentation/video4linux/w9968cf.txt b/linux/Documentation/video4linux/w9968cf.txt
index e0bba8393..05138e8ae 100644
--- a/linux/Documentation/video4linux/w9968cf.txt
+++ b/linux/Documentation/video4linux/w9968cf.txt
@@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
loads that module automatically. This action is performed as
once soon as the 'w9968cf' module is loaded into memory.
Default: 1
-Note: The kernel must be compiled with the CONFIG_KMOD option
- enabled for the 'ovcamchip' module to be loaded and for
- this parameter to be present.
-------------------------------------------------------------------------------
Name: simcams
Type: int
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c
index 3c0106f65..e0d60cdc4 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c
@@ -1165,7 +1165,11 @@ static void wq_set_multicast_list (struct work_struct *work)
#ifdef OLD_XMIT_LOCK /* Kernels equal or lower than 2.6.17 */
spin_lock_bh(&dev->xmit_lock);
#else
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 26)
netif_tx_lock_bh(dev);
+#else
+ netif_addr_lock_bh(dev);
+#endif
#endif
if (dev->flags & IFF_PROMISC) {
@@ -1194,7 +1198,11 @@ static void wq_set_multicast_list (struct work_struct *work)
#ifdef OLD_XMIT_LOCK /* Kernels equal or lower than 2.6.17 */
spin_unlock_bh(&dev->xmit_lock);
#else
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 26)
netif_tx_unlock_bh(dev);
+#else
+ netif_addr_unlock_bh(dev);
+#endif
#endif
dvb_net_feed_start(dev);
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index e6d20310a..0820da504 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -242,9 +242,15 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
mutex_unlock(&dvbdev_register_lock);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26)
+ clsdev = device_create_drvdata(dvb_class, adap->device,
+ MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
+ NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
+#else
clsdev = device_create(dvb_class, adap->device,
MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
"dvb%d.%s%d", adap->num, dnames[type], id);
+#endif
if (IS_ERR(clsdev)) {
printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n",
__func__, adap->num, dnames[type], id, PTR_ERR(clsdev));
diff --git a/linux/drivers/media/dvb/dvb-usb/dw2102.h b/linux/drivers/media/dvb/dvb-usb/dw2102.h
index cb5873752..7a310f906 100644
--- a/linux/drivers/media/dvb/dvb-usb/dw2102.h
+++ b/linux/drivers/media/dvb/dvb-usb/dw2102.h
@@ -2,7 +2,7 @@
#define _DW2102_H_
#define DVB_USB_LOG_PREFIX "dw2102"
-#include <dvb-usb.h>
+#include "dvb-usb.h"
extern int dvb_usb_dw2102_debug;
#define deb_xfer(args...) dprintk(dvb_usb_dw2102_debug, 0x02, args)
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;
diff --git a/linux/drivers/media/video/cpia2/cpia2_core.c b/linux/drivers/media/video/cpia2/cpia2_core.c
index c8b9fdb70..eab48dfd0 100644
--- a/linux/drivers/media/video/cpia2/cpia2_core.c
+++ b/linux/drivers/media/video/cpia2/cpia2_core.c
@@ -33,11 +33,16 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+#include <linux/firmware.h>
+#endif
/* #define _CPIA2_DEBUG_ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#include "cpia2patch.h"
+#endif
#ifdef _CPIA2_DEBUG_
static const char *block_name[] = {
@@ -893,14 +898,42 @@ int cpia2_set_low_power(struct camera_data *cam)
* apply_vp_patch
*
*****************************************************************************/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+static int cpia2_send_onebyte_command(struct camera_data *cam,
+ struct cpia2_command *cmd,
+ u8 start, u8 datum)
+{
+ cmd->buffer.block_data[0] = datum;
+ cmd->start = start;
+ cmd->reg_count = 1;
+ return cpia2_send_command(cam, cmd);
+}
+
+#endif
static int apply_vp_patch(struct camera_data *cam)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
int i, j;
+#else
+ const struct firmware *fw;
+ const char fw_name[] = "cpia2/stv0672_vp4.bin";
+ int i, ret;
+#endif
struct cpia2_command cmd;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ ret = request_firmware(&fw, fw_name, &cam->dev->dev);
+ if (ret) {
+ printk(KERN_ERR "cpia2: failed to load VP patch \"%s\"\n",
+ fw_name);
+ return ret;
+ }
+
+#endif
cmd.req_mode = CAMERAACCESS_TYPE_REPEAT | CAMERAACCESS_VP;
cmd.direction = TRANSFER_WRITE;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
for (i = 0; i < PATCH_DATA_SIZE; i++) {
for (j = 0; j < patch_data[i].count; j++) {
cmd.buffer.block_data[j] = patch_data[i].data[j];
@@ -908,9 +941,30 @@ static int apply_vp_patch(struct camera_data *cam)
cmd.start = patch_data[i].reg;
cmd.reg_count = patch_data[i].count;
+#else
+ /* First send the start address... */
+ cpia2_send_onebyte_command(cam, &cmd, 0x0A, fw->data[0]); /* hi */
+ cpia2_send_onebyte_command(cam, &cmd, 0x0B, fw->data[1]); /* lo */
+
+ /* ... followed by the data payload */
+ for (i = 2; i < fw->size; i += 64) {
+ cmd.start = 0x0C; /* Data */
+ cmd.reg_count = min_t(int, 64, fw->size - i);
+ memcpy(cmd.buffer.block_data, &fw->data[i], cmd.reg_count);
+#endif
cpia2_send_command(cam, &cmd);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ /* Next send the start address... */
+ cpia2_send_onebyte_command(cam, &cmd, 0x0A, fw->data[0]); /* hi */
+ cpia2_send_onebyte_command(cam, &cmd, 0x0B, fw->data[1]); /* lo */
+
+ /* ... followed by the 'goto' command */
+ cpia2_send_onebyte_command(cam, &cmd, 0x0D, 1);
+
+ release_firmware(fw);
+#endif
return 0;
}
diff --git a/linux/drivers/media/video/dabusb.c b/linux/drivers/media/video/dabusb.c
index 72bf5868c..f23e6b84d 100644
--- a/linux/drivers/media/video/dabusb.c
+++ b/linux/drivers/media/video/dabusb.c
@@ -39,9 +39,15 @@
#include <linux/usb.h>
#include "compat.h"
#include <linux/mutex.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+#include <linux/firmware.h>
+#include <linux/ihex.h>
+#endif
#include "dabusb.h"
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#include "dabfirmware.h"
+#endif
/*
* Version Information
@@ -302,7 +308,12 @@ static int dabusb_bulk (pdabusb_t s, pbulk_transfer_t pb)
return ret;
}
/* --------------------------------------------------------------------- */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
static int dabusb_writemem (pdabusb_t s, int pos, unsigned char *data, int len)
+#else
+static int dabusb_writemem (pdabusb_t s, int pos, const unsigned char *data,
+ int len)
+#endif
{
int ret;
unsigned char *transfer_buffer = kmalloc (len, GFP_KERNEL);
@@ -329,24 +340,63 @@ static int dabusb_8051_reset (pdabusb_t s, unsigned char reset_bit)
static int dabusb_loadmem (pdabusb_t s, const char *fname)
{
int ret;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
PINTEL_HEX_RECORD ptr = firmware;
+#else
+ const struct ihex_binrec *rec;
+ const struct firmware *fw;
+#endif
dbg("Enter dabusb_loadmem (internal)");
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ ret = request_ihex_firmware(&fw, "dabusb/firmware.fw", &s->usbdev->dev);
+ if (ret) {
+ err("Failed to load \"dabusb/firmware.fw\": %d\n", ret);
+ goto out;
+ }
+#endif
ret = dabusb_8051_reset (s, 1);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
while (ptr->Type == 0) {
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
dbg("dabusb_writemem: %04X %p %d)", ptr->Address, ptr->Data, ptr->Length);
+#else
+ for (rec = (const struct ihex_binrec *)fw->data; rec;
+ rec = ihex_next_binrec(rec)) {
+ dbg("dabusb_writemem: %04X %p %d)", be32_to_cpu(rec->addr),
+ rec->data, be16_to_cpu(rec->len));
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
ret = dabusb_writemem (s, ptr->Address, ptr->Data, ptr->Length);
+#else
+ ret = dabusb_writemem(s, be32_to_cpu(rec->addr), rec->data,
+ be16_to_cpu(rec->len));
+#endif
if (ret < 0) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
err("dabusb_writemem failed (%d %04X %p %d)", ret, ptr->Address, ptr->Data, ptr->Length);
+#else
+ err("dabusb_writemem failed (%d %04X %p %d)", ret,
+ be32_to_cpu(rec->addr), rec->data,
+ be16_to_cpu(rec->len));
+#endif
break;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
ptr++;
+#endif
}
ret = dabusb_8051_reset (s, 0);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#else
+ release_firmware(fw);
+ out:
+#endif
dbg("dabusb_loadmem: exit");
return ret;
@@ -381,9 +431,14 @@ static int dabusb_fpga_init (pdabusb_t s, pbulk_transfer_t b)
static int dabusb_fpga_download (pdabusb_t s, const char *fname)
{
pbulk_transfer_t b = kmalloc (sizeof (bulk_transfer_t), GFP_KERNEL);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ const struct firmware *fw;
+#endif
unsigned int blen, n;
int ret;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
unsigned char *buf = bitstream;
+#endif
dbg("Enter dabusb_fpga_download (internal)");
@@ -392,10 +447,22 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname)
return -ENOMEM;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev);
+ if (ret) {
+ err("Failed to load \"dabusb/bitstream.bin\": %d\n", ret);
+ return ret;
+ }
+
+#endif
b->pipe = 1;
ret = dabusb_fpga_clear (s, b);
mdelay (10);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
blen = buf[73] + (buf[72] << 8);
+#else
+ blen = fw->data[73] + (fw->data[72] << 8);
+#endif
dbg("Bitstream len: %i", blen);
@@ -407,7 +474,11 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname)
for (n = 0; n <= blen + 60; n += 60) {
// some cclks for startup
b->size = 64;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
memcpy (b->data + 4, buf + 74 + n, 60);
+#else
+ memcpy (b->data + 4, fw->data + 74 + n, 60);
+#endif
ret = dabusb_bulk (s, b);
if (ret < 0) {
err("dabusb_bulk failed.");
@@ -418,6 +489,9 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname)
ret = dabusb_fpga_init (s, b);
kfree (b);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ release_firmware(fw);
+#endif
dbg("exit dabusb_fpga_download");
diff --git a/linux/drivers/media/video/usbvideo/vicam.c b/linux/drivers/media/video/usbvideo/vicam.c
index 17f542dfb..2aa05f7ca 100644
--- a/linux/drivers/media/video/usbvideo/vicam.c
+++ b/linux/drivers/media/video/usbvideo/vicam.c
@@ -43,6 +43,10 @@
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/mutex.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+#include <linux/firmware.h>
+#include <linux/ihex.h>
+#endif
#include "usbvideo.h"
// #define VICAM_DEBUG
@@ -70,6 +74,7 @@
#define VICAM_HEADER_SIZE 64
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
/* Not sure what all the bytes in these char
* arrays do, but they're necessary to make
* the camera work.
@@ -348,6 +353,7 @@ static unsigned char setup5[] = {
0x46, 0x05, 0x6C, 0x05, 0x00, 0x00
};
+#endif
/* rvmalloc / rvfree copied from usbvideo.c
*
* Not sure why these are not yet non-statics which I can reference through
@@ -464,6 +470,7 @@ static int send_control_msg(struct vicam_camera *cam,
static int
initialize_camera(struct vicam_camera *cam)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
const struct {
u8 *data;
u32 size;
@@ -478,14 +485,41 @@ initialize_camera(struct vicam_camera *cam)
};
int err, i;
+#else
+ int err;
+ const struct ihex_binrec *rec;
+ const struct firmware *fw;
+
+ err = request_ihex_firmware(&fw, "vicam/firmware.fw", &cam->udev->dev);
+ if (err) {
+ printk(KERN_ERR "Failed to load \"vicam/firmware.fw\": %d\n",
+ err);
+ return err;
+ }
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
for (i = 0, err = 0; firmware[i].data && !err; i++) {
memcpy(cam->cntrlbuf, firmware[i].data, firmware[i].size);
+#else
+ for (rec = (void *)fw->data; rec; rec = ihex_next_binrec(rec)) {
+ memcpy(cam->cntrlbuf, rec->data, be16_to_cpu(rec->len));
+#endif
err = send_control_msg(cam, 0xff, 0, 0,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
cam->cntrlbuf, firmware[i].size);
+#else
+ cam->cntrlbuf, be16_to_cpu(rec->len));
+ if (err)
+ break;
+#endif
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ release_firmware(fw);
+
+#endif
return err;
}
@@ -1226,3 +1260,6 @@ module_exit(usb_vicam_exit);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+MODULE_FIRMWARE("vicam/firmware.fw");
+#endif
diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl
index a10738648..fccaedff4 100755
--- a/v4l/scripts/gentree.pl
+++ b/v4l/scripts/gentree.pl
@@ -71,6 +71,8 @@ my %defs = (
'CONFIG_VIVI_SCATTER' => 0,
'CONFIG_BIGPHYS_AREA' => 0,
'BUZ_USE_HIMEM' => 1,
+ 'NEED_SOUND_DRIVER_H' => 0,
+ 'TTUSB_KERNEL' => 1,
);
#################################################################