From: Jean-François Moine Date: Mon, 13 Sep 2010 10:04:49 +0000 (-0300) Subject: V4L/DVB: v4l2: Add illuminator controls X-Git-Tag: MMI-PSA29.97-13-9~21911^2~434 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=008d35f2f5256751a18f1f4aea79e3caf140098d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Andy Walls Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- 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 @@ -311,11 +311,18 @@ minimum value disables backlight compensation. bits 8-15 Green color information, bits 16-23 Blue color information and bits 24-31 must be zero. + + V4L2_CID_ILLUMINATORS_1 + V4L2_CID_ILLUMINATORS_2 + boolean + Switch on or off the illuminator 1 or 2 of the device + (usually a microscope). + V4L2_CID_LASTP1 End of the predefined control IDs (currently -V4L2_CID_BG_COLOR + 1). +V4L2_CID_ILLUMINATORS_2 + 1). V4L2_CID_PRIVATE_BASE 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) 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; 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 { #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)