summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2007-03-19 18:22:41 -0400
committerSteven Toth <stoth@hauppauge.com>2007-03-19 18:22:41 -0400
commit41bf634ac7a89ba80e7159f236401dbfdfd8b654 (patch)
treeac7c44cfeaf5cf22e50976e71f86d358d79b2432 /linux/drivers/media
parente8afab1a8a11384e9f406b0a5d9e0b72f04f0616 (diff)
downloadmediapointer-dvb-s2-41bf634ac7a89ba80e7159f236401dbfdfd8b654.tar.gz
mediapointer-dvb-s2-41bf634ac7a89ba80e7159f236401dbfdfd8b654.tar.bz2
Removed the need to manually define .bridge for each card.
From: Steven Toth <stoth@hauppauge.com> 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>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/cx23885/cx23885-cards.c3
-rw-r--r--linux/drivers/media/video/cx23885/cx23885-core.c24
-rw-r--r--linux/drivers/media/video/cx23885/cx23885.h11
3 files changed, 17 insertions, 21 deletions
diff --git a/linux/drivers/media/video/cx23885/cx23885-cards.c b/linux/drivers/media/video/cx23885/cx23885-cards.c
index 315c7de0a..ec0e9544b 100644
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c
@@ -33,7 +33,6 @@
struct cx23885_board cx23885_boards[] = {
[CX23885_BOARD_UNKNOWN] = {
.name = "UNKNOWN/GENERIC",
- .bridge = CX23885_BRIDGE_UNDEFINED,
.input = {{
.type = CX23885_VMUX_COMPOSITE1,
.vmux = 0,
@@ -50,7 +49,6 @@ struct cx23885_board cx23885_boards[] = {
},
[CX23885_BOARD_HAUPPAUGE_HVR1800lp] = {
.name = "Hauppauge WinTV-HVR1800lp",
- .bridge = CX23885_BRIDGE_885,
.portc = CX23885_MPEG_DVB,
.input = {{
.type = CX23885_VMUX_TELEVISION,
@@ -72,7 +70,6 @@ struct cx23885_board cx23885_boards[] = {
},
[CX23885_BOARD_HAUPPAUGE_HVR1800] = {
.name = "Hauppauge WinTV-HVR1800",
- .bridge = CX23885_BRIDGE_887,
.portc = CX23885_MPEG_DVB,
.input = {{
.type = CX23885_VMUX_TELEVISION,
diff --git a/linux/drivers/media/video/cx23885/cx23885-core.c b/linux/drivers/media/video/cx23885/cx23885-core.c
index 67d74296f..6a920b0c1 100644
--- a/linux/drivers/media/video/cx23885/cx23885-core.c
+++ b/linux/drivers/media/video/cx23885/cx23885-core.c
@@ -462,8 +462,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);
@@ -780,18 +780,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);
@@ -1052,7 +1050,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 */
diff --git a/linux/drivers/media/video/cx23885/cx23885.h b/linux/drivers/media/video/cx23885/cx23885.h
index 364a2708d..4fcf4f9ff 100644
--- a/linux/drivers/media/video/cx23885/cx23885.h
+++ b/linux/drivers/media/video/cx23885/cx23885.h
@@ -102,11 +102,6 @@ struct cx23885_board {
CX23885_MPEG_UNDEFINED = 0,
CX23885_MPEG_DVB
} portc;
- enum {
- CX23885_BRIDGE_UNDEFINED = 0,
- CX23885_BRIDGE_885 = 885,
- CX23885_BRIDGE_887 = 887,
- } bridge;
struct cx23885_input input[MAX_CX23885_INPUT];
};
@@ -211,6 +206,12 @@ struct cx23885_dev {
/* sram configuration */
struct sram_channel *sram_channels;
+
+ enum {
+ CX23885_BRIDGE_UNDEFINED = 0,
+ CX23885_BRIDGE_885 = 885,
+ CX23885_BRIDGE_887 = 887,
+ } bridge;
};
#define SRAM_CH01 0 /* Video A */