aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2007-03-19 18:22:41 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:08:06 -0400
commite133be0f587996f112d7984c03606af418a7ca05 (patch)
tree3b78505e5b265d7d95db6f7bfc0835aa15ed5788 /drivers/media/video/cx23885
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')
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c3
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c24
-rw-r--r--drivers/media/video/cx23885/cx23885.h11
3 files changed, 17 insertions, 21 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index 9344fb5d95f6..decf602ab164 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -32,7 +32,6 @@
32struct cx23885_board cx23885_boards[] = { 32struct cx23885_board cx23885_boards[] = {
33 [CX23885_BOARD_UNKNOWN] = { 33 [CX23885_BOARD_UNKNOWN] = {
34 .name = "UNKNOWN/GENERIC", 34 .name = "UNKNOWN/GENERIC",
35 .bridge = CX23885_BRIDGE_UNDEFINED,
36 .input = {{ 35 .input = {{
37 .type = CX23885_VMUX_COMPOSITE1, 36 .type = CX23885_VMUX_COMPOSITE1,
38 .vmux = 0, 37 .vmux = 0,
@@ -49,7 +48,6 @@ struct cx23885_board cx23885_boards[] = {
49 }, 48 },
50 [CX23885_BOARD_HAUPPAUGE_HVR1800lp] = { 49 [CX23885_BOARD_HAUPPAUGE_HVR1800lp] = {
51 .name = "Hauppauge WinTV-HVR1800lp", 50 .name = "Hauppauge WinTV-HVR1800lp",
52 .bridge = CX23885_BRIDGE_885,
53 .portc = CX23885_MPEG_DVB, 51 .portc = CX23885_MPEG_DVB,
54 .input = {{ 52 .input = {{
55 .type = CX23885_VMUX_TELEVISION, 53 .type = CX23885_VMUX_TELEVISION,
@@ -71,7 +69,6 @@ struct cx23885_board cx23885_boards[] = {
71 }, 69 },
72 [CX23885_BOARD_HAUPPAUGE_HVR1800] = { 70 [CX23885_BOARD_HAUPPAUGE_HVR1800] = {
73 .name = "Hauppauge WinTV-HVR1800", 71 .name = "Hauppauge WinTV-HVR1800",
74 .bridge = CX23885_BRIDGE_887,
75 .portc = CX23885_MPEG_DVB, 72 .portc = CX23885_MPEG_DVB,
76 .input = {{ 73 .input = {{
77 .type = CX23885_VMUX_TELEVISION, 74 .type = CX23885_VMUX_TELEVISION,
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index b1f75350e83d..d8e376dee68b 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,
452 cx_write(ch->cnt2_reg, (lines*16) >> 3); 452 cx_write(ch->cnt2_reg, (lines*16) >> 3);
453 cx_write(ch->cnt1_reg, (bpl >> 3) -1); 453 cx_write(ch->cnt1_reg, (bpl >> 3) -1);
454 454
455 dprintk(2,"[bridged %d] sram setup %s: bpl=%d lines=%d\n", 455 dprintk(2,"[bridge %d] sram setup %s: bpl=%d lines=%d\n",
456 cx23885_boards[dev->board].bridge, 456 dev->bridge,
457 ch->name, 457 ch->name,
458 bpl, 458 bpl,
459 lines); 459 lines);
@@ -770,18 +770,16 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
770 dev->board, card[dev->nr] == dev->board ? 770 dev->board, card[dev->nr] == dev->board ?
771 "insmod option" : "autodetected"); 771 "insmod option" : "autodetected");
772 772
773 /* Configure the hardware internal memory for fifos */ 773 /* Configure the internal memory */
774 switch(cx23885_boards[dev->board].bridge) { 774 if(dev->pci->device == 0x8880) {
775 case CX23885_BRIDGE_UNDEFINED: 775 dev->bridge = CX23885_BRIDGE_887;
776 case CX23885_BRIDGE_885:
777 dev->sram_channels = cx23885_sram_channels;
778 break;
779 case CX23885_BRIDGE_887:
780 dev->sram_channels = cx23887_sram_channels; 776 dev->sram_channels = cx23887_sram_channels;
781 break; 777 } else
782 default: 778 if(dev->pci->device == 0x8852) {
783 printk(KERN_ERR "%s() error, default case", __FUNCTION__ ); 779 dev->bridge = CX23885_BRIDGE_885;
780 dev->sram_channels = cx23885_sram_channels;
784 } 781 }
782 dprintk(1, "%s() Memory configured for PCIe bridge type %d\n", __FUNCTION__, dev->bridge);
785 783
786 /* init hardware */ 784 /* init hardware */
787 cx23885_reset(dev); 785 cx23885_reset(dev);
@@ -1037,7 +1035,7 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
1037 * starting or stopping interrupts or dma. Avoid the bug for the time being, 1035 * starting or stopping interrupts or dma. Avoid the bug for the time being,
1038 * enabling the developer to work on the demod/tuner locking work. 1036 * enabling the developer to work on the demod/tuner locking work.
1039 */ 1037 */
1040 switch(cx23885_boards[dev->board].bridge) { 1038 switch(dev->bridge) {
1041 case CX23885_BRIDGE_885: 1039 case CX23885_BRIDGE_885:
1042 case CX23885_BRIDGE_887: 1040 case CX23885_BRIDGE_887:
1043 /* enable irqs */ 1041 /* enable irqs */
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h
index 04105bcf53f3..4e1fc68d4206 100644
--- a/drivers/media/video/cx23885/cx23885.h
+++ b/drivers/media/video/cx23885/cx23885.h
@@ -101,11 +101,6 @@ struct cx23885_board {
101 CX23885_MPEG_UNDEFINED = 0, 101 CX23885_MPEG_UNDEFINED = 0,
102 CX23885_MPEG_DVB 102 CX23885_MPEG_DVB
103 } portc; 103 } portc;
104 enum {
105 CX23885_BRIDGE_UNDEFINED = 0,
106 CX23885_BRIDGE_885 = 885,
107 CX23885_BRIDGE_887 = 887,
108 } bridge;
109 struct cx23885_input input[MAX_CX23885_INPUT]; 104 struct cx23885_input input[MAX_CX23885_INPUT];
110}; 105};
111 106
@@ -210,6 +205,12 @@ struct cx23885_dev {
210 205
211 /* sram configuration */ 206 /* sram configuration */
212 struct sram_channel *sram_channels; 207 struct sram_channel *sram_channels;
208
209 enum {
210 CX23885_BRIDGE_UNDEFINED = 0,
211 CX23885_BRIDGE_885 = 885,
212 CX23885_BRIDGE_887 = 887,
213 } bridge;
213}; 214};
214 215
215#define SRAM_CH01 0 /* Video A */ 216#define SRAM_CH01 0 /* Video A */