aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-05-02 05:24:33 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 13:29:35 -0400
commitfc162a099e7b34bfe3501028c919ff5d43e5e3d3 (patch)
treeed3e60fe068ad65c5a8846c110852d86582095f8
parent0bf6b7dc5fd1e60e93657d4fe4b3d788216b9d5e (diff)
[media] V4L: Add camera 3A lock control
The V4L2_CID_3A_LOCK bitmask control allows applications to pause or resume the automatic exposure, focus and wite balance adjustments. It can be used, for example, to lock the 3A adjustments right before a still image is captured, for pre-focus, etc. The applications can control each of the algorithms independently, through a corresponding control bit, if driver allows that. 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.xml39
-rw-r--r--drivers/media/video/v4l2-ctrls.c2
-rw-r--r--include/linux/videodev2.h5
3 files changed, 46 insertions, 0 deletions
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index ad0d53d3ffdd..f38f06169795 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -3301,6 +3301,45 @@ lens-distortion correction.</entry>
3301 </row> 3301 </row>
3302 <row><entry></entry></row> 3302 <row><entry></entry></row>
3303 3303
3304 <row>
3305 <entry spanname="id"><constant>V4L2_CID_3A_LOCK</constant></entry>
3306 <entry>bitmask</entry>
3307 </row>
3308 <row>
3309 <entry spanname="descr">This control locks or unlocks the automatic
3310focus, exposure and white balance. The automatic adjustments can be paused
3311independently by setting the corresponding lock bit to 1. The camera then retains
3312the settings until the lock bit is cleared. The following lock bits are defined:
3313</entry>
3314 </row>
3315 <row>
3316 <entrytbl spanname="descr" cols="2">
3317 <tbody valign="top">
3318 <row>
3319 <entry><constant>V4L2_LOCK_EXPOSURE</constant></entry>
3320 <entry>Automatic exposure adjustments lock.</entry>
3321 </row>
3322 <row>
3323 <entry><constant>V4L2_LOCK_WHITE_BALANCE</constant></entry>
3324 <entry>Automatic white balance adjustments lock.</entry>
3325 </row>
3326 <row>
3327 <entry><constant>V4L2_LOCK_FOCUS</constant></entry>
3328 <entry>Automatic focus lock.</entry>
3329 </row>
3330 </tbody>
3331 </entrytbl>
3332 </row>
3333 <row><entry spanname="descr">
3334When a given algorithm is not enabled, drivers should ignore requests
3335to lock it and should return no error. An example might be an application
3336setting bit <constant>V4L2_LOCK_WHITE_BALANCE</constant> when the
3337<constant>V4L2_CID_AUTO_WHITE_BALANCE</constant> control is set to
3338<constant>FALSE</constant>. The value of this control may be changed
3339by exposure, white balance or focus controls.</entry>
3340 </row>
3341 <row><entry></entry></row>
3342
3304 </tbody> 3343 </tbody>
3305 </tgroup> 3344 </tgroup>
3306 </table> 3345 </table>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index d4dc8ba7b755..a47b29270ba3 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -661,6 +661,7 @@ const char *v4l2_ctrl_get_name(u32 id)
661 case V4L2_CID_ISO_SENSITIVITY_AUTO: return "ISO Sensitivity, Auto"; 661 case V4L2_CID_ISO_SENSITIVITY_AUTO: return "ISO Sensitivity, Auto";
662 case V4L2_CID_EXPOSURE_METERING: return "Exposure, Metering Mode"; 662 case V4L2_CID_EXPOSURE_METERING: return "Exposure, Metering Mode";
663 case V4L2_CID_SCENE_MODE: return "Scene Mode"; 663 case V4L2_CID_SCENE_MODE: return "Scene Mode";
664 case V4L2_CID_3A_LOCK: return "3A Lock";
664 665
665 /* FM Radio Modulator control */ 666 /* FM Radio Modulator control */
666 /* Keep the order of the 'case's the same as in videodev2.h! */ 667 /* Keep the order of the 'case's the same as in videodev2.h! */
@@ -849,6 +850,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
849 break; 850 break;
850 case V4L2_CID_FLASH_FAULT: 851 case V4L2_CID_FLASH_FAULT:
851 case V4L2_CID_JPEG_ACTIVE_MARKER: 852 case V4L2_CID_JPEG_ACTIVE_MARKER:
853 case V4L2_CID_3A_LOCK:
852 *type = V4L2_CTRL_TYPE_BITMASK; 854 *type = V4L2_CTRL_TYPE_BITMASK;
853 break; 855 break;
854 case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: 856 case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 092bf5aaf348..a9b03ae44037 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1758,6 +1758,11 @@ enum v4l2_scene_mode {
1758 V4L2_SCENE_MODE_TEXT = 13, 1758 V4L2_SCENE_MODE_TEXT = 13,
1759}; 1759};
1760 1760
1761#define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
1762#define V4L2_LOCK_EXPOSURE (1 << 0)
1763#define V4L2_LOCK_WHITE_BALANCE (1 << 1)
1764#define V4L2_LOCK_FOCUS (1 << 2)
1765
1761/* FM Modulator class control IDs */ 1766/* FM Modulator class control IDs */
1762#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) 1767#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
1763#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) 1768#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)