Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d7b22c5cfef28d21051331622f9595993a083cc4
Commit:     d7b22c5cfef28d21051331622f9595993a083cc4
Parent:     b1535293dc816f01b0934718c370f9533c7d635e
Author:     Chris Pascoe <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 19 10:12:45 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 19:02:29 2008 -0200

    V4L/DVB (6644): xc2028: use correct offset into scode firmware
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/tuner-xc2028.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/tuner-xc2028.c 
b/drivers/media/video/tuner-xc2028.c
index 3edf5be..fbaab68 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,
 
        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
@@ -575,7 +583,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;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to