summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2007-11-19 23:12:45 +1000
committerChris Pascoe <c.pascoe@itee.uq.edu.au>2007-11-19 23:12:45 +1000
commit391dbb9228e610f769059193aaeb536ce85737d9 (patch)
treea7407e5a2df11976f8f21cf29566a675faa62c23 /linux/drivers/media
parentecfc8a73b44e35d80a7d1061010ad502c0985080 (diff)
downloadmediapointer-dvb-s2-391dbb9228e610f769059193aaeb536ce85737d9.tar.gz
mediapointer-dvb-s2-391dbb9228e610f769059193aaeb536ce85737d9.tar.bz2
xc2028: use correct offset into scode firmware
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> When validating and loading SCODE firmware we need to take into account the two-byte size header before each entry. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/tuner-xc2028.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/linux/drivers/media/video/tuner-xc2028.c b/linux/drivers/media/video/tuner-xc2028.c
index 131687ea4..49f670e5a 100644
--- a/linux/drivers/media/video/tuner-xc2028.c
+++ b/linux/drivers/media/video/tuner-xc2028.c
@@ -580,9 +580,17 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type,
p = priv->firm[pos].ptr;
- if ((priv->firm[pos].size != 12 * 16) || (scode >= 16))
+ /* 16 SCODE entries per file; each SCODE entry is 12 bytes and
+ * has a 2-byte size header in the firmware format. */
+ if (priv->firm[pos].size != 14 * 16 || scode >= 16 ||
+ le16_to_cpu(*(__u16 *)(p + 14 * scode)) != 12)
return -EINVAL;
+ tuner_info("Loading SCODE for type=");
+ dump_firm_type(priv->firm[pos].type);
+ printk("(%x), id %016llx.\n", priv->firm[pos].type,
+ (unsigned long long)*id);
+
if (priv->firm_version < 0x0202)
rc = send_seq(priv, {0x20, 0x00, 0x00, 0x00});
else
@@ -590,7 +598,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type,
if (rc < 0)
return -EIO;
- rc = i2c_send(priv, p + 12 * scode, 12);
+ rc = i2c_send(priv, p + 14 * scode + 2, 12);
if (rc < 0)
return -EIO;