Mxc Video For Linux 2 driver. More...
Data Structures | |
struct | video_fmt_t |
Defines | |
#define | MXC_V4L2_CAPTURE_NUM_OUTPUTS 6 |
#define | TV_STD_MAX (TV_NOT_LOCKED + 1) |
Enumerations | |
enum | video_fmt_idx { ADV7180_NTSC = 0, ADV7180_PAL, ADV7180_NOT_LOCKED, TV_NTSC = 0, TV_PAL, TV_NOT_LOCKED } |
Functions | |
static int | mxc_v4l2_master_attach (struct v4l2_int_device *slave) |
static void | mxc_v4l2_master_detach (struct v4l2_int_device *slave) |
static int | start_preview (cam_data *cam) |
static int | stop_preview (cam_data *cam) |
static int | mxc_free_frame_buf (cam_data *cam) |
static int | mxc_allocate_frame_buf (cam_data *cam, int count) |
static void | mxc_free_frames (cam_data *cam) |
static int | mxc_v4l2_buffer_status (cam_data *cam, struct v4l2_buffer *buf) |
static int | valid_mode (u32 palette) |
static int | mxc_streamon (cam_data *cam) |
static int | mxc_streamoff (cam_data *cam) |
static int | verify_preview (cam_data *cam, struct v4l2_window *win) |
static int | mxc_v4l2_g_fmt (cam_data *cam, struct v4l2_format *f) |
static int | mxc_v4l2_s_fmt (cam_data *cam, struct v4l2_format *f) |
static int | mxc_v4l2_g_ctrl (cam_data *cam, struct v4l2_control *c) |
static int | mxc_v4l2_s_ctrl (cam_data *cam, struct v4l2_control *c) |
static int | mxc_v4l2_s_param (cam_data *cam, struct v4l2_streamparm *parm) |
static int | mxc_v4l2_s_std (cam_data *cam, v4l2_std_id e) |
static int | mxc_v4l2_g_std (cam_data *cam, v4l2_std_id *e) |
static int | mxc_v4l_dqueue (cam_data *cam, struct v4l2_buffer *buf) |
static int | mxc_v4l_open (struct file *file) |
static int | mxc_v4l_close (struct file *file) |
static long | mxc_v4l_do_ioctl (struct file *file, unsigned int ioctlnr, void *arg) |
static int | mxc_mmap (struct file *file, struct vm_area_struct *vma) |
static unsigned int | mxc_poll (struct file *file, struct poll_table_struct *wait) |
static void | camera_platform_release (struct device *device) |
static void | camera_callback (u32 mask, void *dev) |
static void | init_camera_struct (cam_data *cam, struct platform_device *pdev) |
static int | mxc_v4l2_probe (struct platform_device *pdev) |
static int | mxc_v4l2_remove (struct platform_device *pdev) |
static int | mxc_v4l2_suspend (struct platform_device *pdev, pm_message_t state) |
static int | mxc_v4l2_resume (struct platform_device *pdev) |
static __init int | camera_init (void) |
static void __exit | camera_exit (void) |
Variables | |
static video_fmt_t | video_fmts [] |
static video_fmt_idx | video_index = TV_NOT_LOCKED |
static struct v4l2_int_master | mxc_v4l2_master |
static struct v4l2_file_operations | mxc_v4l_fops |
static struct platform_driver | mxc_v4l2_driver |
Mxc Video For Linux 2 driver.
#define MXC_V4L2_CAPTURE_NUM_OUTPUTS 6 |
This data is used for the output to the display.
Referenced by mxc_v4l_do_ioctl().
#define TV_STD_MAX (TV_NOT_LOCKED + 1) |
Number of video standards supported (including 'not locked' signal).
enum video_fmt_idx |
List of TV input video formats supported. The video formats is corresponding to the v4l2_id in video_fmt_t. Currently, only PAL and NTSC is supported. Needs to be expanded in the future.
static void camera_callback | ( | u32 | mask, | |
void * | dev | |||
) | [static] |
Camera V4l2 callback function.
mask | u32 | |
dev | void device structure |
Referenced by init_camera_struct().
static void __exit camera_exit | ( | void | ) | [static] |
Exit and cleanup for the V4L2
static __init int camera_init | ( | void | ) | [static] |
Entry point for the V4L2
static void camera_platform_release | ( | struct device * | device | ) | [static] |
This function can be used to release any platform data on closing.
Referenced by mxc_v4l2_probe().
static void init_camera_struct | ( | cam_data * | cam, | |
struct platform_device * | pdev | |||
) | [static] |
initialize cam_data structure
cam | structure cam_data * |
References camera_callback(), ipu_csi_set_window_pos(), ipu_csi_set_window_size(), and mxc_v4l2_master.
Referenced by mxc_v4l2_probe().
static int mxc_allocate_frame_buf | ( | cam_data * | cam, | |
int | count | |||
) | [static] |
Allocate frame buffers
cam | Structure cam_data* | |
count | int number of buffer need to allocated |
References mxc_free_frame_buf().
Referenced by mxc_v4l_do_ioctl().
static int mxc_free_frame_buf | ( | cam_data * | cam | ) | [static] |
Free frame buffers
cam | Structure cam_data * |
Referenced by mxc_allocate_frame_buf(), mxc_v4l2_remove(), mxc_v4l_close(), and mxc_v4l_do_ioctl().
static void mxc_free_frames | ( | cam_data * | cam | ) | [static] |
Free frame buffers status
cam | Structure cam_data * |
Referenced by mxc_streamoff(), and mxc_v4l_close().
static int mxc_mmap | ( | struct file * | file, | |
struct vm_area_struct * | vma | |||
) | [static] |
V4L interface - mmap function
file | structure file * | |
vma | structure vm_area_struct * |
static unsigned int mxc_poll | ( | struct file * | file, | |
struct poll_table_struct * | wait | |||
) | [static] |
V4L interface - poll function
file | structure file * | |
wait | structure poll_table_struct * |
static int mxc_streamoff | ( | cam_data * | cam | ) | [static] |
Shut down the encoder job
cam | structure cam_data * |
References mxc_free_frames().
Referenced by mxc_v4l_close(), and mxc_v4l_do_ioctl().
static int mxc_streamon | ( | cam_data * | cam | ) | [static] |
Start the encoder job
cam | structure cam_data * |
References start_preview(), and stop_preview().
Referenced by mxc_v4l2_resume(), and mxc_v4l_do_ioctl().
static int mxc_v4l2_buffer_status | ( | cam_data * | cam, | |
struct v4l2_buffer * | buf | |||
) | [static] |
Return the buffer status
cam | Structure cam_data * | |
buf | Structure v4l2_buffer * |
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_g_ctrl | ( | cam_data * | cam, | |
struct v4l2_control * | c | |||
) | [static] |
get control param
cam | structure cam_data * | |
c | structure v4l2_control * |
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_g_fmt | ( | cam_data * | cam, | |
struct v4l2_format * | f | |||
) | [static] |
V4L2 - mxc_v4l2_g_fmt function
cam | structure cam_data * | |
f | structure v4l2_format * |
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_g_std | ( | cam_data * | cam, | |
v4l2_std_id * | e | |||
) | [static] |
V4L2 - mxc_v4l2_g_std function
Gets the TV standard from the TV input device.
cam | structure cam_data * | |
e | structure v4l2_streamparm * |
References mxc_v4l2_s_std().
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_master_attach | ( | struct v4l2_int_device * | slave | ) | [static] |
Initializes the camera driver.
static void mxc_v4l2_master_detach | ( | struct v4l2_int_device * | slave | ) | [static] |
Disconnects the camera driver.
static int mxc_v4l2_probe | ( | struct platform_device * | pdev | ) | [static] |
This function is called to probe the devices if registered.
pdev | the device structure used to give information on which device to probe |
References camera_platform_release(), and init_camera_struct().
static int mxc_v4l2_remove | ( | struct platform_device * | pdev | ) | [static] |
This function is called to remove the devices when device unregistered.
pdev | the device structure used to give information on which device to remove |
References mxc_free_frame_buf().
static int mxc_v4l2_resume | ( | struct platform_device * | pdev | ) | [static] |
This function is called to bring the sensor back from a low power state. Refer to the document driver-model/driver.txt in the kernel source tree for more information.
pdev | the device structure |
References mxc_streamon(), and start_preview().
static int mxc_v4l2_s_ctrl | ( | cam_data * | cam, | |
struct v4l2_control * | c | |||
) | [static] |
V4L2 - set_control function V4L2_CID_PRIVATE_BASE is the extention for IPU preprocessing. 0 for normal operation 1 for vertical flip 2 for horizontal flip 3 for horizontal and vertical flip 4 for 90 degree rotation
cam | structure cam_data * | |
c | structure v4l2_control * |
References ipu_csi_flash_strobe().
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_s_fmt | ( | cam_data * | cam, | |
struct v4l2_format * | f | |||
) | [static] |
V4L2 - mxc_v4l2_s_fmt function
cam | structure cam_data * | |
f | structure v4l2_format * |
References valid_mode(), and verify_preview().
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_s_param | ( | cam_data * | cam, | |
struct v4l2_streamparm * | parm | |||
) | [static] |
V4L2 - mxc_v4l2_s_param function Allows setting of capturemode and frame rate.
cam | structure cam_data * | |
parm | structure v4l2_streamparm * |
References ipu_csi_init_interface(), ipu_csi_set_window_pos(), ipu_csi_set_window_size(), start_preview(), and stop_preview().
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l2_s_std | ( | cam_data * | cam, | |
v4l2_std_id | e | |||
) | [static] |
V4L2 - mxc_v4l2_s_std function
Sets the TV standard to be used.
cam | structure cam_data * | |
parm | structure v4l2_streamparm * |
References video_fmt_t::active_height, video_fmt_t::active_left, video_fmt_t::active_top, video_fmt_t::active_width, video_fmt_t::name, video_fmt_t::raw_height, video_fmt_t::raw_width, TV_NOT_LOCKED, TV_NTSC, TV_PAL, and video_index.
Referenced by mxc_v4l2_g_std(), and mxc_v4l_do_ioctl().
static int mxc_v4l2_suspend | ( | struct platform_device * | pdev, | |
pm_message_t | state | |||
) | [static] |
This function is called to put the sensor in a low power state. Refer to the document driver-model/driver.txt in the kernel source tree for more information.
pdev | the device structure used to give information on which I2C to suspend | |
state | the power state the device is entering |
References stop_preview().
static int mxc_v4l_close | ( | struct file * | file | ) | [static] |
V4L interface - close function
file | struct file * |
References csi_enc_deselect(), mxc_free_frame_buf(), mxc_free_frames(), mxc_streamoff(), prp_enc_deselect(), and stop_preview().
static long mxc_v4l_do_ioctl | ( | struct file * | file, | |
unsigned int | ioctlnr, | |||
void * | arg | |||
) | [static] |
V4L interface - ioctl function
file | struct file* | |
ioctlnr | unsigned int | |
arg | void* |
References cap, csi_enc_select(), ipu_csi_set_window_pos(), ipu_csi_set_window_size(), mxc_allocate_frame_buf(), mxc_free_frame_buf(), mxc_streamoff(), mxc_streamon(), mxc_v4l2_buffer_status(), MXC_V4L2_CAPTURE_NUM_OUTPUTS, mxc_v4l2_g_ctrl(), mxc_v4l2_g_fmt(), mxc_v4l2_g_std(), mxc_v4l2_s_ctrl(), mxc_v4l2_s_fmt(), mxc_v4l2_s_param(), mxc_v4l2_s_std(), mxc_v4l_dqueue(), prp_enc_select(), start_preview(), and stop_preview().
static int mxc_v4l_dqueue | ( | cam_data * | cam, | |
struct v4l2_buffer * | buf | |||
) | [static] |
Dequeue one V4L capture buffer
cam | structure cam_data * | |
buf | structure v4l2_buffer * |
Referenced by mxc_v4l_do_ioctl().
static int mxc_v4l_open | ( | struct file * | file | ) | [static] |
V4L interface - open function
file | structure file * |
References csi_enc_select(), ipu_csi_init_interface(), ipu_csi_set_window_pos(), ipu_csi_set_window_size(), and prp_enc_select().
static int start_preview | ( | cam_data * | cam | ) | [static] |
start the viewfinder job
cam | structure cam_data * |
References prp_vf_sdc_select(), and prp_vf_sdc_select_bg().
Referenced by mxc_streamon(), mxc_v4l2_resume(), mxc_v4l2_s_param(), and mxc_v4l_do_ioctl().
static int stop_preview | ( | cam_data * | cam | ) | [static] |
shut down the viewfinder job
cam | structure cam_data * |
References prp_vf_sdc_deselect(), and prp_vf_sdc_deselect_bg().
Referenced by mxc_streamon(), mxc_v4l2_s_param(), mxc_v4l2_suspend(), mxc_v4l_close(), and mxc_v4l_do_ioctl().
static int valid_mode | ( | u32 | palette | ) | [inline, static] |
Indicates whether the palette is supported.
palette | V4L2_PIX_FMT_RGB565, V4L2_PIX_FMT_BGR24 or V4L2_PIX_FMT_BGR32 |
Referenced by mxc_v4l2_s_fmt().
static int verify_preview | ( | cam_data * | cam, | |
struct v4l2_window * | win | |||
) | [static] |
Valid and adjust the overlay window size, position
cam | structure cam_data * | |
win | struct v4l2_window * |
Referenced by mxc_v4l2_s_fmt().
struct platform_driver mxc_v4l2_driver [static] |
{ .driver = { .name = "mxc_v4l2_capture", }, .probe = mxc_v4l2_probe, .remove = mxc_v4l2_remove, .suspend = mxc_v4l2_suspend, .resume = mxc_v4l2_resume, .shutdown = NULL, }
This structure contains pointers to the power management callback functions.
struct v4l2_int_master mxc_v4l2_master [static] |
{ .attach = mxc_v4l2_master_attach, .detach = mxc_v4l2_master_detach, }
Information about this driver.
Referenced by init_camera_struct().
struct v4l2_file_operations mxc_v4l_fops [static] |
{ .owner = THIS_MODULE, .open = mxc_v4l_open, .release = mxc_v4l_close, .read = mxc_v4l_read, .ioctl = mxc_v4l_ioctl, .mmap = mxc_mmap, .poll = mxc_poll, }
This structure defines the functions to be called in this driver.
video_fmt_t video_fmts[] [static] |
{ { .v4l2_id = V4L2_STD_NTSC, .name = "NTSC", .raw_width = 720, .raw_height = 525, .active_width = 720, .active_height = 480, .active_top = 13, .active_left = 0, }, { .v4l2_id = V4L2_STD_PAL, .name = "PAL", .raw_width = 720, .raw_height = 625, .active_width = 720, .active_height = 576, .active_top = 0, .active_left = 0, }, { .v4l2_id = V4L2_STD_ALL, .name = "Autodetect", .raw_width = 720, .raw_height = 625, .active_width = 720, .active_height = 576, .active_top = 0, .active_left = 0, }, }
Description of video formats supported.
PAL: raw=720x625, active=720x576. NTSC: raw=720x525, active=720x480.
video_fmt_idx video_index = TV_NOT_LOCKED [static] |
* Standard index of TV.
Referenced by mxc_v4l2_s_std().
© Freescale Semiconductor, Inc., 2007.
All rights reserved. Freescale Confidential Proprietary NDA Required |
![]() |