From a3480b99fe448d85581d7455a1d2346582a2b0c7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 18 Jan 2011 15:58:04 +0100 Subject: omap3isp: CCDC black level compensation control Add a function to modify the black level DC offset for the OMAP3 ISP CCDC. Signed-off-by: Laurent Pinchart --- isp/controls.c | 25 +++++++++++++++++++++++++ isp/omap3isp.h | 2 ++ 2 files changed, 27 insertions(+) (limited to 'isp') diff --git a/isp/controls.c b/isp/controls.c index c7ceee2..4dc943f 100644 --- a/isp/controls.c +++ b/isp/controls.c @@ -152,6 +152,31 @@ static void matrix_float_to_s12q8(__u16 out[3][3], const struct matrix *in) } } +/* ----------------------------------------------------------------------------- + * CCDC parameters configuration + */ + +int omap3_isp_ccdc_set_black_level(struct omap3_isp_device *isp, unsigned int value) +{ + struct omap3isp_ccdc_update_config config; + struct omap3isp_ccdc_bclamp bclamp; + int ret; + + memset(&config, 0, sizeof config); + config.update = OMAP3ISP_CCDC_BLCLAMP; + config.flag = 0; + config.bclamp = &bclamp; + + memset(&bclamp, 0, sizeof bclamp); + bclamp.dcsubval = value; + + ret = ioctl(isp->ccdc->fd, VIDIOC_OMAP3ISP_CCDC_CFG, &config); + if (ret < 0) + return -errno; + + return ret; +} + /* ----------------------------------------------------------------------------- * Preview engine parameters configuration */ diff --git a/isp/omap3isp.h b/isp/omap3isp.h index 368fd72..6635437 100644 --- a/isp/omap3isp.h +++ b/isp/omap3isp.h @@ -74,6 +74,8 @@ int omap3_isp_snapshot_capture(struct omap3_isp_device *isp); int omap3_isp_snapshot_put_buffer(struct omap3_isp_device *isp, struct v4l2_video_buffer *buffer); +int omap3_isp_ccdc_set_black_level(struct omap3_isp_device *isp, unsigned int value); + int omap3_isp_preview_set_contrast(struct omap3_isp_device *isp, unsigned int value); int omap3_isp_preview_set_saturation(struct omap3_isp_device *isp, float value); -- cgit v1.2.3