[linuxtv-commits] [hg:v4l-dvb] backport commit 9ad46a6ac5422882d9f9a7f0d77ca0766f56bb6e

2008-07-19 Thread Patch from Mauro Carvalho Chehab
The patch number 8419 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
backport commit 9ad46a6ac5422882d9f9a7f0d77ca0766f56bb6e


Author: David Woodhouse [EMAIL PROTECTED]
Date:   Fri May 23 23:58:24 2008 +0100

cx25840: treat firmware data as const

kernel-sync:

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx25840/cx25840-firmware.c |   27 ---
 1 file changed, 11 insertions(+), 16 deletions(-)

diff -r 0595660d059e -r 2e1b00693b1b 
linux/drivers/media/video/cx25840/cx25840-firmware.c
--- a/linux/drivers/media/video/cx25840/cx25840-firmware.c  Sat Jul 19 
23:53:41 2008 -0300
+++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c  Sun Jul 20 
00:00:30 2008 -0300
@@ -80,7 +80,7 @@ static int check_fw_load(struct i2c_clie
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 *cl
 {
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 *cl
 
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);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/2e1b00693b1b9ab3685b7793a9eaaff14f37a8ef

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] Complete firmware compilation scripts

2008-07-19 Thread Patch from Mauro Carvalho Chehab
The patch number 8420 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Complete firmware compilation scripts


This patch completes firmware compilation scripts:

- linux/firmware/Makefile is just a copy of kernel script make file. It is not
  currently used by the building system;

- Added two new targets for firmware compilation and instalation;

- Fixes the COPYING file to explicitly state that the firmwares aren't covered
  by GPL;

- make distclean will also cleanup the firmwares.
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 COPYING |7 +
 INSTALL |9 +++
 linux/firmware/Makefile |   47 
 v4l/Makefile|6 -
 v4l/firmware/Makefile   |   30 -
 5 files changed, 92 insertions(+), 7 deletions(-)

diff -r 2e1b00693b1b -r a609b798c204 COPYING
--- a/COPYING   Sun Jul 20 00:00:30 2008 -0300
+++ b/COPYING   Sun Jul 20 00:37:25 2008 -0300
@@ -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 -r 2e1b00693b1b -r a609b798c204 INSTALL
--- a/INSTALL   Sun Jul 20 00:00:30 2008 -0300
+++ b/INSTALL   Sun Jul 20 00:37:25 2008 -0300
@@ -35,6 +35,15 @@ rminstall- cleans previous installation
 
 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:
diff -r 2e1b00693b1b -r a609b798c204 linux/firmware/Makefile
--- a/linux/firmware/Makefile   Sun Jul 20 00:00:30 2008 -0300
+++ b/linux/firmware/Makefile   Sun Jul 20 00:37:25 2008 -0300
@@ -20,8 +20,55 @@ fw-external-y := $(subst ,,$(CONFIG_EXT
 # 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