V4L/DVB: v4l2: Add illuminator controls
authorJean-François Moine <moinejf@free.fr>
Mon, 13 Sep 2010 10:04:49 +0000 (07:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 03:05:54 +0000 (01:05 -0200)
Some media devices (microscopes) may have one or many illuminators.
This patch makes them controlable by the applications.

Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Documentation/DocBook/v4l/controls.xml
drivers/media/video/v4l2-ctrls.c
include/linux/videodev2.h

index 8408caa..68c8344 100644 (file)
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
            information and bits 24-31 must be zero.</entry>
          </row>
          <row>
+           <entry><constant>V4L2_CID_ILLUMINATORS_1</constant>
+               <constant>V4L2_CID_ILLUMINATORS_2</constant></entry>
+           <entry>boolean</entry>
+           <entry>Switch on or off the illuminator 1 or 2 of the device
+               (usually a microscope).</entry>
+         </row>
+         <row>
            <entry><constant>V4L2_CID_LASTP1</constant></entry>
            <entry></entry>
            <entry>End of the predefined control IDs (currently
-<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry>
+<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry>
          </row>
          <row>
            <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
index ea8d32c..9d2502c 100644 (file)
@@ -305,6 +305,8 @@ const char *v4l2_ctrl_get_name(u32 id)
        case V4L2_CID_ROTATE:                   return "Rotate";
        case V4L2_CID_BG_COLOR:                 return "Background Color";
        case V4L2_CID_CHROMA_GAIN:              return "Chroma Gain";
+       case V4L2_CID_ILLUMINATORS_1:           return "Illuminator 1";
+       case V4L2_CID_ILLUMINATORS_2:           return "Illuminator 2";
 
        /* MPEG controls */
        /* Keep the order of the 'case's the same as in videodev2.h! */
@@ -419,6 +421,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
        case V4L2_CID_AUDIO_LIMITER_ENABLED:
        case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
        case V4L2_CID_PILOT_TONE_ENABLED:
+       case V4L2_CID_ILLUMINATORS_1:
+       case V4L2_CID_ILLUMINATORS_2:
                *type = V4L2_CTRL_TYPE_BOOLEAN;
                *min = 0;
                *max = *step = 1;
index 2d5ce17..b06479f 100644 (file)
@@ -1047,8 +1047,11 @@ enum v4l2_colorfx {
 
 #define V4L2_CID_CHROMA_GAIN                    (V4L2_CID_BASE+36)
 
+#define V4L2_CID_ILLUMINATORS_1                        (V4L2_CID_BASE+37)
+#define V4L2_CID_ILLUMINATORS_2                        (V4L2_CID_BASE+38)
+
 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+37)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+39)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE                     (V4L2_CTRL_CLASS_MPEG | 0x900)