public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] LED control
@ 2009-03-14 11:59 Jean-Francois Moine
  2009-03-14 12:17 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 20+ messages in thread
From: Jean-Francois Moine @ 2009-03-14 11:59 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

Some webcams have one or many lights (LED). This patch makes them
controlable by the applications.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

[-- Attachment #2: led.pat --]
[-- Type: application/octet-stream, Size: 1252 bytes --]

diff -r 1248509d8bed linux/include/linux/videodev2.h
--- a/linux/include/linux/videodev2.h	Sat Mar 14 08:44:42 2009 +0100
+++ b/linux/include/linux/videodev2.h	Sat Mar 14 12:53:00 2009 +0100
@@ -887,9 +887,10 @@
 	V4L2_COLORFX_BW		= 1,
 	V4L2_COLORFX_SEPIA	= 2,
 };
+#define V4L2_CID_LEDS				(V4L2_CID_BASE+32)
 
 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+32)
+#define V4L2_CID_LASTP1				(V4L2_CID_BASE+33)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)
diff -r 1248509d8bed v4l2-spec/controls.sgml
--- a/v4l2-spec/controls.sgml	Sat Mar 14 08:44:42 2009 +0100
+++ b/v4l2-spec/controls.sgml	Sat Mar 14 12:53:00 2009 +0100
@@ -281,6 +281,13 @@
 <constant>V4L2_COLORFX_SEPIA</constant> (2).</entry>
 	  </row>
 	  <row>
+	    <entry><constant>V4L2_CID_LEDS</constant></entry>
+	    <entry>integer</entry>
+	    <entry>Switch on or off the LEDs or illuminators of the device.
+In the control value, each LED may be coded in one bit (0: off, 1: on) or in
+many bits (light intensity).</entry>
+	  </row>
+	  <row>
 	    <entry><constant>V4L2_CID_LASTP1</constant></entry>
 	    <entry></entry>
 	    <entry>End of the predefined control IDs (currently

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH] LED control
@ 2010-09-04 11:10 Jean-Francois Moine
  2010-09-04 19:50 ` Andy Walls
  2010-09-05  7:56 ` Hans de Goede
  0 siblings, 2 replies; 20+ messages in thread
From: Jean-Francois Moine @ 2010-09-04 11:10 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

Some media devices may have one or many lights (LEDs, illuminators,
lamps..). This patch makes them controlable by the applications.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

[-- Attachment #2: led.patch --]
[-- Type: text/x-patch, Size: 1421 bytes --]

diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 8408caa..c9b8ca5 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -312,6 +312,13 @@ minimum value disables backlight compensation.</entry>
 	    information and bits 24-31 must be zero.</entry>
 	  </row>
 	  <row>
+	    <entry><constant>V4L2_CID_LEDS</constant></entry>
+	    <entry>integer</entry>
+	    <entry>Switch on or off the LED(s) or illuminator(s) of the device.
+	    The control type and values depend on the driver and may be either
+	    a single boolean (0: off, 1:on) or the index in a menu type.</entry>
+	  </row>
+	  <row>
 	    <entry><constant>V4L2_CID_LASTP1</constant></entry>
 	    <entry></entry>
 	    <entry>End of the predefined control IDs (currently
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61490c6..3807492 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1045,8 +1045,10 @@ enum v4l2_colorfx {
 
 #define V4L2_CID_CHROMA_GAIN                    (V4L2_CID_BASE+36)
 
+#define V4L2_CID_LEDS				(V4L2_CID_BASE+37)
+
 /* last CID + 1 */
-#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+37)
+#define V4L2_CID_LASTP1                         (V4L2_CID_BASE+38)
 
 /*  MPEG-class control IDs defined by V4L2 */
 #define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2010-09-13  6:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-14 11:59 [PATCH] LED control Jean-Francois Moine
2009-03-14 12:17 ` Mauro Carvalho Chehab
2009-03-14 13:25   ` Jean-Francois Moine
2009-03-14 13:58   ` Andy Walls
2009-03-14 20:16   ` Trent Piepho
2009-03-15  9:50     ` Jean-Francois Moine
2009-03-15 10:16       ` Laurent Pinchart
2009-03-15 15:14       ` Trent Piepho
2009-03-17  8:28         ` Jean-Francois Moine
  -- strict thread matches above, loose matches on Subject: below --
2010-09-04 11:10 Jean-Francois Moine
2010-09-04 19:50 ` Andy Walls
2010-09-05  7:56 ` Hans de Goede
2010-09-05  8:04   ` Peter Korsgaard
2010-09-05  8:19     ` Hans de Goede
2010-09-05 18:23     ` Andy Walls
2010-09-05  8:56   ` Jean-Francois Moine
2010-09-05 13:54     ` Hans de Goede
2010-09-05 18:43       ` Andy Walls
2010-09-05 19:34         ` Hans de Goede
2010-09-13  6:43         ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox