aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-firmware.c
diff options
context:
space:
mode:
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 @@
25 25
26#define FWFILE "v4l-cx25840.fw" 26#define FWFILE "v4l-cx25840.fw"
27#define FWFILE_CX23885 "v4l-cx23885-avcore-01.fw" 27#define FWFILE_CX23885 "v4l-cx23885-avcore-01.fw"
28#define FWFILE_CX231XX "v4l-cx231xx-avcore-01.fw"
28 29
29/* 30/*
30 * Mike Isely <isely@pobox.com> - The FWSEND parameter controls the 31 * Mike Isely <isely@pobox.com> - The FWSEND parameter controls the
@@ -96,9 +97,17 @@ int cx25840_loadfw(struct i2c_client *client)
96 u8 buffer[FWSEND]; 97 u8 buffer[FWSEND];
97 const u8 *ptr; 98 const u8 *ptr;
98 int size, retval; 99 int size, retval;
100 int MAX_BUF_SIZE = FWSEND;
99 101
100 if (state->is_cx23885) 102 if (state->is_cx23885)
101 firmware = FWFILE_CX23885; 103 firmware = FWFILE_CX23885;
104 else if ( state->is_cx231xx)
105 firmware = FWFILE_CX231XX;
106
107 if( (state->is_cx231xx) && MAX_BUF_SIZE > 16) {
108 printk(" Firmware download size changed to 16 bytes max length\n");
109 MAX_BUF_SIZE = 16; /* cx231xx cannot accept more than 16 bytes at a time */
110 }
102 111
103 if (request_firmware(&fw, firmware, FWDEV(client)) != 0) { 112 if (request_firmware(&fw, firmware, FWDEV(client)) != 0) {
104 v4l_err(client, "unable to open firmware %s\n", firmware); 113 v4l_err(client, "unable to open firmware %s\n", firmware);
@@ -113,7 +122,7 @@ int cx25840_loadfw(struct i2c_client *client)
113 size = fw->size; 122 size = fw->size;
114 ptr = fw->data; 123 ptr = fw->data;
115 while (size > 0) { 124 while (size > 0) {
116 int len = min(FWSEND - 2, size); 125 int len = min(MAX_BUF_SIZE - 2, size);
117 126
118 memcpy(buffer + 2, ptr, len); 127 memcpy(buffer + 2, ptr, len);
119 128