diff options
author | Yauhen Kharuzhy <y.kharuzhy@sam-solutions.net> | 2013-01-24 21:15:07 +0300 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2013-11-07 12:19:21 -0500 |
commit | d2c2fde218c6bbf2cea2ff726013c591f8a55d06 (patch) | |
tree | aa21fec1191e5b60fa7f386216ed80b218479298 /drivers | |
parent | 82451bf5fd1bbf2738364fb983d4bb66b2a288b9 (diff) |
MXC IPU capture: add support for greyscale formats
Add support for 8-bit and 10-bit grayscale data on CSI interface
(non-tested yet).
Signed-off-by: Yauhen Kharuzhy <y.kharuzhy@sam-solutions.net>
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/mxc_camera.c | 10 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_capture.c | 2 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_param_mem.h | 10 |
3 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/mxc_camera.c b/drivers/media/video/mxc_camera.c index c61ee58d90c0..bec5a79eaf23 100644 --- a/drivers/media/video/mxc_camera.c +++ b/drivers/media/video/mxc_camera.c @@ -55,9 +55,15 @@ u32 fourcc_to_ipu_pixfmt(u32 fourcc) case V4L2_PIX_FMT_RGB32: ipu_pixfmt = IPU_PIX_FMT_RGB32; break; + case V4L2_PIX_FMT_GREY: + ipu_pixfmt = IPU_PIX_FMT_GREY; + break; + case V4L2_PIX_FMT_Y10: + ipu_pixfmt = IPU_PIX_FMT_Y16; + break; default: - printk(KERN_ERR "format not supported\n"); - ipu_pixfmt = 0; + printk(KERN_ERR "Format is not supported, use generic\n"); + ipu_pixfmt = IPU_PIX_FMT_GENERIC; } return ipu_pixfmt; diff --git a/drivers/mxc/ipu3/ipu_capture.c b/drivers/mxc/ipu3/ipu_capture.c index c768d8b2b420..7928d6ae88b8 100644 --- a/drivers/mxc/ipu3/ipu_capture.c +++ b/drivers/mxc/ipu3/ipu_capture.c @@ -97,6 +97,8 @@ ipu_csi_init_interface(struct ipu_soc *ipu, uint16_t width, uint16_t height, case IPU_PIX_FMT_BGR24: cfg_param.data_fmt = CSI_SENS_CONF_DATA_FMT_RGB_YUV444; break; + case IPU_PIX_FMT_GREY: + case IPU_PIX_FMT_Y16: case IPU_PIX_FMT_GENERIC: cfg_param.data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; break; diff --git a/drivers/mxc/ipu3/ipu_param_mem.h b/drivers/mxc/ipu3/ipu_param_mem.h index 1387c4948446..0e897fdf3833 100644 --- a/drivers/mxc/ipu3/ipu_param_mem.h +++ b/drivers/mxc/ipu3/ipu_param_mem.h @@ -278,6 +278,7 @@ static inline void _ipu_ch_param_init(struct ipu_soc *ipu, int ch, "IDMAC%d's EBA1 is not 8-byte aligned\n", ch); switch (pixel_fmt) { + case IPU_PIX_FMT_GREY: case IPU_PIX_FMT_GENERIC: /*Represents 8-bit Generic data */ ipu_ch_param_set_field(¶ms, 0, 107, 3, 5); /* bits/pixel */ @@ -285,6 +286,13 @@ static inline void _ipu_ch_param_init(struct ipu_soc *ipu, int ch, ipu_ch_param_set_field(¶ms, 1, 78, 7, 63); /* burst size */ break; + case IPU_PIX_FMT_Y16: + /*Represents 16-bit Grey data */ + ipu_ch_param_set_field(¶ms, 0, 107, 3, 3); /* bits/pixel */ + ipu_ch_param_set_field(¶ms, 1, 85, 4, 6); /* pix format */ + ipu_ch_param_set_field(¶ms, 1, 78, 7, 31); /* burst size */ + + break; case IPU_PIX_FMT_GENERIC_32: /*Represents 32-bit Generic data */ break; @@ -694,6 +702,8 @@ static inline void _ipu_ch_offset_update(struct ipu_soc *ipu, int32_t sub_ch = 0; switch (pixel_fmt) { + case IPU_PIX_FMT_GREY: + case IPU_PIX_FMT_Y16: case IPU_PIX_FMT_GENERIC: case IPU_PIX_FMT_GENERIC_32: case IPU_PIX_FMT_RGB565: |