Lines Matching refs:dev
31 static int buffer_activate(struct saa7134_dev *dev, in buffer_activate() argument
39 if (!dev->ts_started) in buffer_activate()
40 dev->ts_field = V4L2_FIELD_TOP; in buffer_activate()
44 if (V4L2_FIELD_TOP == dev->ts_field) { in buffer_activate()
48 dev->ts_field = V4L2_FIELD_BOTTOM; in buffer_activate()
53 dev->ts_field = V4L2_FIELD_TOP; in buffer_activate()
57 saa7134_set_dmabits(dev); in buffer_activate()
59 mod_timer(&dev->ts_q.timeout, jiffies+TS_BUFFER_TIMEOUT); in buffer_activate()
61 if (!dev->ts_started) in buffer_activate()
62 saa7134_ts_start(dev); in buffer_activate()
84 struct saa7134_dev *dev = dmaq->dev; in saa7134_ts_buffer_prepare() local
92 lines = dev->ts.nr_packets; in saa7134_ts_buffer_prepare()
99 vbuf->field = dev->field; in saa7134_ts_buffer_prepare()
101 return saa7134_pgtable_build(dev->pci, &dmaq->pt, dma->sgl, dma->nents, in saa7134_ts_buffer_prepare()
111 struct saa7134_dev *dev = dmaq->dev; in saa7134_ts_queue_setup() local
112 int size = TS_PACKET_SIZE * dev->ts.nr_packets; in saa7134_ts_queue_setup()
115 *nbuffers = dev->ts.nr_bufs; in saa7134_ts_queue_setup()
128 struct saa7134_dev *dev = dmaq->dev; in saa7134_ts_start_streaming() local
134 if (vb2_is_busy(&dev->video_vbq) && dev->fmt->planar) { in saa7134_ts_start_streaming()
157 struct saa7134_dev *dev = dmaq->dev; in saa7134_ts_stop_streaming() local
159 saa7134_ts_stop(dev); in saa7134_ts_stop_streaming()
160 saa7134_stop_streaming(dev, dmaq); in saa7134_ts_stop_streaming()
186 int saa7134_ts_init_hw(struct saa7134_dev *dev) in saa7134_ts_init_hw() argument
193 saa_writeb(SAA7134_TS_DMA0, ((dev->ts.nr_packets-1)&0xff)); in saa7134_ts_init_hw()
194 saa_writeb(SAA7134_TS_DMA1, (((dev->ts.nr_packets-1)>>8)&0xff)); in saa7134_ts_init_hw()
197 ((((dev->ts.nr_packets-1)>>16)&0x3f) | 0x00)); in saa7134_ts_init_hw()
202 int saa7134_ts_init1(struct saa7134_dev *dev) in saa7134_ts_init1() argument
213 dev->ts.nr_bufs = tsbufs; in saa7134_ts_init1()
214 dev->ts.nr_packets = ts_nr_packets; in saa7134_ts_init1()
216 INIT_LIST_HEAD(&dev->ts_q.queue); in saa7134_ts_init1()
217 timer_setup(&dev->ts_q.timeout, saa7134_buffer_timeout, 0); in saa7134_ts_init1()
218 dev->ts_q.dev = dev; in saa7134_ts_init1()
219 dev->ts_q.need_two = 1; in saa7134_ts_init1()
220 dev->ts_started = 0; in saa7134_ts_init1()
221 saa7134_pgtable_alloc(dev->pci, &dev->ts_q.pt); in saa7134_ts_init1()
224 saa7134_ts_init_hw(dev); in saa7134_ts_init1()
230 int saa7134_ts_stop(struct saa7134_dev *dev) in saa7134_ts_stop() argument
234 if (!dev->ts_started) in saa7134_ts_stop()
238 switch (saa7134_boards[dev->board].ts_type) { in saa7134_ts_stop()
241 dev->ts_started = 0; in saa7134_ts_stop()
245 dev->ts_started = 0; in saa7134_ts_stop()
252 int saa7134_ts_start(struct saa7134_dev *dev) in saa7134_ts_start() argument
256 if (WARN_ON(dev->ts_started)) in saa7134_ts_start()
260 saa_writeb(SAA7134_TS_DMA0, (dev->ts.nr_packets - 1) & 0xff); in saa7134_ts_start()
262 ((dev->ts.nr_packets - 1) >> 8) & 0xff); in saa7134_ts_start()
265 (((dev->ts.nr_packets - 1) >> 16) & 0x3f) | 0x00); in saa7134_ts_start()
269 (dev->ts_q.pt.dma >> 12)); in saa7134_ts_start()
281 switch (saa7134_boards[dev->board].ts_type) { in saa7134_ts_start()
285 (saa7134_boards[dev->board].ts_force_val << 4)); in saa7134_ts_start()
290 (saa7134_boards[dev->board].ts_force_val << 4)); in saa7134_ts_start()
296 dev->ts_started = 1; in saa7134_ts_start()
301 int saa7134_ts_fini(struct saa7134_dev *dev) in saa7134_ts_fini() argument
303 del_timer_sync(&dev->ts_q.timeout); in saa7134_ts_fini()
304 saa7134_pgtable_free(dev->pci, &dev->ts_q.pt); in saa7134_ts_fini()
308 void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status) in saa7134_irq_ts_done() argument
312 spin_lock(&dev->slock); in saa7134_irq_ts_done()
313 if (dev->ts_q.curr) { in saa7134_irq_ts_done()
314 field = dev->ts_field; in saa7134_irq_ts_done()
322 saa7134_buffer_finish(dev, &dev->ts_q, VB2_BUF_STATE_DONE); in saa7134_irq_ts_done()
324 saa7134_buffer_next(dev,&dev->ts_q); in saa7134_irq_ts_done()
327 spin_unlock(&dev->slock); in saa7134_irq_ts_done()