aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/s5p-fimc/fimc-core.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-12-23 15:59:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-12-23 15:59:23 -0800
commite82bb314eab2e25a7657f34450665160a5a6cc2b (patch)
tree1e7ec40c6346f3ade1d88b59c9a1d43bf1969ed7 /drivers/media/video/s5p-fimc/fimc-core.h
parent79534f237f05cac7f728cc957efdcc17603e38cd (diff)
parent501aaa110a4269c99eff9736a81b5f93bb8b59be (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (21 commits) [media] mceusb: set a default rx timeout [media] mceusb: fix inverted mask inversion logic [media] mceusb: add another Fintek device ID [media] lirc_dev: fixes in lirc_dev_fop_read() [media] lirc_dev: stray unlock in lirc_dev_fop_poll() [media] rc: fix sysfs entry for mceusb and streamzap [media] streamzap: merge timeout space with trailing space [media] mceusb: fix keybouce issue after parser simplification [media] IR: add tv power scancode to rc6 mce keymap [media] mceusb: buffer parsing fixups for 1st-gen device [media] mceusb: fix up reporting of trailing space [media] nuvoton-cir: improve buffer parsing responsiveness [media] mceusb: add support for Conexant Hybrid TV RDU253S [media] s5p-fimc: Fix output DMA handling in S5PV310 IP revisions [media] s5p-fimc: Use correct fourcc code for 32-bit RGB format [media] s5p-fimc: Convert m2m driver to unlocked_ioctl [media] s5p-fimc: Explicitly add required header file [media] s5p-fimc: Fix vidioc_g_crop/cropcap on camera sensor [media] s5p-fimc: BKL lock removal - compilation fix [media] soc-camera: fix static build of the sh_mobile_csi2.c driver ...
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-core.h')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index 3e107851656..4f047d35f8a 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -13,13 +13,15 @@
/*#define DEBUG*/
+#include <linux/sched.h>
#include <linux/types.h>
+#include <linux/videodev2.h>
#include <media/videobuf-core.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-mediabus.h>
#include <media/s3c_fimc.h>
-#include <linux/videodev2.h>
+
#include "regs-fimc.h"
#define err(fmt, args...) \
@@ -369,6 +371,7 @@ struct fimc_pix_limit {
* @pix_hoff: indicate whether horizontal offset is in pixels or in bytes
* @has_inp_rot: set if has input rotator
* @has_out_rot: set if has output rotator
+ * @has_cistatus2: 1 if CISTATUS2 register is present in this IP revision
* @pix_limit: pixel size constraints for the scaler
* @min_inp_pixsize: minimum input pixel size
* @min_out_pixsize: minimum output pixel size
@@ -379,6 +382,7 @@ struct samsung_fimc_variant {
unsigned int pix_hoff:1;
unsigned int has_inp_rot:1;
unsigned int has_out_rot:1;
+ unsigned int has_cistatus2:1;
struct fimc_pix_limit *pix_limit;
u16 min_inp_pixsize;
u16 min_out_pixsize;
@@ -554,11 +558,19 @@ static inline struct fimc_frame *ctx_get_frame(struct fimc_ctx *ctx,
return frame;
}
+/* Return an index to the buffer actually being written. */
static inline u32 fimc_hw_get_frame_index(struct fimc_dev *dev)
{
- u32 reg = readl(dev->regs + S5P_CISTATUS);
- return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>
- S5P_CISTATUS_FRAMECNT_SHIFT;
+ u32 reg;
+
+ if (dev->variant->has_cistatus2) {
+ reg = readl(dev->regs + S5P_CISTATUS2) & 0x3F;
+ return reg > 0 ? --reg : reg;
+ } else {
+ reg = readl(dev->regs + S5P_CISTATUS);
+ return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>
+ S5P_CISTATUS_FRAMECNT_SHIFT;
+ }
}
/* -----------------------------------------------------*/
@@ -594,10 +606,6 @@ int fimc_vidioc_g_fmt(struct file *file, void *priv,
struct v4l2_format *f);
int fimc_vidioc_try_fmt(struct file *file, void *priv,
struct v4l2_format *f);
-int fimc_vidioc_g_crop(struct file *file, void *fh,
- struct v4l2_crop *cr);
-int fimc_vidioc_cropcap(struct file *file, void *fh,
- struct v4l2_cropcap *cr);
int fimc_vidioc_queryctrl(struct file *file, void *priv,
struct v4l2_queryctrl *qc);
int fimc_vidioc_g_ctrl(struct file *file, void *priv,