提交 e133be0f 编写于 作者: S Steven Toth 提交者: Mauro Carvalho Chehab

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: NSteven Toth <stoth@hauppauge.com>
Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 0fc0739b
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
struct cx23885_board cx23885_boards[] = { struct cx23885_board cx23885_boards[] = {
[CX23885_BOARD_UNKNOWN] = { [CX23885_BOARD_UNKNOWN] = {
.name = "UNKNOWN/GENERIC", .name = "UNKNOWN/GENERIC",
.bridge = CX23885_BRIDGE_UNDEFINED,
.input = {{ .input = {{
.type = CX23885_VMUX_COMPOSITE1, .type = CX23885_VMUX_COMPOSITE1,
.vmux = 0, .vmux = 0,
...@@ -49,7 +48,6 @@ struct cx23885_board cx23885_boards[] = { ...@@ -49,7 +48,6 @@ struct cx23885_board cx23885_boards[] = {
}, },
[CX23885_BOARD_HAUPPAUGE_HVR1800lp] = { [CX23885_BOARD_HAUPPAUGE_HVR1800lp] = {
.name = "Hauppauge WinTV-HVR1800lp", .name = "Hauppauge WinTV-HVR1800lp",
.bridge = CX23885_BRIDGE_885,
.portc = CX23885_MPEG_DVB, .portc = CX23885_MPEG_DVB,
.input = {{ .input = {{
.type = CX23885_VMUX_TELEVISION, .type = CX23885_VMUX_TELEVISION,
...@@ -71,7 +69,6 @@ struct cx23885_board cx23885_boards[] = { ...@@ -71,7 +69,6 @@ struct cx23885_board cx23885_boards[] = {
}, },
[CX23885_BOARD_HAUPPAUGE_HVR1800] = { [CX23885_BOARD_HAUPPAUGE_HVR1800] = {
.name = "Hauppauge WinTV-HVR1800", .name = "Hauppauge WinTV-HVR1800",
.bridge = CX23885_BRIDGE_887,
.portc = CX23885_MPEG_DVB, .portc = CX23885_MPEG_DVB,
.input = {{ .input = {{
.type = CX23885_VMUX_TELEVISION, .type = CX23885_VMUX_TELEVISION,
......
...@@ -452,8 +452,8 @@ int cx23885_sram_channel_setup(struct cx23885_dev *dev, ...@@ -452,8 +452,8 @@ int cx23885_sram_channel_setup(struct cx23885_dev *dev,
cx_write(ch->cnt2_reg, (lines*16) >> 3); cx_write(ch->cnt2_reg, (lines*16) >> 3);
cx_write(ch->cnt1_reg, (bpl >> 3) -1); cx_write(ch->cnt1_reg, (bpl >> 3) -1);
dprintk(2,"[bridged %d] sram setup %s: bpl=%d lines=%d\n", dprintk(2,"[bridge %d] sram setup %s: bpl=%d lines=%d\n",
cx23885_boards[dev->board].bridge, dev->bridge,
ch->name, ch->name,
bpl, bpl,
lines); lines);
...@@ -770,18 +770,16 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) ...@@ -770,18 +770,16 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
dev->board, card[dev->nr] == dev->board ? dev->board, card[dev->nr] == dev->board ?
"insmod option" : "autodetected"); "insmod option" : "autodetected");
/* Configure the hardware internal memory for fifos */ /* Configure the internal memory */
switch(cx23885_boards[dev->board].bridge) { if(dev->pci->device == 0x8880) {
case CX23885_BRIDGE_UNDEFINED: dev->bridge = CX23885_BRIDGE_887;
case CX23885_BRIDGE_885:
dev->sram_channels = cx23885_sram_channels;
break;
case CX23885_BRIDGE_887:
dev->sram_channels = cx23887_sram_channels; dev->sram_channels = cx23887_sram_channels;
break; } else
default: if(dev->pci->device == 0x8852) {
printk(KERN_ERR "%s() error, default case", __FUNCTION__ ); 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 */ /* init hardware */
cx23885_reset(dev); cx23885_reset(dev);
...@@ -1037,7 +1035,7 @@ static int cx23885_start_dma(struct cx23885_tsport *port, ...@@ -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, * starting or stopping interrupts or dma. Avoid the bug for the time being,
* enabling the developer to work on the demod/tuner locking work. * 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_885:
case CX23885_BRIDGE_887: case CX23885_BRIDGE_887:
/* enable irqs */ /* enable irqs */
......
...@@ -101,11 +101,6 @@ struct cx23885_board { ...@@ -101,11 +101,6 @@ struct cx23885_board {
CX23885_MPEG_UNDEFINED = 0, CX23885_MPEG_UNDEFINED = 0,
CX23885_MPEG_DVB CX23885_MPEG_DVB
} portc; } portc;
enum {
CX23885_BRIDGE_UNDEFINED = 0,
CX23885_BRIDGE_885 = 885,
CX23885_BRIDGE_887 = 887,
} bridge;
struct cx23885_input input[MAX_CX23885_INPUT]; struct cx23885_input input[MAX_CX23885_INPUT];
}; };
...@@ -210,6 +205,12 @@ struct cx23885_dev { ...@@ -210,6 +205,12 @@ struct cx23885_dev {
/* sram configuration */ /* sram configuration */
struct sram_channel *sram_channels; 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 */ #define SRAM_CH01 0 /* Video A */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册