static void vbi_stop(struct saa7146_fh *fh, struct file *file) { struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; unsigned long flags; DEB_VBI("dev:%p, fh:%p\n", dev, fh); spin_lock_irqsave(&dev->slock,flags); /* disable rps1 */ saa7146_write(dev, MC1, MASK_29); /* disable rps1 irqs */ SAA7146_IER_DISABLE(dev, MASK_28); /* shut down dma 3 transfers */ saa7146_write(dev, MC1, MASK_20); if (vv->vbi_dmaq.curr) saa7146_buffer_finish(dev, &vv->vbi_dmaq, VIDEOBUF_DONE); videobuf_queue_cancel(&fh->vbi_q); vv->vbi_streaming = NULL; del_timer(&vv->vbi_dmaq.timeout); del_timer(&vv->vbi_read_timeout); spin_unlock_irqrestore(&dev->slock, flags); }
static void video_irq_done(struct saa7146_dev *dev, unsigned long st) { struct saa7146_vv *vv = dev->vv_data; struct saa7146_dmaqueue *q = &vv->video_q; spin_lock(&dev->slock); DEB_CAP(("called.\n")); /* only finish the buffer if we have one... */ if( NULL != q->curr ) { saa7146_buffer_finish(dev,q,STATE_DONE); } saa7146_buffer_next(dev,q,0); spin_unlock(&dev->slock); }
static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status) { struct saa7146_vv *vv = dev->vv_data; spin_lock(&dev->slock); if (vv->vbi_dmaq.curr) { DEB_VBI("dev:%p, curr:%p\n", dev, vv->vbi_dmaq.curr); /* this must be += 2, one count for each field */ vv->vbi_fieldcount+=2; vv->vbi_dmaq.curr->vb.field_count = vv->vbi_fieldcount; saa7146_buffer_finish(dev, &vv->vbi_dmaq, VIDEOBUF_DONE); } else { DEB_VBI("dev:%p\n", dev); } saa7146_buffer_next(dev, &vv->vbi_dmaq, 1); spin_unlock(&dev->slock); }