Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
cx25821-video.c File Reference
#include "cx25821-video.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define FORMAT_FLAGS_PACKED   0x01
 

Functions

 MODULE_DESCRIPTION ("v4l2 driver module for cx25821 based TV cards")
 
 MODULE_AUTHOR ("Hiep Huynh <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 module_param_array (video_nr, int, NULL, 0444)
 
 module_param_array (radio_nr, int, NULL, 0444)
 
 MODULE_PARM_DESC (video_nr,"video device numbers")
 
 MODULE_PARM_DESC (radio_nr,"radio device numbers")
 
 module_param (video_debug, int, 0644)
 
 MODULE_PARM_DESC (video_debug,"enable debug messages [video]")
 
 module_param (irq_debug, int, 0644)
 
 MODULE_PARM_DESC (irq_debug,"enable debug messages [IRQ handler]")
 
 module_param (vid_limit, int, 0644)
 
 MODULE_PARM_DESC (vid_limit,"capture memory limit in megabytes")
 
int cx25821_get_format_size (void)
 
struct cx25821_fmtcx25821_format_by_fourcc (unsigned int fourcc)
 
void cx25821_video_wakeup (struct cx25821_dev *dev, struct cx25821_dmaqueue *q, u32 count)
 
int cx25821_set_tvnorm (struct cx25821_dev *dev, v4l2_std_id norm)
 
struct video_devicecx25821_vdev_init (struct cx25821_dev *dev, struct pci_dev *pci, struct video_device *template, char *type)
 
int cx25821_res_get (struct cx25821_dev *dev, struct cx25821_fh *fh, unsigned int bit)
 
int cx25821_res_check (struct cx25821_fh *fh, unsigned int bit)
 
int cx25821_res_locked (struct cx25821_fh *fh, unsigned int bit)
 
void cx25821_res_free (struct cx25821_dev *dev, struct cx25821_fh *fh, unsigned int bits)
 
int cx25821_video_mux (struct cx25821_dev *dev, unsigned int input)
 
int cx25821_start_video_dma (struct cx25821_dev *dev, struct cx25821_dmaqueue *q, struct cx25821_buffer *buf, struct sram_channel *channel)
 
int cx25821_restart_video_queue (struct cx25821_dev *dev, struct cx25821_dmaqueue *q, struct sram_channel *channel)
 
void cx25821_vid_timeout (unsigned long data)
 
int cx25821_video_irq (struct cx25821_dev *dev, int chan_num, u32 status)
 
void cx25821_videoioctl_unregister (struct cx25821_dev *dev)
 
void cx25821_video_unregister (struct cx25821_dev *dev, int chan_num)
 
int cx25821_video_register (struct cx25821_dev *dev)
 
int cx25821_buffer_setup (struct videobuf_queue *q, unsigned int *count, unsigned int *size)
 
int cx25821_buffer_prepare (struct videobuf_queue *q, struct videobuf_buffer *vb, enum v4l2_field field)
 
void cx25821_buffer_release (struct videobuf_queue *q, struct videobuf_buffer *vb)
 
struct videobuf_queueget_queue (struct cx25821_fh *fh)
 
int cx25821_get_resource (struct cx25821_fh *fh, int resource)
 
int cx25821_video_mmap (struct file *file, struct vm_area_struct *vma)
 
int cx25821_vidioc_g_fmt_vid_cap (struct file *file, void *priv, struct v4l2_format *f)
 
int cx25821_vidioc_try_fmt_vid_cap (struct file *file, void *priv, struct v4l2_format *f)
 
int cx25821_vidioc_querycap (struct file *file, void *priv, struct v4l2_capability *cap)
 
int cx25821_vidioc_enum_fmt_vid_cap (struct file *file, void *priv, struct v4l2_fmtdesc *f)
 
int cx25821_vidioc_reqbufs (struct file *file, void *priv, struct v4l2_requestbuffers *p)
 
int cx25821_vidioc_querybuf (struct file *file, void *priv, struct v4l2_buffer *p)
 
int cx25821_vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *p)
 
int cx25821_vidioc_g_priority (struct file *file, void *f, enum v4l2_priority *p)
 
int cx25821_vidioc_s_priority (struct file *file, void *f, enum v4l2_priority prio)
 
int cx25821_vidioc_s_std (struct file *file, void *priv, v4l2_std_id *tvnorms)
 
int cx25821_enum_input (struct cx25821_dev *dev, struct v4l2_input *i)
 
int cx25821_vidioc_enum_input (struct file *file, void *priv, struct v4l2_input *i)
 
int cx25821_vidioc_g_input (struct file *file, void *priv, unsigned int *i)
 
int cx25821_vidioc_s_input (struct file *file, void *priv, unsigned int i)
 
int cx25821_vidioc_g_frequency (struct file *file, void *priv, struct v4l2_frequency *f)
 
int cx25821_set_freq (struct cx25821_dev *dev, struct v4l2_frequency *f)
 
int cx25821_vidioc_s_frequency (struct file *file, void *priv, struct v4l2_frequency *f)
 
int cx25821_vidioc_g_tuner (struct file *file, void *priv, struct v4l2_tuner *t)
 
int cx25821_vidioc_s_tuner (struct file *file, void *priv, struct v4l2_tuner *t)
 
int cx25821_vidioc_queryctrl (struct file *file, void *priv, struct v4l2_queryctrl *qctrl)
 
int cx25821_vidioc_g_ctrl (struct file *file, void *priv, struct v4l2_control *ctl)
 
int cx25821_set_control (struct cx25821_dev *dev, struct v4l2_control *ctl, int chan_num)
 
int cx25821_vidioc_cropcap (struct file *file, void *priv, struct v4l2_cropcap *cropcap)
 
int cx25821_vidioc_s_crop (struct file *file, void *priv, const struct v4l2_crop *crop)
 
int cx25821_vidioc_g_crop (struct file *file, void *priv, struct v4l2_crop *crop)
 
int cx25821_vidioc_querystd (struct file *file, void *priv, v4l2_std_id *norm)
 
int cx25821_is_valid_width (u32 width, v4l2_std_id tvnorm)
 
int cx25821_is_valid_height (u32 height, v4l2_std_id tvnorm)
 

Variables

unsigned int vid_limit = 16
 
struct cx25821_fmt formats []
 
struct video_device cx25821_videoioctl_template
 

Macro Definition Documentation

#define FORMAT_FLAGS_PACKED   0x01

Definition at line 61 of file cx25821-video.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 27 of file cx25821-video.c.

Function Documentation

int cx25821_buffer_prepare ( struct videobuf_queue q,
struct videobuf_buffer vb,
enum v4l2_field  field 
)

Definition at line 533 of file cx25821-video.c.

void cx25821_buffer_release ( struct videobuf_queue q,
struct videobuf_buffer vb 
)

Definition at line 660 of file cx25821-video.c.

int cx25821_buffer_setup ( struct videobuf_queue q,
unsigned int count,
unsigned int size 
)

Definition at line 517 of file cx25821-video.c.

int cx25821_enum_input ( struct cx25821_dev dev,
struct v4l2_input i 
)

Definition at line 1234 of file cx25821-video.c.

struct cx25821_fmt* cx25821_format_by_fourcc ( unsigned int  fourcc)
read

Definition at line 97 of file cx25821-video.c.

int cx25821_get_format_size ( void  )

Definition at line 92 of file cx25821-video.c.

int cx25821_get_resource ( struct cx25821_fh fh,
int  resource 
)

Definition at line 680 of file cx25821-video.c.

int cx25821_is_valid_height ( u32  height,
v4l2_std_id  tvnorm 
)

Definition at line 1661 of file cx25821-video.c.

int cx25821_is_valid_width ( u32  width,
v4l2_std_id  tvnorm 
)

Definition at line 1643 of file cx25821-video.c.

int cx25821_res_check ( struct cx25821_fh fh,
unsigned int  bit 
)

Definition at line 225 of file cx25821-video.c.

void cx25821_res_free ( struct cx25821_dev dev,
struct cx25821_fh fh,
unsigned int  bits 
)

Definition at line 235 of file cx25821-video.c.

int cx25821_res_get ( struct cx25821_dev dev,
struct cx25821_fh fh,
unsigned int  bit 
)

Definition at line 202 of file cx25821-video.c.

int cx25821_res_locked ( struct cx25821_fh fh,
unsigned int  bit 
)

Definition at line 230 of file cx25821-video.c.

int cx25821_restart_video_queue ( struct cx25821_dev dev,
struct cx25821_dmaqueue q,
struct sram_channel channel 
)

Definition at line 294 of file cx25821-video.c.

int cx25821_set_control ( struct cx25821_dev dev,
struct v4l2_control ctl,
int  chan_num 
)

Definition at line 1532 of file cx25821-video.c.

int cx25821_set_freq ( struct cx25821_dev dev,
struct v4l2_frequency f 
)

Definition at line 1315 of file cx25821-video.c.

int cx25821_set_tvnorm ( struct cx25821_dev dev,
v4l2_std_id  norm 
)

Definition at line 148 of file cx25821-video.c.

int cx25821_start_video_dma ( struct cx25821_dev dev,
struct cx25821_dmaqueue q,
struct cx25821_buffer buf,
struct sram_channel channel 
)

Definition at line 266 of file cx25821-video.c.

struct video_device* cx25821_vdev_init ( struct cx25821_dev dev,
struct pci_dev pci,
struct video_device template,
char type 
)
read

Definition at line 162 of file cx25821-video.c.

void cx25821_vid_timeout ( unsigned long  data)

Definition at line 345 of file cx25821-video.c.

int cx25821_video_irq ( struct cx25821_dev dev,
int  chan_num,
u32  status 
)

Definition at line 371 of file cx25821-video.c.

int cx25821_video_mmap ( struct file file,
struct vm_area_struct vma 
)

Definition at line 691 of file cx25821-video.c.

int cx25821_video_mux ( struct cx25821_dev dev,
unsigned int  input 
)

Definition at line 248 of file cx25821-video.c.

int cx25821_video_register ( struct cx25821_dev dev)

Definition at line 448 of file cx25821-video.c.

void cx25821_video_unregister ( struct cx25821_dev dev,
int  chan_num 
)

Definition at line 426 of file cx25821-video.c.

void cx25821_video_wakeup ( struct cx25821_dev dev,
struct cx25821_dmaqueue q,
u32  count 
)

Definition at line 112 of file cx25821-video.c.

void cx25821_videoioctl_unregister ( struct cx25821_dev dev)

Definition at line 414 of file cx25821-video.c.

int cx25821_vidioc_cropcap ( struct file file,
void priv,
struct v4l2_cropcap cropcap 
)

Definition at line 1594 of file cx25821-video.c.

int cx25821_vidioc_enum_fmt_vid_cap ( struct file file,
void priv,
struct v4l2_fmtdesc f 
)

Definition at line 1153 of file cx25821-video.c.

int cx25821_vidioc_enum_input ( struct file file,
void priv,
struct v4l2_input i 
)

Definition at line 1258 of file cx25821-video.c.

int cx25821_vidioc_g_crop ( struct file file,
void priv,
struct v4l2_crop crop 
)

Definition at line 1629 of file cx25821-video.c.

int cx25821_vidioc_g_ctrl ( struct file file,
void priv,
struct v4l2_control ctl 
)

Definition at line 1503 of file cx25821-video.c.

int cx25821_vidioc_g_fmt_vid_cap ( struct file file,
void priv,
struct v4l2_format f 
)

Definition at line 1073 of file cx25821-video.c.

int cx25821_vidioc_g_frequency ( struct file file,
void priv,
struct v4l2_frequency f 
)

Definition at line 1302 of file cx25821-video.c.

int cx25821_vidioc_g_input ( struct file file,
void priv,
unsigned int i 
)

Definition at line 1266 of file cx25821-video.c.

int cx25821_vidioc_g_priority ( struct file file,
void f,
enum v4l2_priority p 
)

Definition at line 1185 of file cx25821-video.c.

int cx25821_vidioc_g_tuner ( struct file file,
void priv,
struct v4l2_tuner t 
)

Definition at line 1382 of file cx25821-video.c.

int cx25821_vidioc_qbuf ( struct file file,
void priv,
struct v4l2_buffer p 
)

Definition at line 1179 of file cx25821-video.c.

int cx25821_vidioc_querybuf ( struct file file,
void priv,
struct v4l2_buffer p 
)

Definition at line 1172 of file cx25821-video.c.

int cx25821_vidioc_querycap ( struct file file,
void priv,
struct v4l2_capability cap 
)

Definition at line 1137 of file cx25821-video.c.

int cx25821_vidioc_queryctrl ( struct file file,
void priv,
struct v4l2_queryctrl qctrl 
)

Definition at line 1484 of file cx25821-video.c.

int cx25821_vidioc_querystd ( struct file file,
void priv,
v4l2_std_id norm 
)

Definition at line 1635 of file cx25821-video.c.

int cx25821_vidioc_reqbufs ( struct file file,
void priv,
struct v4l2_requestbuffers p 
)

Definition at line 1165 of file cx25821-video.c.

int cx25821_vidioc_s_crop ( struct file file,
void priv,
const struct v4l2_crop crop 
)

Definition at line 1613 of file cx25821-video.c.

int cx25821_vidioc_s_frequency ( struct file file,
void priv,
struct v4l2_frequency f 
)

Definition at line 1330 of file cx25821-video.c.

int cx25821_vidioc_s_input ( struct file file,
void priv,
unsigned int  i 
)

Definition at line 1275 of file cx25821-video.c.

int cx25821_vidioc_s_priority ( struct file file,
void f,
enum v4l2_priority  prio 
)

Definition at line 1195 of file cx25821-video.c.

int cx25821_vidioc_s_std ( struct file file,
void priv,
v4l2_std_id tvnorms 
)

Definition at line 1206 of file cx25821-video.c.

int cx25821_vidioc_s_tuner ( struct file file,
void priv,
struct v4l2_tuner t 
)

Definition at line 1400 of file cx25821-video.c.

int cx25821_vidioc_try_fmt_vid_cap ( struct file file,
void priv,
struct v4l2_format f 
)

Definition at line 1088 of file cx25821-video.c.

struct videobuf_queue* get_queue ( struct cx25821_fh fh)
read

Definition at line 669 of file cx25821-video.c.

MODULE_AUTHOR ( "Hiep Huynh <[email protected]>"  )
MODULE_DESCRIPTION ( "v4l2 driver module for cx25821 based TV cards )
MODULE_LICENSE ( "GPL"  )
module_param ( video_debug  ,
int  ,
0644   
)
module_param ( irq_debug  ,
int  ,
0644   
)
module_param ( vid_limit  ,
int  ,
0644   
)
module_param_array ( video_nr  ,
int  ,
NULL  ,
0444   
)
module_param_array ( radio_nr  ,
int  ,
NULL  ,
0444   
)
MODULE_PARM_DESC ( video_nr  ,
"video device numbers"   
)
MODULE_PARM_DESC ( radio_nr  ,
"radio device numbers"   
)
MODULE_PARM_DESC ( video_debug  ,
"enable debug messages "  [video] 
)
MODULE_PARM_DESC ( irq_debug  ,
"enable debug messages "  [IRQ handler] 
)
MODULE_PARM_DESC ( vid_limit  ,
"capture memory limit in megabytes"   
)

Variable Documentation

struct video_device cx25821_videoioctl_template
Initial value:
= {
.name = "cx25821-videoioctl",
.fops = &video_fops,
.ioctl_ops = &video_ioctl_ops,
.tvnorms = CX25821_NORMS,
.current_norm = V4L2_STD_NTSC_M,
}

Definition at line 1984 of file cx25821-video.c.

struct cx25821_fmt formats[]
Initial value:
= {
{
.name = "8 bpp, gray",
.fourcc = V4L2_PIX_FMT_GREY,
.depth = 8,
}, {
.name = "4:1:1, packed, Y41P",
.fourcc = V4L2_PIX_FMT_Y41P,
.depth = 12,
}, {
.name = "4:2:2, packed, YUYV",
.fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16,
}, {
.name = "4:2:2, packed, UYVY",
.fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16,
}, {
.name = "4:2:0, YUV",
.depth = 12,
},
}

Definition at line 63 of file cx25821-video.c.

unsigned int vid_limit = 16

Definition at line 52 of file cx25821-video.c.