diff options
author | Steven Toth <stoth@hauppauge.com> | 2007-03-19 17:01:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:08:02 -0400 |
commit | 3328e4fbf10a2c2513d4de662ab251e0f4cb7c3e (patch) | |
tree | e6495cb1d9e96d5740824f379c201e95c05ad120 /drivers/media/video/cx23885/cx23885-core.c | |
parent | 3bd4065961aa03d030cd58feec03d60479fc4348 (diff) |
V4L/DVB (6155): Cleanup/remove code to access the sram memory maps
The cx23885 and cx23887 family use two different memory maps which govern
how the internal SRAM is configured. This patch streamlines the access to those
structures.
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.c | 77 |
1 files changed, 3 insertions, 74 deletions
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index 5769db47529c..b1f75350e83d 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c | |||
@@ -584,7 +584,6 @@ void cx23885_reset(struct cx23885_dev *dev) | |||
584 | 584 | ||
585 | mdelay(100); | 585 | mdelay(100); |
586 | 586 | ||
587 | #if SRAM | ||
588 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH01 ], 188*4, 0); | 587 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH01 ], 188*4, 0); |
589 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH02 ], 128, 0); | 588 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH02 ], 128, 0); |
590 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH03 ], 128, 0); | 589 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH03 ], 128, 0); |
@@ -595,37 +594,6 @@ void cx23885_reset(struct cx23885_dev *dev) | |||
595 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH08 ], 128, 0); | 594 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH08 ], 128, 0); |
596 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH09 ], 128, 0); | 595 | cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH09 ], 128, 0); |
597 | 596 | ||
598 | #else | ||
599 | // FIXME: Put a pointer to the sram_channel table in cx23885_dev | ||
600 | // and stop all this ugly switch/if code | ||
601 | switch(cx23885_boards[dev->board].bridge) { | ||
602 | case CX23885_BRIDGE_885: | ||
603 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH01 ], 188*4, 0); | ||
604 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH02 ], 128, 0); | ||
605 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH03 ], 128, 0); | ||
606 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH04 ], 128, 0); | ||
607 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH05 ], 128, 0); | ||
608 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH06 ], 188*4, 0); | ||
609 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH07 ], 128, 0); | ||
610 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH08 ], 128, 0); | ||
611 | cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH09 ], 128, 0); | ||
612 | break; | ||
613 | case CX23885_BRIDGE_887: | ||
614 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH01 ], 188*4, 0); | ||
615 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH02 ], 128, 0); | ||
616 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH03 ], 128, 0); | ||
617 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH04 ], 128, 0); | ||
618 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH05 ], 128, 0); | ||
619 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH06 ], 188*4, 0); | ||
620 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH07 ], 128, 0); | ||
621 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH08 ], 128, 0); | ||
622 | cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH09 ], 128, 0); | ||
623 | break; | ||
624 | default: | ||
625 | printk(KERN_ERR "%s() error, default case", __FUNCTION__ ); | ||
626 | } | ||
627 | #endif | ||
628 | |||
629 | switch(dev->board) { | 597 | switch(dev->board) { |
630 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 598 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
631 | /* GPIO-0 656_CLK */ | 599 | /* GPIO-0 656_CLK */ |
@@ -1019,38 +987,14 @@ static int cx23885_start_dma(struct cx23885_tsport *port, | |||
1019 | dprintk(1, "%s() w: %d, h: %d, f: %d\n", __FUNCTION__, | 987 | dprintk(1, "%s() w: %d, h: %d, f: %d\n", __FUNCTION__, |
1020 | buf->vb.width, buf->vb.height, buf->vb.field); | 988 | buf->vb.width, buf->vb.height, buf->vb.field); |
1021 | 989 | ||
1022 | #if SRAM | ||
1023 | /* setup fifo + format */ | 990 | /* setup fifo + format */ |
1024 | cx23885_sram_channel_setup(dev, | 991 | cx23885_sram_channel_setup(dev, |
1025 | &dev->sram_channels[ port->sram_chno ], | 992 | &dev->sram_channels[ port->sram_chno ], |
1026 | port->ts_packet_size, buf->risc.dma); | 993 | port->ts_packet_size, buf->risc.dma); |
1027 | if(debug > 5) | 994 | if(debug > 5) { |
1028 | cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ] ); | 995 | cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ] ); |
1029 | #else | ||
1030 | // FIXME: Put a pointer to the sram_channel table in cx23885_dev | ||
1031 | // and stop all this ugly switch/if code | ||
1032 | switch(cx23885_boards[dev->board].bridge) { | ||
1033 | case CX23885_BRIDGE_885: | ||
1034 | cx23885_sram_channel_setup(dev, | ||
1035 | &cx23885_sram_channels[ port->sram_chno ], | ||
1036 | port->ts_packet_size, buf->risc.dma); | ||
1037 | if(debug > 5) | ||
1038 | cx23885_sram_channel_dump(dev, &cx23885_sram_channels[ port->sram_chno ] ); | ||
1039 | break; | ||
1040 | case CX23885_BRIDGE_887: | ||
1041 | cx23885_sram_channel_setup(dev, | ||
1042 | &cx23887_sram_channels[ port->sram_chno ], | ||
1043 | port->ts_packet_size, buf->risc.dma); | ||
1044 | if(debug > 5) | ||
1045 | cx23885_sram_channel_dump(dev, &cx23887_sram_channels[ port->sram_chno ] ); | ||
1046 | break; | ||
1047 | default: | ||
1048 | printk(KERN_ERR "%s() error, default case", __FUNCTION__ ); | ||
1049 | } | ||
1050 | #endif | ||
1051 | |||
1052 | if(debug > 5) | ||
1053 | cx23885_risc_disasm(port, &buf->risc); | 996 | cx23885_risc_disasm(port, &buf->risc); |
997 | } | ||
1054 | 998 | ||
1055 | /* write TS length to chip */ | 999 | /* write TS length to chip */ |
1056 | cx_write(port->reg_lngth, buf->vb.width); | 1000 | cx_write(port->reg_lngth, buf->vb.width); |
@@ -1323,18 +1267,8 @@ static void cx23885_timeout(unsigned long data) | |||
1323 | dprintk(1, "%s()\n",__FUNCTION__); | 1267 | dprintk(1, "%s()\n",__FUNCTION__); |
1324 | 1268 | ||
1325 | if (debug > 5) | 1269 | if (debug > 5) |
1326 | #if SRAM | ||
1327 | cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]); | 1270 | cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]); |
1328 | #else | 1271 | |
1329 | { | ||
1330 | // FIXME: Put a pointer to the sram_channel table in cx23885_dev | ||
1331 | // and stop all this ugly switch/if code | ||
1332 | if(cx23885_boards[dev->board].bridge == CX23885_BRIDGE_885) | ||
1333 | cx23885_sram_channel_dump(dev, &cx23885_sram_channels[ port->sram_chno ]); | ||
1334 | if(cx23885_boards[dev->board].bridge == CX23885_BRIDGE_887) | ||
1335 | cx23885_sram_channel_dump(dev, &cx23887_sram_channels[ port->sram_chno ]); | ||
1336 | } | ||
1337 | #endif | ||
1338 | cx23885_stop_dma(port); | 1272 | cx23885_stop_dma(port); |
1339 | do_cancel_buffers(port, "timeout", 1); | 1273 | do_cancel_buffers(port, "timeout", 1); |
1340 | } | 1274 | } |
@@ -1431,12 +1365,7 @@ static irqreturn_t cx23885_irq(int irq, void *dev_id) | |||
1431 | printk(KERN_ERR "%s: mpeg risc op code error\n", dev->name); | 1365 | printk(KERN_ERR "%s: mpeg risc op code error\n", dev->name); |
1432 | 1366 | ||
1433 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); | 1367 | cx_clear(port->reg_dma_ctl, port->dma_ctl_val); |
1434 | #if SRAM | ||
1435 | cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]); | 1368 | cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]); |
1436 | #else | ||
1437 | cx23885_sram_channel_dump(dev, &cx23885_sram_channels[ port->sram_chno ]); | ||
1438 | #endif | ||
1439 | |||
1440 | 1369 | ||
1441 | } else if (ts2_status & VID_C_MSK_RISCI1) { | 1370 | } else if (ts2_status & VID_C_MSK_RISCI1) { |
1442 | 1371 | ||