[patch 052/101] V4L: cx88-blackbird: allow usage of 376836 and 262144 sized firmware images

2007-03-07 Thread Greg KH

From: Michael Krufky <[EMAIL PROTECTED]>

This updates the cx88-blackbird driver to be able to use the new cx23416
firmware image released by Hauppauge Computer Works, while retaining
compatibility with the older firmware images.
cx2341x firmware can be downloaded at: http://dl.ivtvdriver.org/ivtv/firmware/

(cherry picked from commit af70dbd3346999570db73b3bc3d4f7b7c004f2ea)

Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/media/video/cx88/cx88-blackbird.c |   14 +-
 drivers/media/video/cx88/cx88.h   |1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

--- linux-2.6.20.1.orig/drivers/media/video/cx88/cx88-blackbird.c
+++ linux-2.6.20.1/drivers/media/video/cx88/cx88-blackbird.c
@@ -53,7 +53,8 @@ MODULE_PARM_DESC(debug,"enable debug mes
 
 /* -- */
 
-#define BLACKBIRD_FIRM_IMAGE_SIZE 256*1024
+#define OLD_BLACKBIRD_FIRM_IMAGE_SIZE 262144
+#define BLACKBIRD_FIRM_IMAGE_SIZE 376836
 
 /* defines below are from ivtv-driver.h */
 
@@ -401,7 +402,7 @@ static int blackbird_find_mailbox(struct
u32 value;
int i;
 
-   for (i = 0; i < BLACKBIRD_FIRM_IMAGE_SIZE; i++) {
+   for (i = 0; i < dev->fw_size; i++) {
memory_read(dev->core, i, );
if (value == signature[signaturecnt])
signaturecnt++;
@@ -449,12 +450,15 @@ static int blackbird_load_firmware(struc
return -1;
}
 
-   if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) {
-   dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected 
%d)\n",
-   firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE);
+   if ((firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) &&
+   (firmware->size != OLD_BLACKBIRD_FIRM_IMAGE_SIZE)) {
+   dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected 
%d or %d)\n",
+   firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE,
+   OLD_BLACKBIRD_FIRM_IMAGE_SIZE);
release_firmware(firmware);
return -1;
}
+   dev->fw_size = firmware->size;
 
if (0 != memcmp(firmware->data, magic, 8)) {
dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n");
--- linux-2.6.20.1.orig/drivers/media/video/cx88/cx88.h
+++ linux-2.6.20.1/drivers/media/video/cx88/cx88.h
@@ -459,6 +459,7 @@ struct cx8802_dev {
u32mailbox;
intwidth;
intheight;
+   intfw_size;
 
/* for dvb only */
struct videobuf_dvbdvb;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 052/101] V4L: cx88-blackbird: allow usage of 376836 and 262144 sized firmware images

2007-03-07 Thread Greg KH

From: Michael Krufky [EMAIL PROTECTED]

This updates the cx88-blackbird driver to be able to use the new cx23416
firmware image released by Hauppauge Computer Works, while retaining
compatibility with the older firmware images.
cx2341x firmware can be downloaded at: http://dl.ivtvdriver.org/ivtv/firmware/

(cherry picked from commit af70dbd3346999570db73b3bc3d4f7b7c004f2ea)

Signed-off-by: Michael Krufky [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

---
 drivers/media/video/cx88/cx88-blackbird.c |   14 +-
 drivers/media/video/cx88/cx88.h   |1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

--- linux-2.6.20.1.orig/drivers/media/video/cx88/cx88-blackbird.c
+++ linux-2.6.20.1/drivers/media/video/cx88/cx88-blackbird.c
@@ -53,7 +53,8 @@ MODULE_PARM_DESC(debug,enable debug mes
 
 /* -- */
 
-#define BLACKBIRD_FIRM_IMAGE_SIZE 256*1024
+#define OLD_BLACKBIRD_FIRM_IMAGE_SIZE 262144
+#define BLACKBIRD_FIRM_IMAGE_SIZE 376836
 
 /* defines below are from ivtv-driver.h */
 
@@ -401,7 +402,7 @@ static int blackbird_find_mailbox(struct
u32 value;
int i;
 
-   for (i = 0; i  BLACKBIRD_FIRM_IMAGE_SIZE; i++) {
+   for (i = 0; i  dev-fw_size; i++) {
memory_read(dev-core, i, value);
if (value == signature[signaturecnt])
signaturecnt++;
@@ -449,12 +450,15 @@ static int blackbird_load_firmware(struc
return -1;
}
 
-   if (firmware-size != BLACKBIRD_FIRM_IMAGE_SIZE) {
-   dprintk(0, ERROR: Firmware size mismatch (have %zd, expected 
%d)\n,
-   firmware-size, BLACKBIRD_FIRM_IMAGE_SIZE);
+   if ((firmware-size != BLACKBIRD_FIRM_IMAGE_SIZE) 
+   (firmware-size != OLD_BLACKBIRD_FIRM_IMAGE_SIZE)) {
+   dprintk(0, ERROR: Firmware size mismatch (have %zd, expected 
%d or %d)\n,
+   firmware-size, BLACKBIRD_FIRM_IMAGE_SIZE,
+   OLD_BLACKBIRD_FIRM_IMAGE_SIZE);
release_firmware(firmware);
return -1;
}
+   dev-fw_size = firmware-size;
 
if (0 != memcmp(firmware-data, magic, 8)) {
dprintk(0, ERROR: Firmware magic mismatch, wrong file?\n);
--- linux-2.6.20.1.orig/drivers/media/video/cx88/cx88.h
+++ linux-2.6.20.1/drivers/media/video/cx88/cx88.h
@@ -459,6 +459,7 @@ struct cx8802_dev {
u32mailbox;
intwidth;
intheight;
+   intfw_size;
 
/* for dvb only */
struct videobuf_dvbdvb;

--
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/