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