[media] v4l: ctrls: Add a control for digital gain
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 8 Jun 2017 19:59:58 +0000 (16:59 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 20 Jun 2017 11:14:34 +0000 (08:14 -0300)
Add V4L2_CID_DIGITAL_GAIN to control explicitly digital gain.

We already have analogue gain control which the digital gain control
complements. Typically higher quality images are obtained using analogue
gain only as the digital gain does not add information to the image
(rather it may remove it).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Documentation/media/uapi/v4l/extended-controls.rst
drivers/media/v4l2-core/v4l2-ctrls.c
include/uapi/linux/v4l2-controls.h

index 76c5b1aeaadd184cb1b6b3b1dab8eb1bf2c36571..9acc9cad49e2532636ebd52fdc18de4cdd3a8473 100644 (file)
@@ -3021,6 +3021,13 @@ Image Process Control IDs
     The video deinterlacing mode (such as Bob, Weave, ...). The menu items are
     driver specific and are documented in :ref:`v4l-drivers`.
 
+``V4L2_CID_DIGITAL_GAIN (integer)``
+    Digital gain is the value by which all colour components
+    are multiplied by. Typically the digital gain applied is the
+    control value divided by e.g. 0x100, meaning that to get no
+    digital gain the control value needs to be 0x100. The no-gain
+    configuration is also typically the default.
+
 
 .. _dv-controls:
 
index 5aed7bd20ad255f0634616842eef748925a83444..36eede3ff0981ca401fb46400c7ae1b6eab64699 100644 (file)
@@ -886,6 +886,7 @@ const char *v4l2_ctrl_get_name(u32 id)
        case V4L2_CID_PIXEL_RATE:               return "Pixel Rate";
        case V4L2_CID_TEST_PATTERN:             return "Test Pattern";
        case V4L2_CID_DEINTERLACING_MODE:       return "Deinterlacing Mode";
+       case V4L2_CID_DIGITAL_GAIN:             return "Digital Gain";
 
        /* DV controls */
        /* Keep the order of the 'case's the same as in v4l2-controls.h! */
index 8cadcece7a298093e184605a7a448ef1ce02c962..31bfc68f86d67534ed050f861ced6252d4cd9b24 100644 (file)
@@ -902,7 +902,7 @@ enum v4l2_jpeg_chroma_subsampling {
 #define V4L2_CID_PIXEL_RATE                    (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
 #define V4L2_CID_TEST_PATTERN                  (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
 #define V4L2_CID_DEINTERLACING_MODE            (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
-
+#define V4L2_CID_DIGITAL_GAIN                  (V4L2_CID_IMAGE_PROC_CLASS_BASE + 5)
 
 /*  DV-class control IDs defined by V4L2 */
 #define V4L2_CID_DV_CLASS_BASE                 (V4L2_CTRL_CLASS_DV | 0x900)