aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-firmware.c
diff options
context:
space:
mode:
authorSri Deevi <Srinivasa.Deevi@conexant.com>2009-03-03 04:07:42 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:00 -0400
commit149783b58170da0b7ebe9e86995f8cb350f33b6d (patch)
tree613e6057906fe863b67ecdf02039c8daa0e04d42 /drivers/media/video/cx25840/cx25840-firmware.c
parent073d696d547ef933e1f0748086da785e95cb8395 (diff)
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 @@
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