xref: /OK3568_Linux_fs/kernel/drivers/media/pci/cx25821/cx25821-video.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *  Driver for the Conexant CX25821 PCIe bridge
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  *  Copyright (C) 2009 Conexant Systems Inc.
6*4882a593Smuzhiyun  *  Authors  <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
7*4882a593Smuzhiyun  *  Based on Steven Toth <stoth@linuxtv.org> cx23885 driver
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef CX25821_VIDEO_H_
11*4882a593Smuzhiyun #define CX25821_VIDEO_H_
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <linux/init.h>
14*4882a593Smuzhiyun #include <linux/list.h>
15*4882a593Smuzhiyun #include <linux/module.h>
16*4882a593Smuzhiyun #include <linux/moduleparam.h>
17*4882a593Smuzhiyun #include <linux/kmod.h>
18*4882a593Smuzhiyun #include <linux/kernel.h>
19*4882a593Smuzhiyun #include <linux/slab.h>
20*4882a593Smuzhiyun #include <linux/interrupt.h>
21*4882a593Smuzhiyun #include <linux/delay.h>
22*4882a593Smuzhiyun #include <linux/kthread.h>
23*4882a593Smuzhiyun #include <asm/div64.h>
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #include "cx25821.h"
26*4882a593Smuzhiyun #include <media/v4l2-common.h>
27*4882a593Smuzhiyun #include <media/v4l2-ioctl.h>
28*4882a593Smuzhiyun #include <media/v4l2-event.h>
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun #define VIDEO_DEBUG 0
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #define dprintk(level, fmt, arg...)					\
33*4882a593Smuzhiyun do {									\
34*4882a593Smuzhiyun 	if (VIDEO_DEBUG >= level)					\
35*4882a593Smuzhiyun 		printk(KERN_DEBUG "%s/0: " fmt, dev->name, ##arg);	\
36*4882a593Smuzhiyun } while (0)
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #define FORMAT_FLAGS_PACKED       0x01
39*4882a593Smuzhiyun extern void cx25821_video_wakeup(struct cx25821_dev *dev,
40*4882a593Smuzhiyun 				 struct cx25821_dmaqueue *q, u32 count);
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun extern int cx25821_start_video_dma(struct cx25821_dev *dev,
43*4882a593Smuzhiyun 				   struct cx25821_dmaqueue *q,
44*4882a593Smuzhiyun 				   struct cx25821_buffer *buf,
45*4882a593Smuzhiyun 				   const struct sram_channel *channel);
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun extern int cx25821_video_irq(struct cx25821_dev *dev, int chan_num, u32 status);
48*4882a593Smuzhiyun extern void cx25821_video_unregister(struct cx25821_dev *dev, int chan_num);
49*4882a593Smuzhiyun extern int cx25821_video_register(struct cx25821_dev *dev);
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun #endif
52