Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ac5881aefc2dab8b3535c2e44fee6628acaf787
Commit:     0ac5881aefc2dab8b3535c2e44fee6628acaf787
Parent:     f234081bc564c69eb0e2cd4e957ad1cbae4a6144
Author:     Steven Toth <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 02:06:35 2008 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 19:04:47 2008 -0200

    V4L/DVB (7003): cx23885: Add support for device revision detection
    
    Each version of the cx23885/7/8 silicon has different build revs.
    We'll use this internal revision to work around bugs and known
    issues in the video and encoder related patches.
    
    Signed-off-by: Steven Toth <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/cx23885/cx23885-core.c |   40 ++++++++++++++++++++++++++++
 drivers/media/video/cx23885/cx23885-reg.h  |    1 +
 drivers/media/video/cx23885/cx23885.h      |    1 +
 3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-core.c 
b/drivers/media/video/cx23885/cx23885-core.c
index f205ad6..a602ac8 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -702,6 +702,44 @@ static int cx23885_init_tsport(struct cx23885_dev *dev, 
struct cx23885_tsport *p
        return 0;
 }
 
+static void cx23885_dev_checkrevision(struct cx23885_dev *dev)
+{
+       switch (cx_read(RDR_CFG2) & 0xff) {
+       case 0x00:
+               /* cx23885 */
+               dev->hwrevision = 0xa0;
+               break;
+       case 0x01:
+               /* CX23885-12Z */
+               dev->hwrevision = 0xa1;
+               break;
+       case 0x02:
+               /* CX23885-13Z */
+               dev->hwrevision = 0xb0;
+               break;
+       case 0x03:
+               /* CX23888-22Z */
+               dev->hwrevision = 0xc0;
+               break;
+       case 0x0e:
+               /* CX23887-15Z */
+               dev->hwrevision = 0xc0;
+       case 0x0f:
+               /* CX23887-14Z */
+               dev->hwrevision = 0xb1;
+               break;
+       default:
+               printk(KERN_ERR "%s() New hardware revision found 0x%x\n",
+                       __FUNCTION__, dev->hwrevision);
+       }
+       if (dev->hwrevision)
+               printk(KERN_INFO "%s() Hardware revision = 0x%02x\n",
+                       __FUNCTION__, dev->hwrevision);
+       else
+               printk(KERN_ERR "%s() Hardware revision unknown 0x%x\n",
+                       __FUNCTION__, dev->hwrevision);
+}
+
 static int cx23885_dev_setup(struct cx23885_dev *dev)
 {
        int i;
@@ -832,6 +870,8 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
                }
        }
 
+       cx23885_dev_checkrevision(dev);
+
        return 0;
 }
 
diff --git a/drivers/media/video/cx23885/cx23885-reg.h 
b/drivers/media/video/cx23885/cx23885-reg.h
index 162169f..38abf49 100644
--- a/drivers/media/video/cx23885/cx23885-reg.h
+++ b/drivers/media/video/cx23885/cx23885-reg.h
@@ -276,6 +276,7 @@ Channel manager Data Structure entry = 20 DWORD
 
 #define RDR_CFG0       0x00050000
 #define RDR_CFG1       0x00050004
+#define RDR_CFG2       0x00050008
 #define RDR_TLCTL0     0x00050318
 
 /* APB DMAC Current Buffer Pointer */
diff --git a/drivers/media/video/cx23885/cx23885.h 
b/drivers/media/video/cx23885/cx23885.h
index 974ec14..48d0c87 100644
--- a/drivers/media/video/cx23885/cx23885.h
+++ b/drivers/media/video/cx23885/cx23885.h
@@ -191,6 +191,7 @@ struct cx23885_dev {
        u32                        __iomem *lmmio;
        u8                         __iomem *bmmio;
        int                        pci_irqmask;
+       int                        hwrevision;
 
        /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */
        struct cx23885_i2c         i2c_bus[3];
-
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