aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-01-10 00:06:35 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:47 -0500
commit0ac5881aefc2dab8b3535c2e44fee6628acaf787 (patch)
tree3259e66a720fa3605d1c350b823a879fdec2c8bf
parentf234081bc564c69eb0e2cd4e957ad1cbae4a6144 (diff)
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 <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c40
-rw-r--r--drivers/media/video/cx23885/cx23885-reg.h1
-rw-r--r--drivers/media/video/cx23885/cx23885.h1
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 f205ad6354e7..a602ac800a4f 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
702 return 0; 702 return 0;
703} 703}
704 704
705static void cx23885_dev_checkrevision(struct cx23885_dev *dev)
706{
707 switch (cx_read(RDR_CFG2) & 0xff) {
708 case 0x00:
709 /* cx23885 */
710 dev->hwrevision = 0xa0;
711 break;
712 case 0x01:
713 /* CX23885-12Z */
714 dev->hwrevision = 0xa1;
715 break;
716 case 0x02:
717 /* CX23885-13Z */
718 dev->hwrevision = 0xb0;
719 break;
720 case 0x03:
721 /* CX23888-22Z */
722 dev->hwrevision = 0xc0;
723 break;
724 case 0x0e:
725 /* CX23887-15Z */
726 dev->hwrevision = 0xc0;
727 case 0x0f:
728 /* CX23887-14Z */
729 dev->hwrevision = 0xb1;
730 break;
731 default:
732 printk(KERN_ERR "%s() New hardware revision found 0x%x\n",
733 __FUNCTION__, dev->hwrevision);
734 }
735 if (dev->hwrevision)
736 printk(KERN_INFO "%s() Hardware revision = 0x%02x\n",
737 __FUNCTION__, dev->hwrevision);
738 else
739 printk(KERN_ERR "%s() Hardware revision unknown 0x%x\n",
740 __FUNCTION__, dev->hwrevision);
741}
742
705static int cx23885_dev_setup(struct cx23885_dev *dev) 743static int cx23885_dev_setup(struct cx23885_dev *dev)
706{ 744{
707 int i; 745 int i;
@@ -832,6 +870,8 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
832 } 870 }
833 } 871 }
834 872
873 cx23885_dev_checkrevision(dev);
874
835 return 0; 875 return 0;
836} 876}
837 877
diff --git a/drivers/media/video/cx23885/cx23885-reg.h b/drivers/media/video/cx23885/cx23885-reg.h
index 162169f9091b..38abf49b63a1 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
276 276
277#define RDR_CFG0 0x00050000 277#define RDR_CFG0 0x00050000
278#define RDR_CFG1 0x00050004 278#define RDR_CFG1 0x00050004
279#define RDR_CFG2 0x00050008
279#define RDR_TLCTL0 0x00050318 280#define RDR_TLCTL0 0x00050318
280 281
281/* APB DMAC Current Buffer Pointer */ 282/* APB DMAC Current Buffer Pointer */
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h
index 974ec14782d7..48d0c87ddbc2 100644
--- a/drivers/media/video/cx23885/cx23885.h
+++ b/drivers/media/video/cx23885/cx23885.h
@@ -191,6 +191,7 @@ struct cx23885_dev {
191 u32 __iomem *lmmio; 191 u32 __iomem *lmmio;
192 u8 __iomem *bmmio; 192 u8 __iomem *bmmio;
193 int pci_irqmask; 193 int pci_irqmask;
194 int hwrevision;
194 195
195 /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */ 196 /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */
196 struct cx23885_i2c i2c_bus[3]; 197 struct cx23885_i2c i2c_bus[3];