aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/cx23885/cx23885-core.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2007-03-19 19:22:41 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 22:08:06 -0300
commite133be0f587996f112d7984c03606af418a7ca05 (patch)
tree3b78505e5b265d7d95db6f7bfc0835aa15ed5788 /drivers/media/video/cx23885/cx23885-core.c
parent0fc0739ba940c07e97599a7ee04c24faae9808ed (diff)
V4L/DVB (6157): Removed the need to manually define .bridge for each card
Moved the field from cx23885_board to cx23885_dev and added code to iautomatically set the bridge type based on the pci device id. Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-core.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index b1f75350e83..d8e376dee68 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -452,8 +452,8 @@ int cx23885_sram_channel_setup(struct cx23885_dev *dev,
cx_write(ch->cnt2_reg, (lines*16) >> 3);
cx_write(ch->cnt1_reg, (bpl >> 3) -1);
- dprintk(2,"[bridged %d] sram setup %s: bpl=%d lines=%d\n",
- cx23885_boards[dev->board].bridge,
+ dprintk(2,"[bridge %d] sram setup %s: bpl=%d lines=%d\n",
+ dev->bridge,
ch->name,
bpl,
lines);
@@ -770,18 +770,16 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
dev->board, card[dev->nr] == dev->board ?
"insmod option" : "autodetected");
- /* Configure the hardware internal memory for fifos */
- switch(cx23885_boards[dev->board].bridge) {
- case CX23885_BRIDGE_UNDEFINED:
- case CX23885_BRIDGE_885:
- dev->sram_channels = cx23885_sram_channels;
- break;
- case CX23885_BRIDGE_887:
+ /* Configure the internal memory */
+ if(dev->pci->device == 0x8880) {
+ dev->bridge = CX23885_BRIDGE_887;
dev->sram_channels = cx23887_sram_channels;
- break;
- default:
- printk(KERN_ERR "%s() error, default case", __FUNCTION__ );
+ } else
+ if(dev->pci->device == 0x8852) {
+ dev->bridge = CX23885_BRIDGE_885;
+ dev->sram_channels = cx23885_sram_channels;
}
+ dprintk(1, "%s() Memory configured for PCIe bridge type %d\n", __FUNCTION__, dev->bridge);
/* init hardware */
cx23885_reset(dev);
@@ -1037,7 +1035,7 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
* starting or stopping interrupts or dma. Avoid the bug for the time being,
* enabling the developer to work on the demod/tuner locking work.
*/
- switch(cx23885_boards[dev->board].bridge) {
+ switch(dev->bridge) {
case CX23885_BRIDGE_885:
case CX23885_BRIDGE_887:
/* enable irqs */