aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-03-06 05:06:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 13:03:47 -0400
commitd58083c949b3d76aba225be9f303ab5dab585064 (patch)
tree3181333e4eacbdcc10743aee341ba6bbbd1adf1e
parent515f32879a05bdb69f9b3f86f53db4c04b95e845 (diff)
[media] V4L: Add camera exposure bias control
The camera may in some conditions incorrectly determine the exposure, and a manual automatic exposure correction may be needed. This patch adds V4L2_CID_AUTO_EXPOSURE_BIAS control which allows to add some offset in the automatic exposure control loop, to compensate for frame under- or over-exposure. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/DocBook/media/v4l/controls.xml16
-rw-r--r--drivers/media/video/v4l2-ctrls.c4
-rw-r--r--include/linux/videodev2.h2
3 files changed, 22 insertions, 0 deletions
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index e2ff0f98f08d..745b611c3593 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -2849,6 +2849,22 @@ remain constant.</entry>
2849 <row><entry></entry></row> 2849 <row><entry></entry></row>
2850 2850
2851 <row> 2851 <row>
2852 <entry spanname="id"><constant>V4L2_CID_EXPOSURE_BIAS</constant>&nbsp;</entry>
2853 <entry>integer menu</entry>
2854 </row><row><entry spanname="descr"> Determines the automatic
2855exposure compensation, it is effective only when <constant>V4L2_CID_EXPOSURE_AUTO</constant>
2856control is set to <constant>AUTO</constant>, <constant>SHUTTER_PRIORITY </constant>
2857or <constant>APERTURE_PRIORITY</constant>.
2858It is expressed in terms of EV, drivers should interpret the values as 0.001 EV
2859units, where the value 1000 stands for +1 EV.
2860<para>Increasing the exposure compensation value is equivalent to decreasing
2861the exposure value (EV) and will increase the amount of light at the image
2862sensor. The camera performs the exposure compensation by adjusting absolute
2863exposure time and/or aperture.</para></entry>
2864 </row>
2865 <row><entry></entry></row>
2866
2867 <row>
2852 <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant>&nbsp;</entry> 2868 <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant>&nbsp;</entry>
2853 <entry>integer</entry> 2869 <entry>integer</entry>
2854 </row><row><entry spanname="descr">This control turns the 2870 </row><row><entry spanname="descr">This control turns the
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index fdcb9e21d9d3..5bfef90e88ee 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -604,6 +604,7 @@ const char *v4l2_ctrl_get_name(u32 id)
604 case V4L2_CID_PRIVACY: return "Privacy"; 604 case V4L2_CID_PRIVACY: return "Privacy";
605 case V4L2_CID_IRIS_ABSOLUTE: return "Iris, Absolute"; 605 case V4L2_CID_IRIS_ABSOLUTE: return "Iris, Absolute";
606 case V4L2_CID_IRIS_RELATIVE: return "Iris, Relative"; 606 case V4L2_CID_IRIS_RELATIVE: return "Iris, Relative";
607 case V4L2_CID_AUTO_EXPOSURE_BIAS: return "Auto Exposure, Bias";
607 608
608 /* FM Radio Modulator control */ 609 /* FM Radio Modulator control */
609 /* Keep the order of the 'case's the same as in videodev2.h! */ 610 /* Keep the order of the 'case's the same as in videodev2.h! */
@@ -760,6 +761,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
760 case V4L2_CID_RDS_TX_RADIO_TEXT: 761 case V4L2_CID_RDS_TX_RADIO_TEXT:
761 *type = V4L2_CTRL_TYPE_STRING; 762 *type = V4L2_CTRL_TYPE_STRING;
762 break; 763 break;
764 case V4L2_CID_AUTO_EXPOSURE_BIAS:
765 *type = V4L2_CTRL_TYPE_INTEGER_MENU;
766 break;
763 case V4L2_CID_USER_CLASS: 767 case V4L2_CID_USER_CLASS:
764 case V4L2_CID_CAMERA_CLASS: 768 case V4L2_CID_CAMERA_CLASS:
765 case V4L2_CID_MPEG_CLASS: 769 case V4L2_CID_MPEG_CLASS:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 07bce86f3548..dfd209816df6 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1707,6 +1707,8 @@ enum v4l2_exposure_auto_type {
1707#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17) 1707#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
1708#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18) 1708#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
1709 1709
1710#define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
1711
1710/* FM Modulator class control IDs */ 1712/* FM Modulator class control IDs */
1711#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) 1713#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
1712#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) 1714#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)