1 /*
2  *  Driver for the Conexant CX25821 PCIe bridge
3  *
4  *  Copyright (C) 2009 Conexant Systems Inc.
5  *  Authors  <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
6  *  Based on Steven Toth <stoth@linuxtv.org> cx23885 driver
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *
17  *  GNU General Public License for more details.
18  *
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, write to the Free Software
21  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  */
23 
24 #ifndef CX25821_VIDEO_H_
25 #define CX25821_VIDEO_H_
26 
27 #include <linux/init.h>
28 #include <linux/list.h>
29 #include <linux/module.h>
30 #include <linux/moduleparam.h>
31 #include <linux/kmod.h>
32 #include <linux/kernel.h>
33 #include <linux/slab.h>
34 #include <linux/interrupt.h>
35 #include <linux/delay.h>
36 #include <linux/kthread.h>
37 #include <asm/div64.h>
38 
39 #include "cx25821.h"
40 #include <media/v4l2-common.h>
41 #include <media/v4l2-ioctl.h>
42 #include <media/v4l2-event.h>
43 
44 #define VIDEO_DEBUG 0
45 
46 #define dprintk(level, fmt, arg...)					\
47 do {									\
48 	if (VIDEO_DEBUG >= level)					\
49 		printk(KERN_DEBUG "%s/0: " fmt, dev->name, ##arg);	\
50 } while (0)
51 
52 #define FORMAT_FLAGS_PACKED       0x01
53 extern void cx25821_video_wakeup(struct cx25821_dev *dev,
54 				 struct cx25821_dmaqueue *q, u32 count);
55 
56 extern int cx25821_start_video_dma(struct cx25821_dev *dev,
57 				   struct cx25821_dmaqueue *q,
58 				   struct cx25821_buffer *buf,
59 				   const struct sram_channel *channel);
60 
61 extern int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status);
62 extern void cx25821_video_unregister(struct cx25821_dev *dev, int chan_num);
63 extern int cx25821_video_register(struct cx25821_dev *dev);
64 
65 #endif
66