diff options
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 @@ | |||
13 | #define JPEG_HW_H_ | 13 | #define JPEG_HW_H_ |
14 | 14 | ||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/videodev2.h> | ||
16 | 17 | ||
17 | #include "jpeg-hw.h" | 18 | #include "jpeg-hw.h" |
18 | #include "jpeg-regs.h" | 19 | #include "jpeg-regs.h" |
@@ -25,8 +26,6 @@ | |||
25 | #define S5P_JPEG_DECODE 1 | 26 | #define S5P_JPEG_DECODE 1 |
26 | #define S5P_JPEG_RAW_IN_565 0 | 27 | #define S5P_JPEG_RAW_IN_565 0 |
27 | #define S5P_JPEG_RAW_IN_422 1 | 28 | #define S5P_JPEG_RAW_IN_422 1 |
28 | #define S5P_JPEG_SUBSAMPLING_422 0 | ||
29 | #define S5P_JPEG_SUBSAMPLING_420 1 | ||
30 | #define S5P_JPEG_RAW_OUT_422 0 | 29 | #define S5P_JPEG_RAW_OUT_422 0 |
31 | #define S5P_JPEG_RAW_OUT_420 1 | 30 | #define S5P_JPEG_RAW_OUT_420 1 |
32 | 31 | ||
@@ -91,21 +90,26 @@ static inline void jpeg_proc_mode(void __iomem *regs, unsigned long mode) | |||
91 | writel(reg, regs + S5P_JPGMOD); | 90 | writel(reg, regs + S5P_JPGMOD); |
92 | } | 91 | } |
93 | 92 | ||
94 | static inline void jpeg_subsampling_mode(void __iomem *regs, unsigned long mode) | 93 | static inline void jpeg_subsampling_mode(void __iomem *regs, unsigned int mode) |
95 | { | 94 | { |
96 | unsigned long reg, m; | 95 | unsigned long reg, m; |
97 | 96 | ||
98 | m = S5P_SUBSAMPLING_MODE_422; | 97 | if (mode == V4L2_JPEG_CHROMA_SUBSAMPLING_420) |
99 | if (mode == S5P_JPEG_SUBSAMPLING_422) | ||
100 | m = S5P_SUBSAMPLING_MODE_422; | ||
101 | else if (mode == S5P_JPEG_SUBSAMPLING_420) | ||
102 | m = S5P_SUBSAMPLING_MODE_420; | 98 | m = S5P_SUBSAMPLING_MODE_420; |
99 | else | ||
100 | m = S5P_SUBSAMPLING_MODE_422; | ||
101 | |||
103 | reg = readl(regs + S5P_JPGMOD); | 102 | reg = readl(regs + S5P_JPGMOD); |
104 | reg &= ~S5P_SUBSAMPLING_MODE_MASK; | 103 | reg &= ~S5P_SUBSAMPLING_MODE_MASK; |
105 | reg |= m; | 104 | reg |= m; |
106 | writel(reg, regs + S5P_JPGMOD); | 105 | writel(reg, regs + S5P_JPGMOD); |
107 | } | 106 | } |
108 | 107 | ||
108 | static inline unsigned int jpeg_get_subsampling_mode(void __iomem *regs) | ||
109 | { | ||
110 | return readl(regs + S5P_JPGMOD) & S5P_SUBSAMPLING_MODE_MASK; | ||
111 | } | ||
112 | |||
109 | static inline void jpeg_dri(void __iomem *regs, unsigned int dri) | 113 | static inline void jpeg_dri(void __iomem *regs, unsigned int dri) |
110 | { | 114 | { |
111 | unsigned long reg; | 115 | unsigned long reg; |