aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/fimc-core.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-core.h')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index f121b939626a..6b3e0cd73cdd 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -28,18 +28,6 @@
#define dbg(fmt, args...)
#endif
-#define ctx_m2m_get_frame(frame, ctx, type) do { \
- if (V4L2_BUF_TYPE_VIDEO_OUTPUT == (type)) { \
- frame = &(ctx)->s_frame; \
- } else if (V4L2_BUF_TYPE_VIDEO_CAPTURE == (type)) { \
- frame = &(ctx)->d_frame; \
- } else { \
- v4l2_err(&(ctx)->fimc_dev->m2m.v4l2_dev,\
- "Wrong buffer/video queue type (%d)\n", type); \
- return -EINVAL; \
- } \
-} while (0)
-
#define NUM_FIMC_CLOCKS 2
#define MODULE_NAME "s5p-fimc"
#define FIMC_MAX_DEVS 3
@@ -444,6 +432,24 @@ static inline void fimc_hw_stop_in_dma(struct fimc_dev *dev)
writel(cfg, dev->regs + S5P_MSCTRL);
}
+static inline struct fimc_frame *ctx_m2m_get_frame(struct fimc_ctx *ctx,
+ enum v4l2_buf_type type)
+{
+ struct fimc_frame *frame;
+
+ if (V4L2_BUF_TYPE_VIDEO_OUTPUT == type) {
+ frame = &ctx->s_frame;
+ } else if (V4L2_BUF_TYPE_VIDEO_CAPTURE == type) {
+ frame = &ctx->d_frame;
+ } else {
+ v4l2_err(&ctx->fimc_dev->m2m.v4l2_dev,
+ "Wrong buffer/video queue type (%d)\n", type);
+ return ERR_PTR(-EINVAL);
+ }
+
+ return frame;
+}
+
/* -----------------------------------------------------*/
/* fimc-reg.c */
void fimc_hw_reset(struct fimc_dev *dev);