summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-firmware.c
diff options
context:
space:
mode:
authorSri Deevi <Srinivasa.Deevi@conexant.com>2009-03-03 10:07:42 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-07 02:44:00 +0200
commit149783b58170da0b7ebe9e86995f8cb350f33b6d (patch)
tree613e6057906fe863b67ecdf02039c8daa0e04d42 /drivers/media/video/cx25840/cx25840-firmware.c
parentV4L/DVB (11351): v4l: use usb_interface for v4l2_device_register (diff)
downloadlinux-149783b58170da0b7ebe9e86995f8cb350f33b6d.tar.xz
linux-149783b58170da0b7ebe9e86995f8cb350f33b6d.zip
V4L/DVB (10952): cx25840: prepare it to be used by cx231xx module
cx231xx has a cx25840 inside the chip. However, some different initializations are used for this variant. Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-firmware.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-firmware.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c
index 0b2dceb74108..1a5f7d0ead41 100644
--- a/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/drivers/media/video/cx25840/cx25840-firmware.c
@@ -25,6 +25,7 @@
#define FWFILE "v4l-cx25840.fw"
#define FWFILE_CX23885 "v4l-cx23885-avcore-01.fw"
+#define FWFILE_CX231XX "v4l-cx231xx-avcore-01.fw"
/*
* Mike Isely <isely@pobox.com> - The FWSEND parameter controls the
@@ -96,9 +97,17 @@ int cx25840_loadfw(struct i2c_client *client)
u8 buffer[FWSEND];
const u8 *ptr;
int size, retval;
+ int MAX_BUF_SIZE = FWSEND;
if (state->is_cx23885)
firmware = FWFILE_CX23885;
+ else if ( state->is_cx231xx)
+ firmware = FWFILE_CX231XX;
+
+ if( (state->is_cx231xx) && MAX_BUF_SIZE > 16) {
+ printk(" Firmware download size changed to 16 bytes max length\n");
+ MAX_BUF_SIZE = 16; /* cx231xx cannot accept more than 16 bytes at a time */
+ }
if (request_firmware(&fw, firmware, FWDEV(client)) != 0) {
v4l_err(client, "unable to open firmware %s\n", firmware);
@@ -113,7 +122,7 @@ int cx25840_loadfw(struct i2c_client *client)
size = fw->size;
ptr = fw->data;
while (size > 0) {
- int len = min(FWSEND - 2, size);
+ int len = min(MAX_BUF_SIZE - 2, size);
memcpy(buffer + 2, ptr, len);