diff options
Diffstat (limited to 'drivers/media/video/samsung/fimc/fimc.h')
-rw-r--r-- | drivers/media/video/samsung/fimc/fimc.h | 201 |
1 files changed, 133 insertions, 68 deletions
diff --git a/drivers/media/video/samsung/fimc/fimc.h b/drivers/media/video/samsung/fimc/fimc.h index 5d79a15..8e47805 100644 --- a/drivers/media/video/samsung/fimc/fimc.h +++ b/drivers/media/video/samsung/fimc/fimc.h @@ -111,12 +111,18 @@ enum fimc_input { }; enum fimc_overlay_mode { - FIMC_OVLY_NOT_FIXED = 0x0, /* Overlay mode isn't fixed. */ - FIMC_OVLY_FIFO = 0x1, /* Non-destructive Overlay with FIFO */ - FIMC_OVLY_DMA_AUTO = 0x2, /* Non-destructive Overlay with DMA */ - FIMC_OVLY_DMA_MANUAL = 0x3, /* Non-destructive Overlay with DMA */ - FIMC_OVLY_NONE_SINGLE_BUF = 0x4, /* Destructive Overlay with DMA single destination buffer */ - FIMC_OVLY_NONE_MULTI_BUF = 0x5, /* Destructive Overlay with DMA multiple dstination buffer */ + /* Overlay mode isn't fixed. */ + FIMC_OVLY_NOT_FIXED = 0x0, + /* Non-destructive Overlay with FIFO */ + FIMC_OVLY_FIFO = 0x1, + /* Non-destructive Overlay with DMA */ + FIMC_OVLY_DMA_AUTO = 0x2, + /* Non-destructive Overlay with DMA */ + FIMC_OVLY_DMA_MANUAL = 0x3, + /* Destructive Overlay with DMA single destination buffer */ + FIMC_OVLY_NONE_SINGLE_BUF = 0x4, + /* Destructive Overlay with DMA multiple dstination buffer */ + FIMC_OVLY_NONE_MULTI_BUF = 0x5, }; enum fimc_autoload { @@ -231,7 +237,7 @@ struct fimc_scaler { struct fimc_ctx { u32 ctx_num; struct v4l2_cropcap cropcap; - struct v4l2_rect crop; + struct v4l2_rect crop; struct v4l2_pix_format pix; struct v4l2_window win; struct v4l2_framebuffer fbuf; @@ -334,7 +340,7 @@ struct fimc_control { atomic_t in_use; void __iomem *regs; /* register i/o */ struct clk *clk; /* interface clock */ - struct regulator *regulator; /* pd regulator */ + struct regulator *regulator; /* pd regulator */ struct fimc_meminfo mem; /* for reserved mem */ /* kernel helpers */ @@ -360,15 +366,15 @@ struct fimc_control { enum fimc_status status; enum fimc_log log; - u32 ctx_busy[FIMC_MAX_CTXS]; + u32 ctx_busy[FIMC_MAX_CTXS]; }; /* global */ struct fimc_global { - struct fimc_control ctrl[FIMC_DEVICES]; + struct fimc_control ctrl[FIMC_DEVICES]; struct s3c_platform_camera camera[FIMC_MAXCAMS]; int camera_isvalid[FIMC_MAXCAMS]; - int active_camera; + int active_camera; int initialized; }; @@ -435,13 +441,19 @@ extern struct fimc_limit fimc50_limits[FIMC_DEVICES]; /* FIMD */ extern int s3cfb_direct_ioctl(int id, unsigned int cmd, unsigned long arg); -extern int s3cfb_open_fifo(int id, int ch, int (*do_priv)(void *), void *param); +extern int s3cfb_open_fifo(int id, int ch, + int (*do_priv)(void *), void *param); extern int s3cfb_close_fifo(int id, int (*do_priv)(void *), void *param); /* general */ -extern void s3c_csis_start(int lanes, int settle, int align, int width, int height, int pixel_format); -extern int fimc_dma_alloc(struct fimc_control *ctrl, struct fimc_buf_set *bs, int i, int align); -extern void fimc_dma_free(struct fimc_control *ctrl, struct fimc_buf_set *bs, int i); +extern void s3c_csis_start(int lanes, int settle, int align, + int width, int height, + int pixel_format); +extern int fimc_dma_alloc(struct fimc_control *ctrl, + struct fimc_buf_set *bs, + int i, int align); +extern void fimc_dma_free(struct fimc_control *ctrl, + struct fimc_buf_set *bs, int i); extern u32 fimc_mapping_rot_flip(u32 rot, u32 flip); extern int fimc_get_scaler_factor(u32 src, u32 tar, u32 *ratio, u32 *shift); extern void fimc_get_nv12t_size(int img_hres, int img_vres, @@ -452,13 +464,18 @@ extern void fimc_clk_en(struct fimc_control *ctrl, bool on); extern int fimc_select_camera(struct fimc_control *ctrl); /* capture device */ -extern int fimc_enum_input(struct file *file, void *fh, struct v4l2_input *inp); +extern int fimc_enum_input(struct file *file, void *fh, + struct v4l2_input *inp); extern int fimc_g_input(struct file *file, void *fh, unsigned int *i); extern int fimc_s_input(struct file *file, void *fh, unsigned int i); -extern int fimc_enum_fmt_vid_capture(struct file *file, void *fh, struct v4l2_fmtdesc *f); -extern int fimc_g_fmt_vid_capture(struct file *file, void *fh, struct v4l2_format *f); -extern int fimc_s_fmt_vid_capture(struct file *file, void *fh, struct v4l2_format *f); -extern int fimc_try_fmt_vid_capture(struct file *file, void *fh, struct v4l2_format *f); +extern int fimc_enum_fmt_vid_capture(struct file *file, void *fh, + struct v4l2_fmtdesc *f); +extern int fimc_g_fmt_vid_capture(struct file *file, void *fh, + struct v4l2_format *f); +extern int fimc_s_fmt_vid_capture(struct file *file, void *fh, + struct v4l2_format *f); +extern int fimc_try_fmt_vid_capture(struct file *file, void *fh, + struct v4l2_format *f); extern int fimc_reqbufs_capture(void *fh, struct v4l2_requestbuffers *b); extern int fimc_querybuf_capture(void *fh, struct v4l2_buffer *b); extern int fimc_g_ctrl_capture(void *fh, struct v4l2_control *c); @@ -471,29 +488,40 @@ extern int fimc_streamon_capture(void *fh); extern int fimc_streamoff_capture(void *fh); extern int fimc_qbuf_capture(void *fh, struct v4l2_buffer *b); extern int fimc_dqbuf_capture(void *fh, struct v4l2_buffer *b); -extern int fimc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a); -extern int fimc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a); -extern int fimc_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qc); -extern int fimc_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qm); +extern int fimc_g_parm(struct file *file, void *fh, + struct v4l2_streamparm *a); +extern int fimc_s_parm(struct file *file, void *fh, + struct v4l2_streamparm *a); +extern int fimc_queryctrl(struct file *file, void *fh, + struct v4l2_queryctrl *qc); +extern int fimc_querymenu(struct file *file, void *fh, + struct v4l2_querymenu *qm); #if defined(CONFIG_CPU_S5PV210) extern int fimc_change_clksrc(struct fimc_control *ctrl, int fimc_clk); #endif extern int fimc_release_subdev(struct fimc_control *ctrl); -void fimc_hwset_stop_processing(struct fimc_control *ctrl); /* output device */ -extern void fimc_outdev_set_src_addr(struct fimc_control *ctrl, dma_addr_t *base); -extern int fimc_outdev_set_ctx_param(struct fimc_control *ctrl, struct fimc_ctx *ctx); -extern int fimc_start_fifo(struct fimc_control *ctrl, struct fimc_ctx *ctx); -extern int fimc_fimd_rect(const struct fimc_control *ctrl, const struct fimc_ctx *ctx, struct v4l2_rect *fimd_rect); -extern int fimc_outdev_stop_streaming(struct fimc_control *ctrl, struct fimc_ctx *ctx); -extern int fimc_outdev_resume_dma(struct fimc_control *ctrl, struct fimc_ctx *ctx); +extern void fimc_outdev_set_src_addr(struct fimc_control *ctrl, + dma_addr_t *base); +extern int fimc_outdev_set_ctx_param(struct fimc_control *ctrl, + struct fimc_ctx *ctx); +extern int fimc_start_fifo(struct fimc_control *ctrl, + struct fimc_ctx *ctx); +extern int fimc_fimd_rect(const struct fimc_control *ctrl, + const struct fimc_ctx *ctx, + struct v4l2_rect *fimd_rect); +extern int fimc_outdev_stop_streaming(struct fimc_control *ctrl, + struct fimc_ctx *ctx); +extern int fimc_outdev_resume_dma(struct fimc_control *ctrl, + struct fimc_ctx *ctx); extern int fimc_outdev_start_camif(void *param); extern int fimc_reqbufs_output(void *fh, struct v4l2_requestbuffers *b); extern int fimc_querybuf_output(void *fh, struct v4l2_buffer *b); extern int fimc_g_ctrl_output(void *fh, struct v4l2_control *c); -extern int fimc_s_ctrl_output(struct file *filp, void *fh, struct v4l2_control *c); +extern int fimc_s_ctrl_output(struct file *filp, void *fh, + struct v4l2_control *c); extern int fimc_cropcap_output(void *fh, struct v4l2_cropcap *a); extern int fimc_g_crop_output(void *fh, struct v4l2_crop *a); extern int fimc_s_crop_output(void *fh, struct v4l2_crop *a); @@ -501,16 +529,22 @@ extern int fimc_streamon_output(void *fh); extern int fimc_streamoff_output(void *fh); extern int fimc_qbuf_output(void *fh, struct v4l2_buffer *b); extern int fimc_dqbuf_output(void *fh, struct v4l2_buffer *b); -extern int fimc_g_fmt_vid_out(struct file *filp, void *fh, struct v4l2_format *f); -extern int fimc_s_fmt_vid_out(struct file *filp, void *fh, struct v4l2_format *f); -extern int fimc_try_fmt_vid_out(struct file *filp, void *fh, struct v4l2_format *f); -extern int fimc_output_set_dst_addr(struct fimc_control *ctrl, struct fimc_ctx *ctx, int idx); - +extern int fimc_g_fmt_vid_out(struct file *filp, void *fh, + struct v4l2_format *f); +extern int fimc_s_fmt_vid_out(struct file *filp, void *fh, + struct v4l2_format *f); +extern int fimc_try_fmt_vid_out(struct file *filp, void *fh, + struct v4l2_format *f); +extern int fimc_output_set_dst_addr(struct fimc_control *ctrl, + struct fimc_ctx *ctx, int idx); extern int fimc_init_in_queue(struct fimc_control *ctrl, struct fimc_ctx *ctx); -extern int fimc_push_inq(struct fimc_control *ctrl, struct fimc_ctx *ctx, int idx); +extern int fimc_push_inq(struct fimc_control *ctrl, + struct fimc_ctx *ctx, int idx); extern int fimc_pop_inq(struct fimc_control *ctrl, int *ctx_num, int *idx); -extern int fimc_push_outq(struct fimc_control *ctrl, struct fimc_ctx *ctx, int idx); -extern int fimc_pop_outq(struct fimc_control *ctrl, struct fimc_ctx *ctx, int *idx); +extern int fimc_push_outq(struct fimc_control *ctrl, + struct fimc_ctx *ctx, int idx); +extern int fimc_pop_outq(struct fimc_control *ctrl, + struct fimc_ctx *ctx, int *idx); extern int fimc_init_out_queue(struct fimc_control *ctrl, struct fimc_ctx *ctx); extern void fimc_outdev_init_idxs(struct fimc_control *ctrl); @@ -518,16 +552,22 @@ extern void fimc_dump_context(struct fimc_control *ctrl, struct fimc_ctx *ctx); extern void fimc_print_signal(struct fimc_control *ctrl); /* overlay device */ -extern int fimc_try_fmt_overlay(struct file *filp, void *fh, struct v4l2_format *f); -extern int fimc_g_fmt_vid_overlay(struct file *filp, void *fh, struct v4l2_format *f); -extern int fimc_s_fmt_vid_overlay(struct file *filp, void *fh, struct v4l2_format *f); -extern int fimc_g_fbuf(struct file *filp, void *fh, struct v4l2_framebuffer *fb); -extern int fimc_s_fbuf(struct file *filp, void *fh, struct v4l2_framebuffer *fb); +extern int fimc_try_fmt_overlay(struct file *filp, void *fh, + struct v4l2_format *f); +extern int fimc_g_fmt_vid_overlay(struct file *filp, void *fh, + struct v4l2_format *f); +extern int fimc_s_fmt_vid_overlay(struct file *filp, void *fh, + struct v4l2_format *f); +extern int fimc_g_fbuf(struct file *filp, void *fh, + struct v4l2_framebuffer *fb); +extern int fimc_s_fbuf(struct file *filp, void *fh, + struct v4l2_framebuffer *fb); /* Register access file */ extern void fimc_reset(struct fimc_control *ctrl); extern int fimc_hwset_camera_source(struct fimc_control *ctrl); -extern int fimc_hwset_enable_irq(struct fimc_control *ctrl, int overflow, int level); +extern int fimc_hwset_enable_irq(struct fimc_control *ctrl, + int overflow, int level); extern int fimc_hwset_disable_irq(struct fimc_control *ctrl); extern int fimc_hwset_clear_irq(struct fimc_control *ctrl); extern int fimc_hwset_reset(struct fimc_control *ctrl); @@ -536,17 +576,25 @@ extern int fimc_hwget_overflow_state(struct fimc_control *ctrl); extern int fimc_hwset_camera_offset(struct fimc_control *ctrl); extern int fimc_hwset_camera_polarity(struct fimc_control *ctrl); extern int fimc_hwset_camera_type(struct fimc_control *ctrl); -extern int fimc_hwset_output_size(struct fimc_control *ctrl, int width, int height); -extern int fimc_hwset_output_colorspace(struct fimc_control *ctrl, u32 pixelformat); -extern int fimc_hwset_output_rot_flip(struct fimc_control *ctrl, u32 rot, u32 flip); -extern int fimc_hwset_output_area(struct fimc_control *ctrl, u32 width, u32 height); +extern int fimc_hwset_output_size(struct fimc_control *ctrl, + int width, int height); +extern int fimc_hwset_output_colorspace(struct fimc_control *ctrl, + u32 pixelformat); +extern int fimc_hwset_output_rot_flip(struct fimc_control *ctrl, + u32 rot, u32 flip); +extern int fimc_hwset_output_area(struct fimc_control *ctrl, + u32 width, u32 height); extern int fimc_hwset_output_area_size(struct fimc_control *ctrl, u32 size); -extern int fimc_hwset_output_scan(struct fimc_control *ctrl, struct v4l2_pix_format *fmt); +extern int fimc_hwset_output_scan(struct fimc_control *ctrl, + struct v4l2_pix_format *fmt); extern int fimc_hwset_enable_lastirq(struct fimc_control *ctrl); extern int fimc_hwset_disable_lastirq(struct fimc_control *ctrl); -extern int fimc_hwset_prescaler(struct fimc_control *ctrl, struct fimc_scaler *sc); +extern int fimc_hwset_prescaler(struct fimc_control *ctrl, + struct fimc_scaler *sc); extern int fimc_hwset_output_yuv(struct fimc_control *ctrl, u32 pixelformat); -extern int fimc_hwset_output_address(struct fimc_control *ctrl, struct fimc_buf_set *bs, int id); +extern int fimc_hwset_output_address(struct fimc_control *ctrl, + struct fimc_buf_set *bs, + int id); extern int fimc_hwset_input_rot(struct fimc_control *ctrl, u32 rot, u32 flip); extern int fimc_hwset_scaler(struct fimc_control *ctrl, struct fimc_scaler *sc); extern int fimc_hwset_scaler_bypass(struct fimc_control *ctrl); @@ -555,39 +603,56 @@ extern int fimc_hwset_disable_lcdfifo(struct fimc_control *ctrl); extern int fimc_hwset_start_scaler(struct fimc_control *ctrl); extern int fimc_hwset_stop_scaler(struct fimc_control *ctrl); extern int fimc_hwset_input_rgb(struct fimc_control *ctrl, u32 pixelformat); -extern int fimc_hwset_intput_field(struct fimc_control *ctrl, enum v4l2_field field); +extern int fimc_hwset_intput_field(struct fimc_control *ctrl, + enum v4l2_field field); extern int fimc_hwset_output_rgb(struct fimc_control *ctrl, u32 pixelformat); extern int fimc_hwset_ext_rgb(struct fimc_control *ctrl, int enable); -extern int fimc_hwset_enable_capture(struct fimc_control *ctrl, u32 bypass); +extern int fimc_hwset_enable_capture(struct fimc_control *ctrl, + u32 bypass); extern int fimc_hwset_disable_capture(struct fimc_control *ctrl); extern void fimc_wait_disable_capture(struct fimc_control *ctrl); -extern int fimc_hwset_input_address(struct fimc_control *ctrl, dma_addr_t *base); +extern int fimc_hwset_input_address(struct fimc_control *ctrl, + dma_addr_t *base); extern int fimc_hwset_enable_autoload(struct fimc_control *ctrl); extern int fimc_hwset_disable_autoload(struct fimc_control *ctrl); -extern int fimc_hwset_real_input_size(struct fimc_control *ctrl, u32 width, u32 height); +extern int fimc_hwset_real_input_size(struct fimc_control *ctrl, + u32 width, u32 height); extern int fimc_hwset_addr_change_enable(struct fimc_control *ctrl); extern int fimc_hwset_addr_change_disable(struct fimc_control *ctrl); extern int fimc_hwset_input_burst_cnt(struct fimc_control *ctrl, u32 cnt); -extern int fimc_hwset_input_colorspace(struct fimc_control *ctrl, u32 pixelformat); +extern int fimc_hwset_input_colorspace(struct fimc_control *ctrl, + u32 pixelformat); extern int fimc_hwset_input_yuv(struct fimc_control *ctrl, u32 pixelformat); extern int fimc_hwset_input_flip(struct fimc_control *ctrl, u32 rot, u32 flip); -extern int fimc_hwset_input_source(struct fimc_control *ctrl, enum fimc_input path); +extern int fimc_hwset_input_source(struct fimc_control *ctrl, + enum fimc_input path); extern int fimc_hwset_start_input_dma(struct fimc_control *ctrl); extern int fimc_hwset_stop_input_dma(struct fimc_control *ctrl); -extern int fimc_hwset_output_offset(struct fimc_control *ctrl, u32 pixelformat, struct v4l2_rect *bound, struct v4l2_rect *crop); -extern int fimc_hwset_input_offset(struct fimc_control *ctrl, u32 pixelformat, struct v4l2_rect *bound, struct v4l2_rect *crop); -extern int fimc_hwset_org_input_size(struct fimc_control *ctrl, u32 width, u32 height); -extern int fimc_hwset_org_output_size(struct fimc_control *ctrl, u32 width, u32 height); -extern int fimc_hwset_ext_output_size(struct fimc_control *ctrl, u32 width, u32 height); -extern int fimc_hwset_input_addr_style(struct fimc_control *ctrl, u32 pixelformat); -extern int fimc_hwset_output_addr_style(struct fimc_control *ctrl, u32 pixelformat); +extern int fimc_hwset_output_offset(struct fimc_control *ctrl, + u32 pixelformat, + struct v4l2_rect *bound, + struct v4l2_rect *crop); +extern int fimc_hwset_input_offset(struct fimc_control *ctrl, + u32 pixelformat, + struct v4l2_rect *bound, + struct v4l2_rect *crop); +extern int fimc_hwset_org_input_size(struct fimc_control *ctrl, + u32 width, u32 height); +extern int fimc_hwset_org_output_size(struct fimc_control *ctrl, + u32 width, u32 height); +extern int fimc_hwset_ext_output_size(struct fimc_control *ctrl, + u32 width, u32 height); +extern int fimc_hwset_input_addr_style(struct fimc_control *ctrl, + u32 pixelformat); +extern int fimc_hwset_output_addr_style(struct fimc_control *ctrl, + u32 pixelformat); extern int fimc_hwset_jpeg_mode(struct fimc_control *ctrl, bool enable); extern int fimc_hwget_frame_count(struct fimc_control *ctrl); extern int fimc_hw_wait_winoff(struct fimc_control *ctrl); extern int fimc_hw_wait_stop_input_dma(struct fimc_control *ctrl); extern int fimc_hwset_input_lineskip(struct fimc_control *ctrl); extern int fimc_hw_reset_camera(struct fimc_control *ctrl); -void fimc_hwset_stop_processing(struct fimc_control *ctrl); +extern void fimc_hwset_stop_processing(struct fimc_control *ctrl); extern int fimc_hwset_image_effect(struct fimc_control *ctrl); extern int fimc_hwset_shadow_enable(struct fimc_control *ctrl); extern int fimc_hwset_shadow_disable(struct fimc_control *ctrl); @@ -602,7 +667,7 @@ extern void ipc_start(void); * D R I V E R H E L P E R S * */ -#define to_fimc_plat(d) to_platform_device(d)->dev.platform_data +#define to_fimc_plat(d) (to_platform_device(d)->dev.platform_data) static inline struct fimc_global *get_fimc_dev(void) { |