Commit 85a5d77a authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (5260): Cx88-blackbird: allow usage of both 376836 and 262144 sized firmware images
  V4L/DVB (5366): Pvrusb2: Fix compilation warning for amd64 builds (use %zu instead of %u)
parents 6d04e3b0 af70dbd3
...@@ -56,7 +56,8 @@ MODULE_PARM_DESC(debug,"enable debug messages [blackbird]"); ...@@ -56,7 +56,8 @@ MODULE_PARM_DESC(debug,"enable debug messages [blackbird]");
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
#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 */ /* defines below are from ivtv-driver.h */
...@@ -404,7 +405,7 @@ static int blackbird_find_mailbox(struct cx8802_dev *dev) ...@@ -404,7 +405,7 @@ static int blackbird_find_mailbox(struct cx8802_dev *dev)
u32 value; u32 value;
int i; 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); memory_read(dev->core, i, &value);
if (value == signature[signaturecnt]) if (value == signature[signaturecnt])
signaturecnt++; signaturecnt++;
...@@ -452,12 +453,15 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) ...@@ -452,12 +453,15 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
return -1; return -1;
} }
if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) { if ((firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) &&
dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d)\n", (firmware->size != OLD_BLACKBIRD_FIRM_IMAGE_SIZE)) {
firmware->size, 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); release_firmware(firmware);
return -1; return -1;
} }
dev->fw_size = firmware->size;
if (0 != memcmp(firmware->data, magic, 8)) { if (0 != memcmp(firmware->data, magic, 8)) {
dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n"); dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n");
......
...@@ -463,6 +463,7 @@ struct cx8802_dev { ...@@ -463,6 +463,7 @@ struct cx8802_dev {
u32 mailbox; u32 mailbox;
int width; int width;
int height; int height;
int fw_size;
#if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE) #if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
/* for dvb only */ /* for dvb only */
......
...@@ -1268,7 +1268,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ...@@ -1268,7 +1268,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
if (fw_len % sizeof(u32)) { if (fw_len % sizeof(u32)) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS, pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"size of %s firmware" "size of %s firmware"
" must be a multiple of %u bytes", " must be a multiple of %zu bytes",
fw_files[fwidx],sizeof(u32)); fw_files[fwidx],sizeof(u32));
release_firmware(fw_entry); release_firmware(fw_entry);
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment