]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
V4L/DVB (6170): cx23885: General cleanup of old code
authorSteven Toth <stoth@hauppauge.com>
Wed, 5 Sep 2007 00:32:41 +0000 (21:32 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:08:21 +0000 (22:08 -0300)
Removed unused code.

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>
drivers/media/video/cx23885/cx23885-cards.c
drivers/media/video/cx23885/cx23885-core.c
drivers/media/video/cx23885/cx23885-dvb.c
drivers/media/video/cx23885/cx23885-i2c.c
drivers/media/video/cx23885/cx23885-reg.h
drivers/media/video/cx23885/cx23885.h

index e6d34fb5b9431bcb947859bfb8949d401c37b65a..09d4376c2e05cea840d4fc7807754102a6a06fe1 100644 (file)
@@ -172,7 +172,6 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
 
        tveeprom_hauppauge_analog(&dev->i2c_bus[0].i2c_client, &tv, eeprom_data);
 
-
        /* Make sure we support the board model */
        switch (tv.model)
        {
index 1148d684188a142b4e4a9b5fec9a2542a180b6f7..7a1c4672041dbf4d34aa93b83093fa6a84c60a96 100644 (file)
@@ -368,11 +368,13 @@ void cx23885_wakeup(struct cx23885_tsport *port,
                        break;
                buf = list_entry(q->active.next,
                                 struct cx23885_buffer, vb.queue);
+
                /* count comes from the hw and is is 16bit wide --
                 * this trick handles wrap-arounds correctly for
                 * up to 32767 buffers in flight... */
                if ((s16) (count - buf->count) < 0)
                        break;
+
                do_gettimeofday(&buf->vb.ts);
                dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i,
                        count, buf->count);
@@ -910,7 +912,6 @@ int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
        /* 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*8)) < 0)
        if ((rc = btcx_riscmem_alloc(pci,risc,instructions*12)) < 0)
                return rc;
 
@@ -945,7 +946,6 @@ int cx23885_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
        instructions  = 1 + (bpl * lines) / PAGE_SIZE + lines;
        instructions += 1;
 
-       //if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0)
        if ((rc = btcx_riscmem_alloc(pci,risc,instructions*12)) < 0)
                return rc;
 
@@ -970,7 +970,6 @@ int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
 
        /* write risc instructions */
        rp = risc->cpu;
-       //*(rp++) = cpu_to_le32(RISC_WRITECR  | RISC_IRQ2 | RISC_IMM);
        *(rp++) = cpu_to_le32(RISC_WRITECR  | RISC_IRQ2);
        *(rp++) = cpu_to_le32(reg);
        *(rp++) = cpu_to_le32(value);
@@ -1018,16 +1017,11 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
                return -EINVAL;
        }
 
-       // FIXME: review the need for these two lines
-       dprintk( 1, "%s() doing .dvb\n", __FUNCTION__);
        udelay(100);
 
        cx_write(port->reg_hw_sop_ctrl, 0x47 << 16 | 188 << 4);
        cx_write(port->reg_ts_clk_en, port->ts_clk_en_val);
 
-       // FIXME: review the need for this
-       cx_write(GPIO2, 0x00);
-
        switch (dev->board) {
        case CX23885_BOARD_HAUPPAUGE_HVR1250:
        case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
@@ -1037,7 +1031,6 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
                        __FUNCTION__);
                break;
        default:
-               // FIXME
                printk(KERN_ERR "%s() error, default case", __FUNCTION__ );
        }
 
@@ -1058,39 +1051,11 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
                cx_set(PCI_INT_MSK, dev->pci_irqmask | port->pci_irqmask);
                break;
        default:
-               // FIXME: generate a sensible switch-default message
                printk(KERN_ERR "%s() error, default case", __FUNCTION__ );
        }
 
-       dprintk(1, "%s() Register Dump\n", __FUNCTION__);
-       dprintk(1, "%s() set port ts_int_msk, now %x\n", __FUNCTION__, cx_read(port->reg_ts_int_msk) );
-       dprintk(1, "%s() DEV_CNTRL2      0x%08x\n", __FUNCTION__, cx_read(DEV_CNTRL2) );
-       dprintk(1, "%s() PCI_INT_MSK     0x%08x\n", __FUNCTION__, cx_read(PCI_INT_MSK) );
-       dprintk(1, "%s() VID_A_INT_MSK   0x%08x\n", __FUNCTION__, cx_read(VID_A_INT_MSK) );
-       dprintk(1, "%s() VID_B_INT_MSK   0x%08x\n", __FUNCTION__, cx_read(VID_B_INT_MSK) );
-       dprintk(1, "%s() VID_C_INT_MSK   0x%08x\n", __FUNCTION__, cx_read(VID_C_INT_MSK) );
-       dprintk(1, "%s() VID_A_DMA_CTL   0x%08x\n", __FUNCTION__, cx_read(VID_A_DMA_CTL) );
-       dprintk(1, "%s() VID_B_DMA_CTL   0x%08x\n", __FUNCTION__, cx_read(VID_B_DMA_CTL) );
-       dprintk(1, "%s() VID_C_DMA_CTL   0x%08x\n", __FUNCTION__, cx_read(VID_C_DMA_CTL) );
-       dprintk(1, "%s() AUD_INT_INT_MSK 0x%08x\n", __FUNCTION__, cx_read(AUDIO_INT_INT_MSK) );
-       dprintk(1, "%s() AUD_INT_DMA_CTL 0x%08x\n", __FUNCTION__, cx_read(AUD_INT_DMA_CTL) );
-       dprintk(1, "%s() AUD_EXT_INT_MSK 0x%08x\n", __FUNCTION__, cx_read(AUDIO_EXT_INT_MSK) );
-       dprintk(1, "%s() AUD_EXT_DMA_CTL 0x%08x\n", __FUNCTION__, cx_read(AUD_EXT_DMA_CTL) );
-
        cx_set(DEV_CNTRL2, (1<<5)); /* Enable RISC controller */
 
-       dprintk(1, "%s() set dev_cntrl2, now %x\n", __FUNCTION__, cx_read(DEV_CNTRL2) );
-       dprintk(1, "%s() VID_C_DMA_CTL   , now %x\n", __FUNCTION__, cx_read(port->reg_dma_ctl) );
-       dprintk(1, "%s() VID_C_DMA_CTL   , now %x\n", __FUNCTION__, cx_read(VID_C_DMA_CTL) );
-       dprintk(1, "%s() PAD_CTRL %x\n", __FUNCTION__, cx_read(PAD_CTRL) );
-       dprintk(1, "%s() GPIO2 %x\n", __FUNCTION__, cx_read(GPIO2) );
-       dprintk(1, "%s() VID_C_LN_LNGTH  , now %x\n", __FUNCTION__, cx_read(port->reg_lngth) );
-       dprintk(1, "%s() VID_C_HW_SOP_CTL, now %x\n", __FUNCTION__, cx_read(port->reg_hw_sop_ctrl) );
-       dprintk(1, "%s() VID_C_GEN_CTL   , now %x\n", __FUNCTION__, cx_read(port->reg_gen_ctrl) );
-       dprintk(1, "%s() VID_C_SOP_STATUS, now %x\n", __FUNCTION__, cx_read(VID_C_SOP_STATUS) );
-       dprintk(1, "%s() VID_C_TS_CLK_EN , now %x\n", __FUNCTION__, cx_read(VID_C_TS_CLK_EN) );
-       dprintk(1, "%s() VID_C_FIFO_OVLST, now %x\n", __FUNCTION__, cx_read(VID_C_FIFO_OVFL_STAT) );
-       dprintk(1, "%s() VID_C_INT_MSTAT , now 0x%08x\n", __FUNCTION__, cx_read(VID_C_INT_MSTAT) );
        return 0;
 }
 
@@ -1220,7 +1185,6 @@ void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf)
                mod_timer(&cx88q->timeout, jiffies + BUFFER_TIMEOUT);
                dprintk(1, "[%p/%d] %s - first active\n",
                        buf, buf->vb.i, __FUNCTION__);
-
        } else {
                dprintk( 1, "queue is not empty - append to active\n" );
                prev = list_entry(cx88q->active.prev, struct cx23885_buffer,
index 63a1dde0d17af57f473cbef433bab968879c533a..58ae15a99e9ce384e7d5e22e51c78575b55f956b 100644 (file)
@@ -33,7 +33,7 @@
 #include "s5h1409.h"
 #include "mt2131.h"
 
-static unsigned int debug = 2;
+static unsigned int debug = 0;
 
 #define dprintk(level,fmt, arg...)     if (debug >= level) \
        printk(KERN_DEBUG "%s: " fmt, dev->name, ## arg)
@@ -106,8 +106,6 @@ static struct s5h1409_config hauppauge_hvr1250_config = {
        .status_mode   = S5H1409_DEMODLOCKING
 };
 
-
-
 static struct mt2131_config hauppauge_hvr1800lp_rev2_tunerconfig = {
        0x61
 };
index 6b49b414aebfeb11526a60544da66fb9bfaefdbe..5572fbbbb5ae7b7411276b063b79666c0932730b 100644 (file)
@@ -130,7 +130,6 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
                if (cnt < msg->len-1 || !last)
                        ctrl |= I2C_NOSTOP | I2C_EXTEND;
 
-               //printk("addr = 0x%08x  wdata = 0x%08x  ctrl = 0x%08x\n", addr, wdata, ctrl);
                cx_write(bus->reg_addr, addr);
                cx_write(bus->reg_wdata, wdata);
                cx_write(bus->reg_ctrl, ctrl);
@@ -297,7 +296,6 @@ static struct i2c_adapter cx23885_i2c_adap_template = {
        .owner             = THIS_MODULE,
        .id                = I2C_HW_B_CX23885,
        .algo              = &cx23885_i2c_algo_template,
-//     .class             = I2C_CLASS_TV_ANALOG,
        .client_register   = attach_inform,
        .client_unregister = detach_inform,
 };
@@ -348,6 +346,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
 
        strlcpy(bus->i2c_adap.name, bus->dev->name,
                sizeof(bus->i2c_adap.name));
+
        bus->i2c_algo.data = bus;
        bus->i2c_adap.algo_data = bus;
        i2c_add_adapter(&bus->i2c_adap);
index 771b22ac2153b2948b7273e4176a616660de745e..6527bd3b4d773d68ab3457ae93680e52414dc307 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef _CX23885_REG_H_
 #define _CX23885_REG_H_
 
-
 /*
 Address Map
 0x00000000 -> 0x00009000   TX SRAM  (Fifos)
@@ -50,8 +49,6 @@ Channel manager Data Structure entry = 20 DWORD
   5  InstructionQueueSize
 ...  Reserved
  19  Reserved
-
-
 */
 
 /* Risc Instructions */
@@ -70,15 +67,9 @@ Channel manager Data Structure entry = 20 DWORD
 #define RISC_WRITERM            0xB0000000
 #define RISC_WRITECM            0xC0000000
 #define RISC_WRITECR            0xD0000000
-
-
-/* Do we need these? */
 #define RISC_WRITEC             0x50000000
 #define RISC_READC              0xA0000000
 
-/* Is this used? */
-#define RISC_IMM                0x00000001
-
 
 /* Audio and Video Core */
 #define HOST_REG1              0x00000000
index 300a97980acbac1e8eb4ce45cdb3a884616fe3b0..c0f4e4337351694e157241e89d7c3471e6de51e4 100644 (file)
@@ -245,7 +245,6 @@ struct sram_channel {
 #define cx_set(reg,bit)          cx_andor((reg),(bit),(bit))
 #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);