summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx25840/cx25840-firmware.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-13 18:06:14 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-13 18:06:14 -0300
commit9840199e825a71000f4d87e61380867fe3dc7f80 (patch)
treeaaee9b6e6b95130e5409343389d9f65dd9867094 /linux/drivers/media/video/cx25840/cx25840-firmware.c
parentf689c3bd615386cf4c5238d1b4de1aaf4b58ce69 (diff)
parentc3ce9d2f22c72aa484146a24d87be98d1a29ab9f (diff)
downloadmediapointer-dvb-s2-9840199e825a71000f4d87e61380867fe3dc7f80.tar.gz
mediapointer-dvb-s2-9840199e825a71000f4d87e61380867fe3dc7f80.tar.bz2
merge: http://linuxtv.org/hg/~hgoede/libv4l
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/cx25840/cx25840-firmware.c')
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-firmware.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-firmware.c b/linux/drivers/media/video/cx25840/cx25840-firmware.c
index 01fbe174e..f01456ec4 100644
--- a/linux/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c
@@ -26,6 +26,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
@@ -97,9 +98,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) {
+ v4l_err(client, " 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);
@@ -114,7 +123,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);