aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-09-13 06:04:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:05:54 -0400
commit008d35f2f5256751a18f1f4aea79e3caf140098d (patch)
treedb88373c477e246846349e5ac6b79050edf6c28e
parent2a3b501ffd28b2be355f558479543028ccdead48 (diff)
V4L/DVB: v4l2: Add illuminator controls
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>
-rw-r--r--Documentation/DocBook/v4l/controls.xml9
-rw-r--r--drivers/media/video/v4l2-ctrls.c4
-rw-r--r--include/linux/videodev2.h5
3 files changed, 16 insertions, 2 deletions
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caaee276..68c83449d7c9 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry>
312 information and bits 24-31 must be zero.</entry> 312 information and bits 24-31 must be zero.</entry>
313 </row> 313 </row>
314 <row> 314 <row>
315 <entry><constant>V4L2_CID_ILLUMINATORS_1</constant>
316 <constant>V4L2_CID_ILLUMINATORS_2</constant></entry>
317 <entry>boolean</entry>
318 <entry>Switch on or off the illuminator 1 or 2 of the device
319 (usually a microscope).</entry>
320 </row>
321 <row>
315 <entry><constant>V4L2_CID_LASTP1</constant></entry> 322 <entry><constant>V4L2_CID_LASTP1</constant></entry>
316 <entry></entry> 323 <entry></entry>
317 <entry>End of the predefined control IDs (currently 324 <entry>End of the predefined control IDs (currently
318<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry> 325<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry>
319 </row> 326 </row>
320 <row> 327 <row>
321 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> 328 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index ea8d32cd425d..9d2502cd03ff 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -305,6 +305,8 @@ const char *v4l2_ctrl_get_name(u32 id)
305 case V4L2_CID_ROTATE: return "Rotate"; 305 case V4L2_CID_ROTATE: return "Rotate";
306 case V4L2_CID_BG_COLOR: return "Background Color"; 306 case V4L2_CID_BG_COLOR: return "Background Color";
307 case V4L2_CID_CHROMA_GAIN: return "Chroma Gain"; 307 case V4L2_CID_CHROMA_GAIN: return "Chroma Gain";
308 case V4L2_CID_ILLUMINATORS_1: return "Illuminator 1";
309 case V4L2_CID_ILLUMINATORS_2: return "Illuminator 2";
308 310
309 /* MPEG controls */ 311 /* MPEG controls */
310 /* Keep the order of the 'case's the same as in videodev2.h! */ 312 /* 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,
419 case V4L2_CID_AUDIO_LIMITER_ENABLED: 421 case V4L2_CID_AUDIO_LIMITER_ENABLED:
420 case V4L2_CID_AUDIO_COMPRESSION_ENABLED: 422 case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
421 case V4L2_CID_PILOT_TONE_ENABLED: 423 case V4L2_CID_PILOT_TONE_ENABLED:
424 case V4L2_CID_ILLUMINATORS_1:
425 case V4L2_CID_ILLUMINATORS_2:
422 *type = V4L2_CTRL_TYPE_BOOLEAN; 426 *type = V4L2_CTRL_TYPE_BOOLEAN;
423 *min = 0; 427 *min = 0;
424 *max = *step = 1; 428 *max = *step = 1;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 2d5ce17ca472..b06479f63271 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1047,8 +1047,11 @@ enum v4l2_colorfx {
1047 1047
1048#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) 1048#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1049 1049
1050#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1051#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1052
1050/* last CID + 1 */ 1053/* last CID + 1 */
1051#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) 1054#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39)
1052 1055
1053/* MPEG-class control IDs defined by V4L2 */ 1056/* MPEG-class control IDs defined by V4L2 */
1054#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1057#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)