aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/tuner-xc2028.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 3edf5be47197..fbaab68fd05c 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -565,9 +565,17 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type,
565 565
566 p = priv->firm[pos].ptr; 566 p = priv->firm[pos].ptr;
567 567
568 if ((priv->firm[pos].size != 12 * 16) || (scode >= 16)) 568 /* 16 SCODE entries per file; each SCODE entry is 12 bytes and
569 * has a 2-byte size header in the firmware format. */
570 if (priv->firm[pos].size != 14 * 16 || scode >= 16 ||
571 le16_to_cpu(*(__u16 *)(p + 14 * scode)) != 12)
569 return -EINVAL; 572 return -EINVAL;
570 573
574 tuner_info("Loading SCODE for type=");
575 dump_firm_type(priv->firm[pos].type);
576 printk("(%x), id %016llx.\n", priv->firm[pos].type,
577 (unsigned long long)*id);
578
571 if (priv->firm_version < 0x0202) 579 if (priv->firm_version < 0x0202)
572 rc = send_seq(priv, {0x20, 0x00, 0x00, 0x00}); 580 rc = send_seq(priv, {0x20, 0x00, 0x00, 0x00});
573 else 581 else
@@ -575,7 +583,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type,
575 if (rc < 0) 583 if (rc < 0)
576 return -EIO; 584 return -EIO;
577 585
578 rc = i2c_send(priv, p + 12 * scode, 12); 586 rc = i2c_send(priv, p + 14 * scode + 2, 12);
579 if (rc < 0) 587 if (rc < 0)
580 return -EIO; 588 return -EIO;
581 589