From 3db43fdd419efb4c5ab043895dd26b4fb8adf94f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 3 Mar 2009 06:07:42 -0300 Subject: cx25840: prepare it to be used by cx231xx module From: Sri Deevi Signed-off-by: Srinivasa Deevi Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx25840/cx25840-firmware.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video/cx25840/cx25840-firmware.c') diff --git a/linux/drivers/media/video/cx25840/cx25840-firmware.c b/linux/drivers/media/video/cx25840/cx25840-firmware.c index 01fbe174e..ff7a56388 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 - 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) { + 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); @@ -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); -- cgit v1.2.3 From 808f4f3fe30f79d2d30241edd25baa06acce836a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 3 Mar 2009 14:36:55 -0300 Subject: cx25840: Fix CodingStyle errors introduced by the last patch From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx25840/cx25840-firmware.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'linux/drivers/media/video/cx25840/cx25840-firmware.c') diff --git a/linux/drivers/media/video/cx25840/cx25840-firmware.c b/linux/drivers/media/video/cx25840/cx25840-firmware.c index ff7a56388..f01456ec4 100644 --- a/linux/drivers/media/video/cx25840/cx25840-firmware.c +++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c @@ -98,17 +98,17 @@ int cx25840_loadfw(struct i2c_client *client) u8 buffer[FWSEND]; const u8 *ptr; int size, retval; - int MAX_BUF_SIZE = FWSEND; + int MAX_BUF_SIZE = FWSEND; if (state->is_cx23885) firmware = FWFILE_CX23885; - else if ( state->is_cx231xx) - firmware = FWFILE_CX231XX; + 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 ((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); -- cgit v1.2.3