diff options
author | Catalin Climov <devnull@localhost> | 2005-08-16 17:23:46 +0000 |
---|---|---|
committer | Catalin Climov <devnull@localhost> | 2005-08-16 17:23:46 +0000 |
commit | b19498b6859f2741ade90d9a7566a38a5f0e6185 (patch) | |
tree | 406f10213ab63ae523f51cf6d8504d18baf4ad09 /linux/drivers/media/video/cx88/cx88-video.c | |
parent | 95d90ef10b35ead2d6cbff0ae2acdedf81ea5ad9 (diff) | |
download | mediapointer-dvb-s2-b19498b6859f2741ade90d9a7566a38a5f0e6185.tar.gz mediapointer-dvb-s2-b19498b6859f2741ade90d9a7566a38a5f0e6185.tar.bz2 |
Minor clean-ups: remove dcprintk and replace all instances of "dev->core"
with "core".
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-video.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 0698809a1..46f1e95d0 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.86 2005/08/16 16:29:52 catalin Exp $ + * $Id: cx88-video.c,v 1.87 2005/08/16 17:23:46 catalin Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -74,8 +74,6 @@ module_param(vid_limit,int,0644); MODULE_PARM_DESC(vid_limit,"capture memory limit in megabytes"); #define dprintk(level,fmt, arg...) if (video_debug >= level) \ - printk(KERN_DEBUG "%s/0: " fmt, dev->core->name , ## arg) -#define dcprintk(level,fmt, arg...) if (video_debug >= level) \ printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) /* ------------------------------------------------------------------ */ @@ -396,7 +394,7 @@ static int video_mux(struct cx88_core *core, unsigned int input) { /* struct cx88_core *core = dev->core; */ - dcprintk(1,"video_mux: %d [vmux=%d,gpio=0x%x,0x%x,0x%x,0x%x]\n", + dprintk(1,"video_mux: %d [vmux=%d,gpio=0x%x,0x%x,0x%x,0x%x]\n", input, INPUT(input)->vmux, INPUT(input)->gpio0,INPUT(input)->gpio1, INPUT(input)->gpio2,INPUT(input)->gpio3); @@ -433,9 +431,9 @@ static int start_video_dma(struct cx8800_dev *dev, struct cx88_core *core = dev->core; /* setup fifo + format */ - cx88_sram_channel_setup(dev->core, &cx88_sram_channels[SRAM_CH21], + cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH21], buf->bpl, buf->risc.dma); - cx88_set_scale(dev->core, buf->vb.width, buf->vb.height, buf->vb.field); + cx88_set_scale(core, buf->vb.width, buf->vb.height, buf->vb.field); cx_write(MO_COLOR_CTRL, buf->fmt->cxformat | ColorFormatGamma); /* reset counter */ @@ -483,6 +481,7 @@ static int stop_video_dma(struct cx8800_dev *dev) static int restart_video_queue(struct cx8800_dev *dev, struct cx88_dmaqueue *q) { + struct cx88_core *core = dev->core; struct cx88_buffer *buf, *prev; struct list_head *item; @@ -552,12 +551,13 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, { struct cx8800_fh *fh = q->priv_data; struct cx8800_dev *dev = fh->dev; + struct cx88_core *core = dev->core; struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb); int rc, init_buffer = 0; BUG_ON(NULL == fh->fmt); - if (fh->width < 48 || fh->width > norm_maxw(dev->core->tvnorm) || - fh->height < 32 || fh->height > norm_maxh(dev->core->tvnorm)) + if (fh->width < 48 || fh->width > norm_maxw(core->tvnorm) || + fh->height < 32 || fh->height > norm_maxh(core->tvnorm)) return -EINVAL; buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3; if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) @@ -637,6 +637,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) struct cx88_buffer *prev; struct cx8800_fh *fh = vq->priv_data; struct cx8800_dev *dev = fh->dev; + struct cx88_core *core = dev->core; struct cx88_dmaqueue *q = &dev->vidq; /* add jump to stopper */ @@ -954,6 +955,7 @@ static int video_open(struct inode *inode, struct file *file) { int minor = iminor(inode); struct cx8800_dev *h,*dev = NULL; + struct cx88_core *core; struct cx8800_fh *fh; struct list_head *list; enum v4l2_buf_type type = 0; @@ -978,6 +980,8 @@ static int video_open(struct inode *inode, struct file *file) if (NULL == dev) return -ENODEV; + core = dev->core; + dprintk(1,"open minor=%d radio=%d type=%s\n", minor,radio,v4l2_type_names[type]); @@ -1008,17 +1012,16 @@ static int video_open(struct inode *inode, struct file *file) fh); if (fh->radio) { - struct cx88_core *core = dev->core; int board = core->board; dprintk(1,"video_open: setting radio device\n"); cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); - dev->core->tvaudio = WW_FM; + core->tvaudio = WW_FM; cx88_set_tvaudio(core); cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); - cx88_call_i2c_clients(dev->core,AUDC_SET_RADIO,NULL); + cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); } return 0; @@ -1199,7 +1202,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl) value = ((ctl->value - c->off) << c->shift) & c->mask; break; } - dcprintk(1,"set_control id=0x%X reg=0x%x val=0x%x%s\n", + dprintk(1,"set_control id=0x%X reg=0x%x val=0x%x%s\n", ctl->id, c->reg, value, c->sreg ? " [shadowed]" : ""); if (c->sreg) { cx_sandor(c->sreg, c->reg, c->mask, value); @@ -1268,6 +1271,8 @@ static int cx8800_g_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh, static int cx8800_try_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh, struct v4l2_format *f) { + struct cx88_core *core = dev->core; + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: { @@ -1280,8 +1285,8 @@ static int cx8800_try_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh, return -EINVAL; field = f->fmt.pix.field; - maxw = norm_maxw(dev->core->tvnorm); - maxh = norm_maxh(dev->core->tvnorm); + maxw = norm_maxw(core->tvnorm); + maxh = norm_maxh(core->tvnorm); if (V4L2_FIELD_ANY == field) { field = (f->fmt.pix.height > maxh/2) @@ -1509,7 +1514,7 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, printk( KERN_INFO "CORE IOCTL: 0x%x\n", cmd ); cx88_print_ioctl(core->name,cmd); #endif - dcprintk( 1, "CORE IOCTL: 0x%x\n", cmd ); + dprintk( 1, "CORE IOCTL: 0x%x\n", cmd ); switch (cmd) { /* ---------- tv norms ---------- */ @@ -1785,7 +1790,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, memset(t,0,sizeof(*t)); strcpy(t->name, "Radio"); - cx88_call_i2c_clients(dev->core,VIDIOC_G_TUNER,t); + cx88_call_i2c_clients(core,VIDIOC_G_TUNER,t); return 0; } case VIDIOC_ENUMINPUT: @@ -1893,7 +1898,7 @@ static void cx8800_vid_timeout(unsigned long data) struct cx88_buffer *buf; unsigned long flags; - cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH21]); + cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); cx_clear(MO_VID_DMACNTRL, 0x11); cx_clear(VID_CAPTURE_CONTROL, 0x06); @@ -1938,14 +1943,14 @@ static void cx8800_vid_irq(struct cx8800_dev *dev) printk(KERN_WARNING "%s/0: video risc op code error\n",core->name); cx_clear(MO_VID_DMACNTRL, 0x11); cx_clear(VID_CAPTURE_CONTROL, 0x06); - cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH21]); + cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); } /* risc1 y */ if (status & 0x01) { spin_lock(&dev->slock); count = cx_read(MO_VIDY_GPCNT); - cx88_wakeup(dev->core, &dev->vidq, count); + cx88_wakeup(core, &dev->vidq, count); spin_unlock(&dev->slock); } @@ -1953,7 +1958,7 @@ static void cx8800_vid_irq(struct cx8800_dev *dev) if (status & 0x08) { spin_lock(&dev->slock); count = cx_read(MO_VBI_GPCNT); - cx88_wakeup(dev->core, &dev->vbiq, count); + cx88_wakeup(core, &dev->vbiq, count); spin_unlock(&dev->slock); } @@ -2233,14 +2238,15 @@ fail_free: static void __devexit cx8800_finidev(struct pci_dev *pci_dev) { struct cx8800_dev *dev = pci_get_drvdata(pci_dev); + struct cx88_core *core = dev->core; /* stop thread */ - if (dev->core->kthread) { - kthread_stop(dev->core->kthread); - dev->core->kthread = NULL; + if (core->kthread) { + kthread_stop(core->kthread); + core->kthread = NULL; } - cx88_shutdown(dev->core); /* FIXME */ + cx88_shutdown(core); /* FIXME */ pci_disable_device(pci_dev); /* unregister stuff */ @@ -2252,7 +2258,7 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev) /* free memory */ btcx_riscmem_free(dev->pci,&dev->vidq.stopper); list_del(&dev->devlist); - cx88_core_put(dev->core,dev->pci); + cx88_core_put(core,dev->pci); kfree(dev); } @@ -2277,7 +2283,7 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) #if 1 /* FIXME -- shutdown device */ - cx88_shutdown(dev->core); + cx88_shutdown(core); #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) @@ -2310,7 +2316,7 @@ static int cx8800_resume(struct pci_dev *pci_dev) #if 1 /* FIXME: re-initialize hardware */ - cx88_reset(dev->core); + cx88_reset(core); #endif /* restart video+vbi capture */ |