diff options
-rw-r--r-- | Documentation/DocBook/media/v4l/compat.xml | 19 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/controls.xml | 98 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/v4l2.xml | 9 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ctrls.c | 20 | ||||
-rw-r--r-- | include/linux/videodev2.h | 16 |
5 files changed, 158 insertions, 4 deletions
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index 149f65dfaa72..dc61b013b8a8 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml | |||
@@ -2435,6 +2435,21 @@ details.</para> | |||
2435 | <listitem> | 2435 | <listitem> |
2436 | <para> Added <constant>V4L2_CID_COLORFX_CBCR</constant> control.</para> | 2436 | <para> Added <constant>V4L2_CID_COLORFX_CBCR</constant> control.</para> |
2437 | </listitem> | 2437 | </listitem> |
2438 | <listitem> | ||
2439 | <para> Added camera controls <constant>V4L2_CID_AUTO_EXPOSURE_BIAS</constant>, | ||
2440 | <constant>V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE</constant>, | ||
2441 | <constant>V4L2_CID_IMAGE_STABILIZATION</constant>, | ||
2442 | <constant>V4L2_CID_ISO_SENSITIVITY</constant>, | ||
2443 | <constant>V4L2_CID_ISO_SENSITIVITY_AUTO</constant>, | ||
2444 | <constant>V4L2_CID_EXPOSURE_METERING</constant>, | ||
2445 | <constant>V4L2_CID_SCENE_MODE</constant>, | ||
2446 | <constant>V4L2_CID_3A_LOCK</constant>, | ||
2447 | <constant>V4L2_CID_AUTO_FOCUS_START</constant>, | ||
2448 | <constant>V4L2_CID_AUTO_FOCUS_STOP</constant>, | ||
2449 | <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant> and | ||
2450 | <constant>V4L2_CID_AUTO_FOCUS_RANGE</constant>. | ||
2451 | </para> | ||
2452 | </listitem> | ||
2438 | </orderedlist> | 2453 | </orderedlist> |
2439 | </section> | 2454 | </section> |
2440 | 2455 | ||
@@ -2555,6 +2570,10 @@ ioctls.</para> | |||
2555 | <para>Sub-device selection API: &VIDIOC-SUBDEV-G-SELECTION; | 2570 | <para>Sub-device selection API: &VIDIOC-SUBDEV-G-SELECTION; |
2556 | and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para> | 2571 | and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para> |
2557 | </listitem> | 2572 | </listitem> |
2573 | <listitem> | ||
2574 | <para><link linkend="v4l2-auto-focus-area"><constant> | ||
2575 | V4L2_CID_AUTO_FOCUS_AREA</constant></link> control.</para> | ||
2576 | </listitem> | ||
2558 | </itemizedlist> | 2577 | </itemizedlist> |
2559 | </section> | 2578 | </section> |
2560 | 2579 | ||
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index f38f06169795..132b0cc29832 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml | |||
@@ -2976,13 +2976,107 @@ negative values towards infinity. This is a write-only control.</entry> | |||
2976 | <row> | 2976 | <row> |
2977 | <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO</constant> </entry> | 2977 | <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO</constant> </entry> |
2978 | <entry>boolean</entry> | 2978 | <entry>boolean</entry> |
2979 | </row><row><entry spanname="descr">Enables automatic focus | 2979 | </row><row><entry spanname="descr">Enables continuous automatic |
2980 | adjustments. The effect of manual focus adjustments while this feature | 2980 | focus adjustments. The effect of manual focus adjustments while this feature |
2981 | is enabled is undefined, drivers should ignore such requests.</entry> | 2981 | is enabled is undefined, drivers should ignore such requests.</entry> |
2982 | </row> | 2982 | </row> |
2983 | <row><entry></entry></row> | 2983 | <row><entry></entry></row> |
2984 | 2984 | ||
2985 | <row> | 2985 | <row> |
2986 | <entry spanname="id"><constant>V4L2_CID_AUTO_FOCUS_START</constant> </entry> | ||
2987 | <entry>button</entry> | ||
2988 | </row><row><entry spanname="descr">Starts single auto focus process. | ||
2989 | The effect of setting this control when <constant>V4L2_CID_FOCUS_AUTO</constant> | ||
2990 | is set to <constant>TRUE</constant> (1) is undefined, drivers should ignore | ||
2991 | such requests.</entry> | ||
2992 | </row> | ||
2993 | <row><entry></entry></row> | ||
2994 | |||
2995 | <row> | ||
2996 | <entry spanname="id"><constant>V4L2_CID_AUTO_FOCUS_STOP</constant> </entry> | ||
2997 | <entry>button</entry> | ||
2998 | </row><row><entry spanname="descr">Aborts automatic focusing | ||
2999 | started with <constant>V4L2_CID_AUTO_FOCUS_START</constant> control. It is | ||
3000 | effective only when the continuous autofocus is disabled, that is when | ||
3001 | <constant>V4L2_CID_FOCUS_AUTO</constant> control is set to <constant>FALSE | ||
3002 | </constant> (0).</entry> | ||
3003 | </row> | ||
3004 | <row><entry></entry></row> | ||
3005 | |||
3006 | <row id="v4l2-auto-focus-status"> | ||
3007 | <entry spanname="id"> | ||
3008 | <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant> </entry> | ||
3009 | <entry>bitmask</entry> | ||
3010 | </row> | ||
3011 | <row><entry spanname="descr">The automatic focus status. This is a read-only | ||
3012 | control.</entry> | ||
3013 | </row> | ||
3014 | <row> | ||
3015 | <entrytbl spanname="descr" cols="2"> | ||
3016 | <tbody valign="top"> | ||
3017 | <row> | ||
3018 | <entry><constant>V4L2_AUTO_FOCUS_STATUS_IDLE</constant> </entry> | ||
3019 | <entry>Automatic focus is not active.</entry> | ||
3020 | </row> | ||
3021 | <row> | ||
3022 | <entry><constant>V4L2_AUTO_FOCUS_STATUS_BUSY</constant> </entry> | ||
3023 | <entry>Automatic focusing is in progress.</entry> | ||
3024 | </row> | ||
3025 | <row> | ||
3026 | <entry><constant>V4L2_AUTO_FOCUS_STATUS_REACHED</constant> </entry> | ||
3027 | <entry>Focus has been reached.</entry> | ||
3028 | </row> | ||
3029 | <row> | ||
3030 | <entry><constant>V4L2_AUTO_FOCUS_STATUS_FAILED</constant> </entry> | ||
3031 | <entry>Automatic focus has failed, the driver will not | ||
3032 | transition from this state until another action is | ||
3033 | performed by an application.</entry> | ||
3034 | </row> | ||
3035 | </tbody> | ||
3036 | </entrytbl> | ||
3037 | </row> | ||
3038 | <row><entry spanname="descr"> | ||
3039 | Setting <constant>V4L2_LOCK_FOCUS</constant> lock bit of the <constant>V4L2_CID_3A_LOCK | ||
3040 | </constant> control may stop updates of the <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant> | ||
3041 | control value.</entry> | ||
3042 | </row> | ||
3043 | <row><entry></entry></row> | ||
3044 | |||
3045 | <row id="v4l2-auto-focus-range"> | ||
3046 | <entry spanname="id"> | ||
3047 | <constant>V4L2_CID_AUTO_FOCUS_RANGE</constant> </entry> | ||
3048 | <entry>enum v4l2_auto_focus_range</entry> | ||
3049 | </row> | ||
3050 | <row><entry spanname="descr">Determines auto focus distance range | ||
3051 | for which lens may be adjusted. </entry> | ||
3052 | </row> | ||
3053 | <row> | ||
3054 | <entrytbl spanname="descr" cols="2"> | ||
3055 | <tbody valign="top"> | ||
3056 | <row> | ||
3057 | <entry><constant>V4L2_AUTO_FOCUS_RANGE_AUTO</constant> </entry> | ||
3058 | <entry>The camera automatically selects the focus range.</entry> | ||
3059 | </row> | ||
3060 | <row> | ||
3061 | <entry><constant>V4L2_AUTO_FOCUS_RANGE_NORMAL</constant> </entry> | ||
3062 | <entry>Normal distance range, limited for best automatic focus | ||
3063 | performance.</entry> | ||
3064 | </row> | ||
3065 | <row> | ||
3066 | <entry><constant>V4L2_AUTO_FOCUS_RANGE_MACRO</constant> </entry> | ||
3067 | <entry>Macro (close-up) auto focus. The camera will | ||
3068 | use its minimum possible distance for auto focus.</entry> | ||
3069 | </row> | ||
3070 | <row> | ||
3071 | <entry><constant>V4L2_AUTO_FOCUS_RANGE_INFINITY</constant> </entry> | ||
3072 | <entry>The lens is set to focus on an object at infinite distance.</entry> | ||
3073 | </row> | ||
3074 | </tbody> | ||
3075 | </entrytbl> | ||
3076 | </row> | ||
3077 | <row><entry></entry></row> | ||
3078 | |||
3079 | <row> | ||
2986 | <entry spanname="id"><constant>V4L2_CID_ZOOM_ABSOLUTE</constant> </entry> | 3080 | <entry spanname="id"><constant>V4L2_CID_ZOOM_ABSOLUTE</constant> </entry> |
2987 | <entry>integer</entry> | 3081 | <entry>integer</entry> |
2988 | </row><row><entry spanname="descr">Specify the objective lens | 3082 | </row><row><entry spanname="descr">Specify the objective lens |
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index 63242e2adc02..e6fbbc6c17e1 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml | |||
@@ -140,11 +140,18 @@ applications. --> | |||
140 | 140 | ||
141 | <revision> | 141 | <revision> |
142 | <revnumber>3.5</revnumber> | 142 | <revnumber>3.5</revnumber> |
143 | <date>2012-04-02</date> | 143 | <date>2012-05-07</date> |
144 | <authorinitials>sa, sn</authorinitials> | 144 | <authorinitials>sa, sn</authorinitials> |
145 | <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev | 145 | <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev |
146 | selections API. Improved the description of V4L2_CID_COLORFX | 146 | selections API. Improved the description of V4L2_CID_COLORFX |
147 | control, added V4L2_CID_COLORFX_CBCR control. | 147 | control, added V4L2_CID_COLORFX_CBCR control. |
148 | Added camera controls V4L2_CID_AUTO_EXPOSURE_BIAS, | ||
149 | V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, V4L2_CID_IMAGE_STABILIZATION, | ||
150 | V4L2_CID_ISO_SENSITIVITY, V4L2_CID_ISO_SENSITIVITY_AUTO, | ||
151 | V4L2_CID_EXPOSURE_METERING, V4L2_CID_SCENE_MODE, | ||
152 | V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START, | ||
153 | V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS | ||
154 | and V4L2_CID_AUTO_FOCUS_RANGE. | ||
148 | </revremark> | 155 | </revremark> |
149 | </revision> | 156 | </revision> |
150 | 157 | ||
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index a47b29270ba3..a5fbace4c059 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c | |||
@@ -236,6 +236,13 @@ const char * const *v4l2_ctrl_get_menu(u32 id) | |||
236 | "Spot", | 236 | "Spot", |
237 | NULL | 237 | NULL |
238 | }; | 238 | }; |
239 | static const char * const camera_auto_focus_range[] = { | ||
240 | "Auto", | ||
241 | "Normal", | ||
242 | "Macro", | ||
243 | "Infinity", | ||
244 | NULL | ||
245 | }; | ||
239 | static const char * const colorfx[] = { | 246 | static const char * const colorfx[] = { |
240 | "None", | 247 | "None", |
241 | "Black & White", | 248 | "Black & White", |
@@ -459,6 +466,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) | |||
459 | return camera_exposure_auto; | 466 | return camera_exposure_auto; |
460 | case V4L2_CID_EXPOSURE_METERING: | 467 | case V4L2_CID_EXPOSURE_METERING: |
461 | return camera_exposure_metering; | 468 | return camera_exposure_metering; |
469 | case V4L2_CID_AUTO_FOCUS_RANGE: | ||
470 | return camera_auto_focus_range; | ||
462 | case V4L2_CID_COLORFX: | 471 | case V4L2_CID_COLORFX: |
463 | return colorfx; | 472 | return colorfx; |
464 | case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: | 473 | case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: |
@@ -646,7 +655,7 @@ const char *v4l2_ctrl_get_name(u32 id) | |||
646 | case V4L2_CID_TILT_ABSOLUTE: return "Tilt, Absolute"; | 655 | case V4L2_CID_TILT_ABSOLUTE: return "Tilt, Absolute"; |
647 | case V4L2_CID_FOCUS_ABSOLUTE: return "Focus, Absolute"; | 656 | case V4L2_CID_FOCUS_ABSOLUTE: return "Focus, Absolute"; |
648 | case V4L2_CID_FOCUS_RELATIVE: return "Focus, Relative"; | 657 | case V4L2_CID_FOCUS_RELATIVE: return "Focus, Relative"; |
649 | case V4L2_CID_FOCUS_AUTO: return "Focus, Automatic"; | 658 | case V4L2_CID_FOCUS_AUTO: return "Focus, Automatic Continuous"; |
650 | case V4L2_CID_ZOOM_ABSOLUTE: return "Zoom, Absolute"; | 659 | case V4L2_CID_ZOOM_ABSOLUTE: return "Zoom, Absolute"; |
651 | case V4L2_CID_ZOOM_RELATIVE: return "Zoom, Relative"; | 660 | case V4L2_CID_ZOOM_RELATIVE: return "Zoom, Relative"; |
652 | case V4L2_CID_ZOOM_CONTINUOUS: return "Zoom, Continuous"; | 661 | case V4L2_CID_ZOOM_CONTINUOUS: return "Zoom, Continuous"; |
@@ -662,6 +671,10 @@ const char *v4l2_ctrl_get_name(u32 id) | |||
662 | case V4L2_CID_EXPOSURE_METERING: return "Exposure, Metering Mode"; | 671 | case V4L2_CID_EXPOSURE_METERING: return "Exposure, Metering Mode"; |
663 | case V4L2_CID_SCENE_MODE: return "Scene Mode"; | 672 | case V4L2_CID_SCENE_MODE: return "Scene Mode"; |
664 | case V4L2_CID_3A_LOCK: return "3A Lock"; | 673 | case V4L2_CID_3A_LOCK: return "3A Lock"; |
674 | case V4L2_CID_AUTO_FOCUS_START: return "Auto Focus, Start"; | ||
675 | case V4L2_CID_AUTO_FOCUS_STOP: return "Auto Focus, Stop"; | ||
676 | case V4L2_CID_AUTO_FOCUS_STATUS: return "Auto Focus, Status"; | ||
677 | case V4L2_CID_AUTO_FOCUS_RANGE: return "Auto Focus, Range"; | ||
665 | 678 | ||
666 | /* FM Radio Modulator control */ | 679 | /* FM Radio Modulator control */ |
667 | /* Keep the order of the 'case's the same as in videodev2.h! */ | 680 | /* Keep the order of the 'case's the same as in videodev2.h! */ |
@@ -774,6 +787,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
774 | case V4L2_CID_TILT_RESET: | 787 | case V4L2_CID_TILT_RESET: |
775 | case V4L2_CID_FLASH_STROBE: | 788 | case V4L2_CID_FLASH_STROBE: |
776 | case V4L2_CID_FLASH_STROBE_STOP: | 789 | case V4L2_CID_FLASH_STROBE_STOP: |
790 | case V4L2_CID_AUTO_FOCUS_START: | ||
791 | case V4L2_CID_AUTO_FOCUS_STOP: | ||
777 | *type = V4L2_CTRL_TYPE_BUTTON; | 792 | *type = V4L2_CTRL_TYPE_BUTTON; |
778 | *flags |= V4L2_CTRL_FLAG_WRITE_ONLY; | 793 | *flags |= V4L2_CTRL_FLAG_WRITE_ONLY; |
779 | *min = *max = *step = *def = 0; | 794 | *min = *max = *step = *def = 0; |
@@ -797,6 +812,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
797 | case V4L2_CID_MPEG_STREAM_TYPE: | 812 | case V4L2_CID_MPEG_STREAM_TYPE: |
798 | case V4L2_CID_MPEG_STREAM_VBI_FMT: | 813 | case V4L2_CID_MPEG_STREAM_VBI_FMT: |
799 | case V4L2_CID_EXPOSURE_AUTO: | 814 | case V4L2_CID_EXPOSURE_AUTO: |
815 | case V4L2_CID_AUTO_FOCUS_RANGE: | ||
800 | case V4L2_CID_COLORFX: | 816 | case V4L2_CID_COLORFX: |
801 | case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: | 817 | case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: |
802 | case V4L2_CID_TUNE_PREEMPHASIS: | 818 | case V4L2_CID_TUNE_PREEMPHASIS: |
@@ -851,6 +867,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
851 | case V4L2_CID_FLASH_FAULT: | 867 | case V4L2_CID_FLASH_FAULT: |
852 | case V4L2_CID_JPEG_ACTIVE_MARKER: | 868 | case V4L2_CID_JPEG_ACTIVE_MARKER: |
853 | case V4L2_CID_3A_LOCK: | 869 | case V4L2_CID_3A_LOCK: |
870 | case V4L2_CID_AUTO_FOCUS_STATUS: | ||
854 | *type = V4L2_CTRL_TYPE_BITMASK; | 871 | *type = V4L2_CTRL_TYPE_BITMASK; |
855 | break; | 872 | break; |
856 | case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: | 873 | case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: |
@@ -913,6 +930,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
913 | *flags |= V4L2_CTRL_FLAG_WRITE_ONLY; | 930 | *flags |= V4L2_CTRL_FLAG_WRITE_ONLY; |
914 | break; | 931 | break; |
915 | case V4L2_CID_FLASH_STROBE_STATUS: | 932 | case V4L2_CID_FLASH_STROBE_STATUS: |
933 | case V4L2_CID_AUTO_FOCUS_STATUS: | ||
916 | case V4L2_CID_FLASH_READY: | 934 | case V4L2_CID_FLASH_READY: |
917 | *flags |= V4L2_CTRL_FLAG_READ_ONLY; | 935 | *flags |= V4L2_CTRL_FLAG_READ_ONLY; |
918 | break; | 936 | break; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index a9b03ae44037..dc3e3ea28f99 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1763,6 +1763,22 @@ enum v4l2_scene_mode { | |||
1763 | #define V4L2_LOCK_WHITE_BALANCE (1 << 1) | 1763 | #define V4L2_LOCK_WHITE_BALANCE (1 << 1) |
1764 | #define V4L2_LOCK_FOCUS (1 << 2) | 1764 | #define V4L2_LOCK_FOCUS (1 << 2) |
1765 | 1765 | ||
1766 | #define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28) | ||
1767 | #define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29) | ||
1768 | #define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30) | ||
1769 | #define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0) | ||
1770 | #define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0) | ||
1771 | #define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1) | ||
1772 | #define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2) | ||
1773 | |||
1774 | #define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31) | ||
1775 | enum v4l2_auto_focus_range { | ||
1776 | V4L2_AUTO_FOCUS_RANGE_AUTO = 0, | ||
1777 | V4L2_AUTO_FOCUS_RANGE_NORMAL = 1, | ||
1778 | V4L2_AUTO_FOCUS_RANGE_MACRO = 2, | ||
1779 | V4L2_AUTO_FOCUS_RANGE_INFINITY = 3, | ||
1780 | }; | ||
1781 | |||
1766 | /* FM Modulator class control IDs */ | 1782 | /* FM Modulator class control IDs */ |
1767 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) | 1783 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) |
1768 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) | 1784 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) |