V4L/DVB (6575): cx23885/: cleanups
This patch contains the following cleanups: - make the following needlessly global code static: - cx23885-core.c: struct cx23885_sram_channels[] - cx23885-core.c: struct cx23887_sram_channels[] - cx23885-core.c: cx23885_wakeup() - cx23885-core.c: cx23885_sram_channel_setup() - cx23885-core.c: cx23885_sram_channel_dump() - cx23885-core.c: cx23885_risc_disasm() - cx23885-core.c: cx23885_shutdown() - cx23885-core.c: cx23885_reset() - cx23885-core.c: cx23885_dev_unregister() - cx23885-core.c: cx23885_risc_databuffer() - cx23885-core.c: cx23885_risc_stopper() - #if 0 the following unused functions: - cx23885-core.c: cx23885_risc_buffer() - cx23885-core.c: cx23885_cancel_buffers() - remove the following unused EXPORT_SYMBOL's: - cx23885-cards.c: cx23885_boards - cx23885-i2c.c: cx23885_call_i2c_clients Signed-off-by: Adrian Bunk <bunk@kernel.org> Reviewed-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
9695a49839
commit
39e75cfedf
|
@ -270,8 +270,6 @@ void cx23885_card_setup(struct cx23885_dev *dev)
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
EXPORT_SYMBOL(cx23885_boards);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
* c-basic-offset: 8
|
* c-basic-offset: 8
|
||||||
|
|
|
@ -73,7 +73,7 @@ static LIST_HEAD(cx23885_devlist);
|
||||||
* 0x00010ea0 0x00010xxx Free
|
* 0x00010ea0 0x00010xxx Free
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct sram_channel cx23885_sram_channels[] = {
|
static struct sram_channel cx23885_sram_channels[] = {
|
||||||
[SRAM_CH01] = {
|
[SRAM_CH01] = {
|
||||||
.name = "test ch1",
|
.name = "test ch1",
|
||||||
.cmds_start = 0x10000,
|
.cmds_start = 0x10000,
|
||||||
|
@ -205,7 +205,7 @@ struct sram_channel cx23885_sram_channels[] = {
|
||||||
* 0x00010ea0 0x00010xxx Free
|
* 0x00010ea0 0x00010xxx Free
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct sram_channel cx23887_sram_channels[] = {
|
static struct sram_channel cx23887_sram_channels[] = {
|
||||||
[SRAM_CH01] = {
|
[SRAM_CH01] = {
|
||||||
.name = "test ch1",
|
.name = "test ch1",
|
||||||
.cmds_start = 0x0,
|
.cmds_start = 0x0,
|
||||||
|
@ -356,7 +356,7 @@ static int cx23885_risc_decode(u32 risc)
|
||||||
return incr[risc >> 28] ? incr[risc >> 28] : 1;
|
return incr[risc >> 28] ? incr[risc >> 28] : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_wakeup(struct cx23885_tsport *port,
|
static void cx23885_wakeup(struct cx23885_tsport *port,
|
||||||
struct cx23885_dmaqueue *q, u32 count)
|
struct cx23885_dmaqueue *q, u32 count)
|
||||||
{
|
{
|
||||||
struct cx23885_dev *dev = port->dev;
|
struct cx23885_dev *dev = port->dev;
|
||||||
|
@ -391,10 +391,8 @@ void cx23885_wakeup(struct cx23885_tsport *port,
|
||||||
printk("%s: %d buffers handled (should be 1)\n",
|
printk("%s: %d buffers handled (should be 1)\n",
|
||||||
__FUNCTION__, bc);
|
__FUNCTION__, bc);
|
||||||
}
|
}
|
||||||
void cx23885_sram_channel_dump(struct cx23885_dev *dev,
|
|
||||||
struct sram_channel *ch);
|
|
||||||
|
|
||||||
int cx23885_sram_channel_setup(struct cx23885_dev *dev,
|
static int cx23885_sram_channel_setup(struct cx23885_dev *dev,
|
||||||
struct sram_channel *ch,
|
struct sram_channel *ch,
|
||||||
unsigned int bpl, u32 risc)
|
unsigned int bpl, u32 risc)
|
||||||
{
|
{
|
||||||
|
@ -467,7 +465,7 @@ int cx23885_sram_channel_setup(struct cx23885_dev *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_sram_channel_dump(struct cx23885_dev *dev,
|
static void cx23885_sram_channel_dump(struct cx23885_dev *dev,
|
||||||
struct sram_channel *ch)
|
struct sram_channel *ch)
|
||||||
{
|
{
|
||||||
static char *name[] = {
|
static char *name[] = {
|
||||||
|
@ -529,7 +527,7 @@ void cx23885_sram_channel_dump(struct cx23885_dev *dev,
|
||||||
dev->name, cx_read(ch->cnt2_reg));
|
dev->name, cx_read(ch->cnt2_reg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_risc_disasm(struct cx23885_tsport *port,
|
static void cx23885_risc_disasm(struct cx23885_tsport *port,
|
||||||
struct btcx_riscmem *risc)
|
struct btcx_riscmem *risc)
|
||||||
{
|
{
|
||||||
struct cx23885_dev *dev = port->dev;
|
struct cx23885_dev *dev = port->dev;
|
||||||
|
@ -548,7 +546,7 @@ void cx23885_risc_disasm(struct cx23885_tsport *port,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_shutdown(struct cx23885_dev *dev)
|
static void cx23885_shutdown(struct cx23885_dev *dev)
|
||||||
{
|
{
|
||||||
/* disable RISC controller */
|
/* disable RISC controller */
|
||||||
cx_write(DEV_CNTRL2, 0);
|
cx_write(DEV_CNTRL2, 0);
|
||||||
|
@ -578,7 +576,7 @@ void cx23885_shutdown(struct cx23885_dev *dev)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_reset(struct cx23885_dev *dev)
|
static void cx23885_reset(struct cx23885_dev *dev)
|
||||||
{
|
{
|
||||||
dprintk(1, "%s()\n", __FUNCTION__);
|
dprintk(1, "%s()\n", __FUNCTION__);
|
||||||
|
|
||||||
|
@ -636,7 +634,7 @@ static int get_resources(struct cx23885_dev *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cx23885_timeout(unsigned long data);
|
static void cx23885_timeout(unsigned long data);
|
||||||
int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
|
static int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
|
||||||
u32 reg, u32 mask, u32 value);
|
u32 reg, u32 mask, u32 value);
|
||||||
|
|
||||||
static int cx23885_init_tsport(struct cx23885_dev *dev, struct cx23885_tsport *port, int portno)
|
static int cx23885_init_tsport(struct cx23885_dev *dev, struct cx23885_tsport *port, int portno)
|
||||||
|
@ -837,7 +835,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_dev_unregister(struct cx23885_dev *dev)
|
static void cx23885_dev_unregister(struct cx23885_dev *dev)
|
||||||
{
|
{
|
||||||
release_mem_region(pci_resource_start(dev->pci,0),
|
release_mem_region(pci_resource_start(dev->pci,0),
|
||||||
pci_resource_len(dev->pci,0));
|
pci_resource_len(dev->pci,0));
|
||||||
|
@ -912,48 +910,11 @@ static u32* cx23885_risc_field(u32 *rp, struct scatterlist *sglist,
|
||||||
return rp;
|
return rp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
|
|
||||||
struct scatterlist *sglist, unsigned int top_offset,
|
|
||||||
unsigned int bottom_offset, unsigned int bpl,
|
|
||||||
unsigned int padding, unsigned int lines)
|
|
||||||
{
|
|
||||||
u32 instructions, fields;
|
|
||||||
u32 *rp;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
fields = 0;
|
static int cx23885_risc_databuffer(struct pci_dev *pci,
|
||||||
if (UNSET != top_offset)
|
struct btcx_riscmem *risc,
|
||||||
fields++;
|
struct scatterlist *sglist,
|
||||||
if (UNSET != bottom_offset)
|
unsigned int bpl,
|
||||||
fields++;
|
|
||||||
|
|
||||||
/* estimate risc mem: worst case is one write per page border +
|
|
||||||
one write per scan line + syncs + jump (all 2 dwords). Padding
|
|
||||||
can cause next bpl to start close to a page border. First DMA
|
|
||||||
region may be smaller than PAGE_SIZE */
|
|
||||||
/* write and jump need and extra dword */
|
|
||||||
instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines);
|
|
||||||
instructions += 2;
|
|
||||||
if ((rc = btcx_riscmem_alloc(pci,risc,instructions*12)) < 0)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
/* write risc instructions */
|
|
||||||
rp = risc->cpu;
|
|
||||||
if (UNSET != top_offset)
|
|
||||||
rp = cx23885_risc_field(rp, sglist, top_offset, 0,
|
|
||||||
bpl, padding, lines);
|
|
||||||
if (UNSET != bottom_offset)
|
|
||||||
rp = cx23885_risc_field(rp, sglist, bottom_offset, 0x200,
|
|
||||||
bpl, padding, lines);
|
|
||||||
|
|
||||||
/* save pointer to jmp instruction address */
|
|
||||||
risc->jmp = rp;
|
|
||||||
BUG_ON((risc->jmp - risc->cpu + 2) * sizeof (*risc->cpu) > risc->size);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cx23885_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
|
|
||||||
struct scatterlist *sglist, unsigned int bpl,
|
|
||||||
unsigned int lines)
|
unsigned int lines)
|
||||||
{
|
{
|
||||||
u32 instructions;
|
u32 instructions;
|
||||||
|
@ -981,7 +942,7 @@ int cx23885_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
|
static int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
|
||||||
u32 reg, u32 mask, u32 value)
|
u32 reg, u32 mask, u32 value)
|
||||||
{
|
{
|
||||||
u32 *rp;
|
u32 *rp;
|
||||||
|
@ -1243,16 +1204,6 @@ static void do_cancel_buffers(struct cx23885_tsport *port, char *reason,
|
||||||
spin_unlock_irqrestore(&port->slock, flags);
|
spin_unlock_irqrestore(&port->slock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cx23885_cancel_buffers(struct cx23885_tsport *port)
|
|
||||||
{
|
|
||||||
struct cx23885_dev *dev = port->dev;
|
|
||||||
struct cx23885_dmaqueue *q = &port->mpegq;
|
|
||||||
|
|
||||||
dprintk(1, "%s()\n", __FUNCTION__);
|
|
||||||
del_timer_sync(&q->timeout);
|
|
||||||
cx23885_stop_dma(port);
|
|
||||||
do_cancel_buffers(port, "cancel", 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void cx23885_timeout(unsigned long data)
|
static void cx23885_timeout(unsigned long data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -368,8 +368,6 @@ int cx23885_i2c_unregister(struct cx23885_i2c *bus)
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
EXPORT_SYMBOL(cx23885_call_i2c_clients);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
* c-basic-offset: 8
|
* c-basic-offset: 8
|
||||||
|
|
|
@ -254,10 +254,6 @@ struct sram_channel {
|
||||||
#define cx_set(reg,bit) cx_andor((reg),(bit),(bit))
|
#define cx_set(reg,bit) cx_andor((reg),(bit),(bit))
|
||||||
#define cx_clear(reg,bit) cx_andor((reg),(bit),0)
|
#define cx_clear(reg,bit) cx_andor((reg),(bit),0)
|
||||||
|
|
||||||
extern int cx23885_sram_channel_setup(struct cx23885_dev *dev,
|
|
||||||
struct sram_channel *ch,
|
|
||||||
unsigned int bpl, u32 risc);
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------- */
|
/* ----------------------------------------------------------- */
|
||||||
/* cx23885-cards.c */
|
/* cx23885-cards.c */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue