summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-01-18 15:58:04 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-10-14 13:10:43 +0200
commita3480b99fe448d85581d7455a1d2346582a2b0c7 (patch)
treed1599adc63522535c311e6da3da2d65001b95e52
parentd5e0f9b31e8a5da5b25a01bb1955314859c62760 (diff)
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 <laurent.pinchart@ideasonboard.com>
-rw-r--r--isp/controls.c25
-rw-r--r--isp/omap3isp.h2
2 files changed, 27 insertions, 0 deletions
diff --git a/isp/controls.c b/isp/controls.c
index c7ceee2..4dc943f 100644
--- a/isp/controls.c
+++ b/isp/controls.c
@@ -153,6 +153,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);