V4L/DVB (5260): Cx88-blackbird: allow usage of both 376836 and 262144 sized firmware images

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/

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by Michael Krufky and committed by Mauro Carvalho Chehab af70dbd3 48dc30a1

+10 -5
+9 -5
drivers/media/video/cx88/cx88-blackbird.c
··· 56 57 /* ------------------------------------------------------------------ */ 58 59 - #define BLACKBIRD_FIRM_IMAGE_SIZE 256*1024 60 61 /* defines below are from ivtv-driver.h */ 62 ··· 405 u32 value; 406 int i; 407 408 - for (i = 0; i < BLACKBIRD_FIRM_IMAGE_SIZE; i++) { 409 memory_read(dev->core, i, &value); 410 if (value == signature[signaturecnt]) 411 signaturecnt++; ··· 453 return -1; 454 } 455 456 - if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) { 457 - dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d)\n", 458 - firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE); 459 release_firmware(firmware); 460 return -1; 461 } 462 463 if (0 != memcmp(firmware->data, magic, 8)) { 464 dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n");
··· 56 57 /* ------------------------------------------------------------------ */ 58 59 + #define OLD_BLACKBIRD_FIRM_IMAGE_SIZE 262144 60 + #define BLACKBIRD_FIRM_IMAGE_SIZE 376836 61 62 /* defines below are from ivtv-driver.h */ 63 ··· 404 u32 value; 405 int i; 406 407 + for (i = 0; i < dev->fw_size; i++) { 408 memory_read(dev->core, i, &value); 409 if (value == signature[signaturecnt]) 410 signaturecnt++; ··· 452 return -1; 453 } 454 455 + if ((firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) && 456 + (firmware->size != OLD_BLACKBIRD_FIRM_IMAGE_SIZE)) { 457 + dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d or %d)\n", 458 + firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE, 459 + OLD_BLACKBIRD_FIRM_IMAGE_SIZE); 460 release_firmware(firmware); 461 return -1; 462 } 463 + dev->fw_size = firmware->size; 464 465 if (0 != memcmp(firmware->data, magic, 8)) { 466 dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n");
+1
drivers/media/video/cx88/cx88.h
··· 463 u32 mailbox; 464 int width; 465 int height; 466 467 #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE) 468 /* for dvb only */
··· 463 u32 mailbox; 464 int width; 465 int height; 466 + int fw_size; 467 468 #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE) 469 /* for dvb only */