summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-20 09:16:13 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-07-20 09:16:13 +0200
commit4109a3d32f70aceaa0a576b17014ec62c0ad3eef (patch)
tree9d710fcd47a864af5302cb786d1552d422bc0aad
parentd77364d141afb8277b9b66e0b1ea8faa867a4fe1 (diff)
parentc49e3088c034e1fc59f27b9a97ba1e1d3590320a (diff)
downloadmediapointer-dvb-s2-4109a3d32f70aceaa0a576b17014ec62c0ad3eef.tar.gz
mediapointer-dvb-s2-4109a3d32f70aceaa0a576b17014ec62c0ad3eef.tar.bz2
merge: v4l-dvb
-rw-r--r--COPYING7
-rw-r--r--INSTALL9
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-firmware.c27
-rw-r--r--linux/drivers/media/video/videodev.c4
-rw-r--r--linux/firmware/Makefile47
-rw-r--r--v4l/Makefile6
-rw-r--r--v4l/firmware/Makefile30
7 files changed, 107 insertions, 23 deletions
diff --git a/COPYING b/COPYING
index ca442d313..9788c014c 100644
--- a/COPYING
+++ b/COPYING
@@ -1,3 +1,10 @@
+ NOTE! This copyright does *not* cover the firmware hex files contained
+ under linux/firmware and v4l/firmware directories. Those firmwares are here
+ just as a convenience to make easier to develop and test V4L/DVB drivers.
+
+ Mauro Carvalho Chehab
+
+----------------------------------------
NOTE! This copyright does *not* cover user programs that use kernel
services by normal system calls - this is merely considered normal use
diff --git a/INSTALL b/INSTALL
index bad6ca80b..10cafb264 100644
--- a/INSTALL
+++ b/INSTALL
@@ -36,6 +36,15 @@ rminstall - cleans previous installations of V4L/DVB modules
sound-install - installs the sound modules related to V4L/DVB
tree.
+======================
+Firmware rules:
+
+firmware - Create the firmware files that are enclosed at the
+ tree.
+ Notice: Only a very few firmwares are currently here
+
+firmware_install- Install firmware files under /lib/firmware
+
=======================
Module selection rules:
(Those may require write access to kernel tree)
diff --git a/linux/drivers/media/video/cx25840/cx25840-firmware.c b/linux/drivers/media/video/cx25840/cx25840-firmware.c
index 95b84ce21..04a5dbb65 100644
--- a/linux/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c
@@ -80,7 +80,7 @@ static int check_fw_load(struct i2c_client *client, int size)
return 0;
}
-static int fw_write(struct i2c_client *client, u8 *data, int size)
+static int fw_write(struct i2c_client *client, const u8 *data, int size)
{
if (i2c_master_send(client, data, size) < size) {
v4l_err(client, "firmware load i2c failure\n");
@@ -94,7 +94,8 @@ int cx25840_loadfw(struct i2c_client *client)
{
struct cx25840_state *state = i2c_get_clientdata(client);
const struct firmware *fw = NULL;
- u8 buffer[4], *ptr;
+ u8 buffer[FWSEND];
+ const u8 *ptr;
int size, retval;
if (state->is_cx23885)
@@ -109,29 +110,23 @@ int cx25840_loadfw(struct i2c_client *client)
buffer[0] = 0x08;
buffer[1] = 0x02;
- buffer[2] = fw->data[0];
- buffer[3] = fw->data[1];
- retval = fw_write(client, buffer, 4);
- if (retval < 0) {
- release_firmware(fw);
- return retval;
- }
-
- size = fw->size - 2;
+ size = fw->size;
ptr = fw->data;
while (size > 0) {
- ptr[0] = 0x08;
- ptr[1] = 0x02;
- retval = fw_write(client, ptr, min(FWSEND, size + 2));
+ int len = min(FWSEND - 2, size);
+
+ memcpy(buffer + 2, ptr, len);
+
+ retval = fw_write(client, buffer, len + 2);
if (retval < 0) {
release_firmware(fw);
return retval;
}
- size -= FWSEND - 2;
- ptr += FWSEND - 2;
+ size -= len;
+ ptr += len;
}
end_fw_load(client);
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c
index b32b59afd..48e03618a 100644
--- a/linux/drivers/media/video/videodev.c
+++ b/linux/drivers/media/video/videodev.c
@@ -40,6 +40,7 @@
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/slab.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -492,6 +493,7 @@ static int video_open(struct inode *inode, struct file *file)
if(minor>=VIDEO_NUM_DEVICES)
return -ENODEV;
+ lock_kernel();
mutex_lock(&videodev_lock);
vfl=video_device[minor];
if(vfl==NULL) {
@@ -501,6 +503,7 @@ static int video_open(struct inode *inode, struct file *file)
vfl=video_device[minor];
if (vfl==NULL) {
mutex_unlock(&videodev_lock);
+ unlock_kernel();
return -ENODEV;
}
}
@@ -518,6 +521,7 @@ static int video_open(struct inode *inode, struct file *file)
}
fops_put(old_fops);
mutex_unlock(&videodev_lock);
+ unlock_kernel();
return err;
}
diff --git a/linux/firmware/Makefile b/linux/firmware/Makefile
index e2841d35d..9fe86041f 100644
--- a/linux/firmware/Makefile
+++ b/linux/firmware/Makefile
@@ -20,8 +20,55 @@ fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
# accurate. In the latter case it doesn't matter -- it'll use $(fw-shipped-all).
# But be aware that the config file might not be included at all.
+fw-shipped-$(CONFIG_ATARI_DSP56K) += dsp56k/bootstrap.bin
+fw-shipped-$(CONFIG_ATM_AMBASSADOR) += atmsar11.fw
+fw-shipped-$(CONFIG_COMPUTONE) += intelliport2.bin
fw-shipped-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin
+fw-shipped-$(CONFIG_SMCTR) += tr_smctr.bin
+fw-shipped-$(CONFIG_SND_KORG1212) += korg/k1212.dsp
+fw-shipped-$(CONFIG_SND_MAESTRO3) += ess/maestro3_assp_kernel.fw \
+ ess/maestro3_assp_minisrc.fw
+fw-shipped-$(CONFIG_SND_SB16_CSP) += sb16/mulaw_main.csp sb16/alaw_main.csp \
+ sb16/ima_adpcm_init.csp \
+ sb16/ima_adpcm_playback.csp \
+ sb16/ima_adpcm_capture.csp
+fw-shipped-$(CONFIG_SND_YMFPCI) += yamaha/ds1_ctrl.fw yamaha/ds1_dsp.fw \
+ yamaha/ds1e_ctrl.fw
fw-shipped-$(CONFIG_USB_DABUSB) += dabusb/firmware.fw dabusb/bitstream.bin
+fw-shipped-$(CONFIG_USB_EMI26) += emi26/loader.fw emi26/firmware.fw \
+ emi26/bitstream.fw
+fw-shipped-$(CONFIG_USB_EMI62) += emi62/loader.fw emi62/bitstream.fw \
+ emi62/spdif.fw emi62/midi.fw
+fw-shipped-$(CONFIG_USB_KAWETH) += kaweth/new_code.bin kaweth/trigger_code.bin \
+ kaweth/new_code_fix.bin \
+ kaweth/trigger_code_fix.bin
+ifdef CONFIG_FIRMWARE_IN_KERNEL
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR) += keyspan/mpr.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA18X) += keyspan/usa18x.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19) += keyspan/usa19.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QI) += keyspan/usa19qi.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QW) += keyspan/usa19qw.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19W) += keyspan/usa19w.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28) += keyspan/usa28.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XA) += keyspan/usa28xa.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XB) += keyspan/usa28xb.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28X) += keyspan/usa28x.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49W) += keyspan/usa49w.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49WLC) += keyspan/usa49wlc.fw
+else
+fw-shipped- += keyspan/mpr.fw keyspan/usa18x.fw keyspan/usa19.fw \
+ keyspan/usa19qi.fw keyspan/usa19qw.fw keyspan/usa19w.fw \
+ keyspan/usa28.fw keyspan/usa28xa.fw keyspan/usa28xb.fw \
+ keyspan/usa28x.fw keyspan/usa49w.fw keyspan/usa49wlc.fw
+endif
+fw-shipped-$(CONFIG_USB_SERIAL_TI) += ti_3410.fw ti_5052.fw
+fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT) += edgeport/boot.fw edgeport/boot2.fw \
+ edgeport/down.fw edgeport/down2.fw
+fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += edgeport/down3.bin
+fw-shipped-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat_loader.fw whiteheat.fw \
+ # whiteheat_loader_debug.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_PDA) += keyspan_pda/keyspan_pda.fw
+fw-shipped-$(CONFIG_USB_SERIAL_XIRCOM) += keyspan_pda/xircom_pgs.fw
fw-shipped-$(CONFIG_USB_VICAM) += vicam/firmware.fw
fw-shipped-$(CONFIG_VIDEO_CPIA2) += cpia2/stv0672_vp4.bin
diff --git a/v4l/Makefile b/v4l/Makefile
index 579b85f88..b43b59867 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -39,7 +39,7 @@ endif # TOPDIR
#################################################
# default compilation rule
-default:: config-compat.h Makefile.media links oss # firmware
+default:: config-compat.h Makefile.media links oss
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
./scripts/rmmod.pl check
@@ -206,6 +206,9 @@ install:: media-install
remove rminstall:: media-rminstall
+firmware_install::
+ make -C firmware install
+
#################################################
# Compiling preparation rules
@@ -287,6 +290,7 @@ distclean:: clean
-rm -f scripts/lxdialog scripts/kconfig oss
@find .. -name '*.orig' -exec rm '{}' \;
@find .. -name '*.rej' -exec rm '{}' \;
+ $(MAKE) -C firmware distclean
#################################################
# Kernel module insert/removal rules
diff --git a/v4l/firmware/Makefile b/v4l/firmware/Makefile
index c3624004c..e018ad92a 100644
--- a/v4l/firmware/Makefile
+++ b/v4l/firmware/Makefile
@@ -1,27 +1,45 @@
-TARGETS = ihex2fw ttusb-budget vicam.fw dabusb_bitstream dabusb.fw stv0672_v4
+DIRS = vicam dabusb ttusb-budget cpia2
+
+TARGETS = ihex2fw vicam/firmware.fw dabusb/firmware.fw dabusb/bitstream.bin ttusb-budget/dspbootcode.bin cpia2/stv0672_vp4.bin
+
+####
default: $(TARGETS)
clean:
-rm $(TARGETS)
+distclean: clean
+ -rmdir $(DIRS)
+
+install: default
+ -for i in $(DIRS); do mkdir /lib/firmware/$$i; done
+ -for i in $(TARGETS); do cp $$i /lib/firmware/$$i; done
+
+
+######
+
+mkdir:
+ -mkdir $(DIRS)
+
ihex2fw: ../../linux/firmware/ihex2fw.c
gcc -Wall -o $@ $<
-vicam.fw: ../../linux/firmware/vicam/firmware.H16
+vicam/firmware.fw: ../../linux/firmware/vicam/firmware.H16 mkdir
+ -mkdir vicam
./ihex2fw -w $< $@
-dabusb.fw: ../../linux/firmware/dabusb/firmware.HEX
+dabusb/firmware.fw: ../../linux/firmware/dabusb/firmware.HEX mkdir
./ihex2fw $< $@
-ttusb-budget: ../../linux/firmware/ttusb-budget/dspbootcode.bin.ihex
+ttusb-budget/dspbootcode.bin: ../../linux/firmware/ttusb-budget/dspbootcode.bin.ihex mkdir
objcopy -Iihex -Obinary $< $@
-dabusb_bitstream: ../../linux/firmware/dabusb/bitstream.bin.ihex
+dabusb/bitstream.bin: ../../linux/firmware/dabusb/bitstream.bin.ihex mkdir
objcopy -Iihex -Obinary $< $@
-stv0672_v4: ../../linux/firmware/cpia2/stv0672_vp4.bin.ihex
+cpia2/stv0672_vp4.bin: ../../linux/firmware/cpia2/stv0672_vp4.bin.ihex mkdir
objcopy -Iihex -Obinary $< $@