diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-02-17 11:39:36 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-01 17:10:30 -0300 |
commit | 15f4bc3b1f42ca73ad073d7390aa34fa358f02a3 (patch) | |
tree | 1c8ce26e608bd8a90765d05f1f7fe463d6a4ca0f /drivers/media/video/s5p-jpeg/jpeg-hw.h | |
parent | 275de24dc0076fac25e86e586c9577b8caee28ce (diff) | |
download | talos-op-linux-15f4bc3b1f42ca73ad073d7390aa34fa358f02a3.tar.gz talos-op-linux-15f4bc3b1f42ca73ad073d7390aa34fa358f02a3.zip |
[media] s5p-jpeg: Add JPEG controls support
This patch replaces VIDIOC_S/G_JPEGCOMP ioctl handlers with
V4L2_CID_JPEG_QUALITY control. Additionally it enables JPEG subsampling
and the restart interval configuration through V4L2_CID_JPEG_SUBSAMPLING
and V4L2_CID_JPEG_RESTART_INTERVAL controls. For the decoder video node
only V4L2_CID_JPEG_SUBSAMPLING is available as a read-only control.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-jpeg/jpeg-hw.h')
-rw-r--r-- | drivers/media/video/s5p-jpeg/jpeg-hw.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/media/video/s5p-jpeg/jpeg-hw.h b/drivers/media/video/s5p-jpeg/jpeg-hw.h index e10c744e9f23..f12f0fdbde7c 100644 --- a/drivers/media/video/s5p-jpeg/jpeg-hw.h +++ b/drivers/media/video/s5p-jpeg/jpeg-hw.h @@ -13,6 +13,7 @@ #define JPEG_HW_H_ #include <linux/io.h> +#include <linux/videodev2.h> #include "jpeg-hw.h" #include "jpeg-regs.h" @@ -25,8 +26,6 @@ #define S5P_JPEG_DECODE 1 #define S5P_JPEG_RAW_IN_565 0 #define S5P_JPEG_RAW_IN_422 1 -#define S5P_JPEG_SUBSAMPLING_422 0 -#define S5P_JPEG_SUBSAMPLING_420 1 #define S5P_JPEG_RAW_OUT_422 0 #define S5P_JPEG_RAW_OUT_420 1 @@ -91,21 +90,26 @@ static inline void jpeg_proc_mode(void __iomem *regs, unsigned long mode) writel(reg, regs + S5P_JPGMOD); } -static inline void jpeg_subsampling_mode(void __iomem *regs, unsigned long mode) +static inline void jpeg_subsampling_mode(void __iomem *regs, unsigned int mode) { unsigned long reg, m; - m = S5P_SUBSAMPLING_MODE_422; - if (mode == S5P_JPEG_SUBSAMPLING_422) - m = S5P_SUBSAMPLING_MODE_422; - else if (mode == S5P_JPEG_SUBSAMPLING_420) + if (mode == V4L2_JPEG_CHROMA_SUBSAMPLING_420) m = S5P_SUBSAMPLING_MODE_420; + else + m = S5P_SUBSAMPLING_MODE_422; + reg = readl(regs + S5P_JPGMOD); reg &= ~S5P_SUBSAMPLING_MODE_MASK; reg |= m; writel(reg, regs + S5P_JPGMOD); } +static inline unsigned int jpeg_get_subsampling_mode(void __iomem *regs) +{ + return readl(regs + S5P_JPGMOD) & S5P_SUBSAMPLING_MODE_MASK; +} + static inline void jpeg_dri(void __iomem *regs, unsigned int dri) { unsigned long reg; |