2009-09-15 11:33:54 -03:00
/*
* Driver for the Conexant CX25821 PCIe bridge
*
2009-09-13 11:25:45 -03:00
* Copyright ( C ) 2009 Conexant Systems Inc .
2009-09-15 11:33:54 -03:00
* Authors < shu . lin @ conexant . com > , < hiep . huynh @ conexant . com >
* Based on Steven Toth < stoth @ linuxtv . org > cx23885 driver
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
*
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# ifndef CX25821_VIDEO_H_
# define CX25821_VIDEO_H_
# include <linux/init.h>
# include <linux/list.h>
# include <linux/module.h>
# include <linux/moduleparam.h>
# include <linux/kmod.h>
# include <linux/kernel.h>
# include <linux/slab.h>
# include <linux/interrupt.h>
# include <linux/delay.h>
# include <linux/kthread.h>
# include <asm/div64.h>
# include "cx25821.h"
# include <media/v4l2-common.h>
# include <media/v4l2-ioctl.h>
# define VIDEO_DEBUG 0
2010-11-07 17:48:21 -03:00
# define dprintk(level, fmt, arg...) \
do { \
if ( VIDEO_DEBUG > = level ) \
printk ( KERN_DEBUG " %s/0: " fmt , dev - > name , # # arg ) ; \
} while ( 0 )
2009-09-15 11:33:54 -03:00
2010-07-04 15:21:40 -03:00
/* For IOCTL to identify running upstream */
2009-09-15 11:33:54 -03:00
# define UPSTREAM_START_VIDEO 700
# define UPSTREAM_STOP_VIDEO 701
# define UPSTREAM_START_AUDIO 702
# define UPSTREAM_STOP_AUDIO 703
# define UPSTREAM_DUMP_REGISTERS 702
# define SET_VIDEO_STD 800
# define SET_PIXEL_FORMAT 1000
# define ENABLE_CIF_RESOLUTION 1001
# define REG_READ 900
# define REG_WRITE 901
# define MEDUSA_READ 910
2011-09-16 14:15:15 +08:00
# define MEDUSA_WRITE 911
2009-09-15 11:33:54 -03:00
2009-09-13 11:30:11 -03:00
extern unsigned int vid_limit ;
2009-09-15 11:33:54 -03:00
# define FORMAT_FLAGS_PACKED 0x01
extern struct cx25821_fmt formats [ ] ;
[media] Don't export format_by_forcc on two different drivers
Drivers should append their name on exported symbols, to avoid
conflicts with allyesconfig:
drivers/staging/built-in.o: In function `format_by_fourcc':
/home/v4l/work_trees/linus/drivers/staging/cx25821/cx25821-video.c:96: multiple definition of `format_by_fourcc'
drivers/media/built-in.o:/home/v4l/work_trees/linus/drivers/media/common/saa7146_video.c:88: first defined here
Let's rename both occurences with a small shellscript:
for i in drivers/staging/cx25821/*.[ch]; do sed s,format_by_fourcc,cx25821_format_by_fourcc,g <$i >a && mv a $i; done
for i in drivers/media/common/saa7146*.[ch]; do sed s,format_by_fourcc,saa7146_format_by_fourcc,g <$i >a && mv a $i; done
for i in include/media/saa7146*.[ch]; do sed s,format_by_fourcc,saa7146_format_by_fourcc,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-02 01:57:03 -02:00
extern struct cx25821_fmt * cx25821_format_by_fourcc ( unsigned int fourcc ) ;
2009-09-15 11:33:54 -03:00
extern struct cx25821_data timeout_data [ MAX_VID_CHANNEL_NUM ] ;
2009-09-13 11:30:11 -03:00
extern void cx25821_video_wakeup ( struct cx25821_dev * dev ,
struct cx25821_dmaqueue * q , u32 count ) ;
2009-09-15 11:33:54 -03:00
extern int cx25821_set_tvnorm ( struct cx25821_dev * dev , v4l2_std_id norm ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_res_get ( struct cx25821_dev * dev , struct cx25821_fh * fh ,
2011-09-16 14:15:16 +08:00
unsigned int bit ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_res_check ( struct cx25821_fh * fh , unsigned int bit ) ;
2010-07-04 14:15:38 -03:00
extern int cx25821_res_locked ( struct cx25821_fh * fh , unsigned int bit ) ;
2010-03-24 16:33:40 -03:00
extern void cx25821_res_free ( struct cx25821_dev * dev , struct cx25821_fh * fh ,
2011-09-16 14:15:16 +08:00
unsigned int bits ) ;
2009-09-15 11:33:54 -03:00
extern int cx25821_video_mux ( struct cx25821_dev * dev , unsigned int input ) ;
extern int cx25821_start_video_dma ( struct cx25821_dev * dev ,
2009-09-13 11:30:11 -03:00
struct cx25821_dmaqueue * q ,
struct cx25821_buffer * buf ,
2013-04-13 06:28:54 -03:00
const struct sram_channel * channel ) ;
2009-09-15 11:33:54 -03:00
2009-09-13 11:30:11 -03:00
extern int cx25821_set_scale ( struct cx25821_dev * dev , unsigned int width ,
unsigned int height , enum v4l2_field field ) ;
2009-09-15 11:33:54 -03:00
extern int cx25821_video_irq ( struct cx25821_dev * dev , int chan_num , u32 status ) ;
extern void cx25821_video_unregister ( struct cx25821_dev * dev , int chan_num ) ;
2010-07-04 14:15:38 -03:00
extern int cx25821_video_register ( struct cx25821_dev * dev ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_get_format_size ( void ) ;
2009-09-15 11:33:54 -03:00
2010-03-24 16:33:40 -03:00
extern int cx25821_buffer_setup ( struct videobuf_queue * q , unsigned int * count ,
2011-09-16 14:15:17 +08:00
unsigned int * size ) ;
extern int cx25821_buffer_prepare ( struct videobuf_queue * q ,
struct videobuf_buffer * vb ,
enum v4l2_field field ) ;
2010-03-24 16:33:40 -03:00
extern void cx25821_buffer_release ( struct videobuf_queue * q ,
2011-09-16 14:15:16 +08:00
struct videobuf_buffer * vb ) ;
2009-09-15 11:33:54 -03:00
extern struct videobuf_queue * get_queue ( struct cx25821_fh * fh ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_get_resource ( struct cx25821_fh * fh , int resource ) ;
extern int cx25821_video_mmap ( struct file * file , struct vm_area_struct * vma ) ;
extern int cx25821_vidioc_try_fmt_vid_cap ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_format * f ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_querycap ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_capability * cap ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_enum_fmt_vid_cap ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_fmtdesc * f ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_reqbufs ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_requestbuffers * p ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_querybuf ( struct file * file , void * priv ,
2011-09-16 14:15:17 +08:00
struct v4l2_buffer * p ) ;
extern int cx25821_vidioc_qbuf ( struct file * file , void * priv ,
struct v4l2_buffer * p ) ;
extern int cx25821_vidioc_s_std ( struct file * file , void * priv ,
2013-03-15 06:10:40 -03:00
v4l2_std_id tvnorms ) ;
2009-09-15 11:33:54 -03:00
extern int cx25821_enum_input ( struct cx25821_dev * dev , struct v4l2_input * i ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_enum_input ( struct file * file , void * priv ,
2011-09-16 14:15:17 +08:00
struct v4l2_input * i ) ;
extern int cx25821_vidioc_g_input ( struct file * file , void * priv ,
unsigned int * i ) ;
extern int cx25821_vidioc_s_input ( struct file * file , void * priv ,
unsigned int i ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_g_ctrl ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_control * ctl ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_g_fmt_vid_cap ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_format * f ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_g_register ( struct file * file , void * fh ,
2011-09-16 14:15:16 +08:00
struct v4l2_dbg_register * reg ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_s_register ( struct file * file , void * fh ,
2013-03-24 08:28:46 -03:00
const struct v4l2_dbg_register * reg ) ;
2009-09-15 11:33:54 -03:00
2010-03-24 16:33:40 -03:00
extern int cx25821_is_valid_width ( u32 width , v4l2_std_id tvnorm ) ;
extern int cx25821_is_valid_height ( u32 height , v4l2_std_id tvnorm ) ;
2009-09-15 11:33:54 -03:00
2011-09-16 14:15:17 +08:00
extern int cx25821_vidioc_g_priority ( struct file * file , void * f ,
enum v4l2_priority * p ) ;
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_s_priority ( struct file * file , void * f ,
2011-09-16 14:15:16 +08:00
enum v4l2_priority prio ) ;
2009-09-15 11:33:54 -03:00
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_queryctrl ( struct file * file , void * priv ,
2011-09-16 14:15:16 +08:00
struct v4l2_queryctrl * qctrl ) ;
2009-09-13 11:30:11 -03:00
extern int cx25821_set_control ( struct cx25821_dev * dev ,
struct v4l2_control * ctrl , int chan_num ) ;
2009-09-15 11:33:54 -03:00
2010-03-24 16:33:40 -03:00
extern int cx25821_vidioc_cropcap ( struct file * file , void * fh ,
2011-09-16 14:15:17 +08:00
struct v4l2_cropcap * cropcap ) ;
extern int cx25821_vidioc_s_crop ( struct file * file , void * priv ,
2012-09-05 05:10:48 -03:00
const struct v4l2_crop * crop ) ;
2011-09-16 14:15:17 +08:00
extern int cx25821_vidioc_g_crop ( struct file * file , void * priv ,
struct v4l2_crop * crop ) ;
extern int cx25821_vidioc_querystd ( struct file * file , void * priv ,
v4l2_std_id * norm ) ;
2009-09-15 11:33:54 -03:00
# endif