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>
This commit is contained in:
Steven Toth 2007-03-19 18:01:07 -03:00 committed by Mauro Carvalho Chehab
parent 3bd4065961
commit 3328e4fbf1
2 changed files with 3 additions and 76 deletions

View File

@ -584,7 +584,6 @@ void cx23885_reset(struct cx23885_dev *dev)
mdelay(100); mdelay(100);
#if SRAM
cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH01 ], 188*4, 0); cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH01 ], 188*4, 0);
cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH02 ], 128, 0); cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH02 ], 128, 0);
cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH03 ], 128, 0); cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH03 ], 128, 0);
@ -595,37 +594,6 @@ void cx23885_reset(struct cx23885_dev *dev)
cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH08 ], 128, 0); cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH08 ], 128, 0);
cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH09 ], 128, 0); cx23885_sram_channel_setup(dev, &dev->sram_channels[ SRAM_CH09 ], 128, 0);
#else
// FIXME: Put a pointer to the sram_channel table in cx23885_dev
// and stop all this ugly switch/if code
switch(cx23885_boards[dev->board].bridge) {
case CX23885_BRIDGE_885:
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH01 ], 188*4, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH02 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH03 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH04 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH05 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH06 ], 188*4, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH07 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH08 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23885_sram_channels[ SRAM_CH09 ], 128, 0);
break;
case CX23885_BRIDGE_887:
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH01 ], 188*4, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH02 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH03 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH04 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH05 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH06 ], 188*4, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH07 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH08 ], 128, 0);
cx23885_sram_channel_setup(dev, &cx23887_sram_channels[ SRAM_CH09 ], 128, 0);
break;
default:
printk(KERN_ERR "%s() error, default case", __FUNCTION__ );
}
#endif
switch(dev->board) { switch(dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1800: case CX23885_BOARD_HAUPPAUGE_HVR1800:
/* GPIO-0 656_CLK */ /* GPIO-0 656_CLK */
@ -1019,38 +987,14 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
dprintk(1, "%s() w: %d, h: %d, f: %d\n", __FUNCTION__, dprintk(1, "%s() w: %d, h: %d, f: %d\n", __FUNCTION__,
buf->vb.width, buf->vb.height, buf->vb.field); buf->vb.width, buf->vb.height, buf->vb.field);
#if SRAM
/* setup fifo + format */ /* setup fifo + format */
cx23885_sram_channel_setup(dev, cx23885_sram_channel_setup(dev,
&dev->sram_channels[ port->sram_chno ], &dev->sram_channels[ port->sram_chno ],
port->ts_packet_size, buf->risc.dma); port->ts_packet_size, buf->risc.dma);
if(debug > 5) if(debug > 5) {
cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ] ); cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ] );
#else
// FIXME: Put a pointer to the sram_channel table in cx23885_dev
// and stop all this ugly switch/if code
switch(cx23885_boards[dev->board].bridge) {
case CX23885_BRIDGE_885:
cx23885_sram_channel_setup(dev,
&cx23885_sram_channels[ port->sram_chno ],
port->ts_packet_size, buf->risc.dma);
if(debug > 5)
cx23885_sram_channel_dump(dev, &cx23885_sram_channels[ port->sram_chno ] );
break;
case CX23885_BRIDGE_887:
cx23885_sram_channel_setup(dev,
&cx23887_sram_channels[ port->sram_chno ],
port->ts_packet_size, buf->risc.dma);
if(debug > 5)
cx23885_sram_channel_dump(dev, &cx23887_sram_channels[ port->sram_chno ] );
break;
default:
printk(KERN_ERR "%s() error, default case", __FUNCTION__ );
}
#endif
if(debug > 5)
cx23885_risc_disasm(port, &buf->risc); cx23885_risc_disasm(port, &buf->risc);
}
/* write TS length to chip */ /* write TS length to chip */
cx_write(port->reg_lngth, buf->vb.width); cx_write(port->reg_lngth, buf->vb.width);
@ -1323,18 +1267,8 @@ static void cx23885_timeout(unsigned long data)
dprintk(1, "%s()\n",__FUNCTION__); dprintk(1, "%s()\n",__FUNCTION__);
if (debug > 5) if (debug > 5)
#if SRAM
cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]); cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]);
#else
{
// FIXME: Put a pointer to the sram_channel table in cx23885_dev
// and stop all this ugly switch/if code
if(cx23885_boards[dev->board].bridge == CX23885_BRIDGE_885)
cx23885_sram_channel_dump(dev, &cx23885_sram_channels[ port->sram_chno ]);
if(cx23885_boards[dev->board].bridge == CX23885_BRIDGE_887)
cx23885_sram_channel_dump(dev, &cx23887_sram_channels[ port->sram_chno ]);
}
#endif
cx23885_stop_dma(port); cx23885_stop_dma(port);
do_cancel_buffers(port, "timeout", 1); do_cancel_buffers(port, "timeout", 1);
} }
@ -1431,12 +1365,7 @@ static irqreturn_t cx23885_irq(int irq, void *dev_id)
printk(KERN_ERR "%s: mpeg risc op code error\n", dev->name); printk(KERN_ERR "%s: mpeg risc op code error\n", dev->name);
cx_clear(port->reg_dma_ctl, port->dma_ctl_val); cx_clear(port->reg_dma_ctl, port->dma_ctl_val);
#if SRAM
cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]); cx23885_sram_channel_dump(dev, &dev->sram_channels[ port->sram_chno ]);
#else
cx23885_sram_channel_dump(dev, &cx23885_sram_channels[ port->sram_chno ]);
#endif
} else if (ts2_status & VID_C_MSK_RISCI1) { } else if (ts2_status & VID_C_MSK_RISCI1) {

View File

@ -44,8 +44,6 @@
#define CX23885_MAXBOARDS 8 #define CX23885_MAXBOARDS 8
#define SRAM 0
/* Max number of inputs by card */ /* Max number of inputs by card */
#define MAX_CX23885_INPUT 8 #define MAX_CX23885_INPUT 8