From patchwork Sun Feb 28 07:55:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOpbWV0aCBNw6FydG9u?= X-Patchwork-Id: 2855 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 28 Feb 2010 07:55:11 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Sun, 28 Feb 2010 10:35:25 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Nldzb-000619-6l; Sun, 28 Feb 2010 07:55:11 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031472Ab0B1HzJ (ORCPT + 1 other); Sun, 28 Feb 2010 02:55:09 -0500 Received: from relay01.digicable.hu ([92.249.128.189]:58529 "EHLO relay01.digicable.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031462Ab0B1HzI (ORCPT ); Sun, 28 Feb 2010 02:55:08 -0500 Received: from [94.21.195.14] by relay01.digicable.hu with esmtpa id 1NldzW-0001nG-Ai ; Sun, 28 Feb 2010 08:55:06 +0100 Message-ID: <4B8A2158.6020701@freemail.hu> Date: Sun, 28 Feb 2010 08:55:04 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Hans de Goede , Jean-Francois Moine CC: V4L Mailing List Subject: [PATCH 1/3] add feedback LED control X-Original: 94.21.195.14 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Márton Németh On some webcams a feedback LED can be found. This LED usually shows the state of streaming mode: this is the "Auto" mode. The LED can be programmed to constantly switched off state (e.g. for power saving reasons, preview mode) or on state (e.g. the application shows motion detection or "on-air"). Signed-off-by: Márton Németh --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r d8fafa7d88dc linux/Documentation/DocBook/v4l/controls.xml --- a/linux/Documentation/DocBook/v4l/controls.xml Thu Feb 18 19:02:51 2010 +0100 +++ b/linux/Documentation/DocBook/v4l/controls.xml Sun Feb 28 08:41:17 2010 +0100 @@ -311,6 +311,17 @@ Applications depending on particular custom controls should check the driver name and version, see . + + V4L2_CID_LED + enum + Controls the feedback LED on the camera. In auto mode +the LED is on when the streaming is active. The LED is off when not streaming. +The LED can be also turned on and off independent from streaming. +Possible values for enum v4l2_led are: +V4L2_CID_LED_AUTO (0), +V4L2_CID_LED_ON (1) and +V4L2_CID_LED_OFF (2). + diff -r d8fafa7d88dc linux/Documentation/DocBook/v4l/videodev2.h.xml --- a/linux/Documentation/DocBook/v4l/videodev2.h.xml Thu Feb 18 19:02:51 2010 +0100 +++ b/linux/Documentation/DocBook/v4l/videodev2.h.xml Sun Feb 28 08:41:17 2010 +0100 @@ -1024,8 +1024,14 @@ #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) +#define V4L2_CID_LED (V4L2_CID_BASE+36) +enum v4l2_led { + V4L2_LED_AUTO = 0, + V4L2_LED_ON = 1, + V4L2_LED_OFF = 2, +}; /* last CID + 1 */ -#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) +#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) /* MPEG-class control IDs defined by V4L2 */ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) diff -r d8fafa7d88dc linux/drivers/media/video/v4l2-common.c --- a/linux/drivers/media/video/v4l2-common.c Thu Feb 18 19:02:51 2010 +0100 +++ b/linux/drivers/media/video/v4l2-common.c Sun Feb 28 08:41:17 2010 +0100 @@ -349,6 +349,12 @@ "75 useconds", NULL, }; + static const char *led[] = { + "Auto", + "On", + "Off", + NULL, + }; switch (id) { case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: @@ -389,6 +395,8 @@ return colorfx; case V4L2_CID_TUNE_PREEMPHASIS: return tune_preemphasis; + case V4L2_CID_LED: + return led; default: return NULL; } @@ -434,6 +442,7 @@ case V4L2_CID_COLORFX: return "Color Effects"; case V4L2_CID_ROTATE: return "Rotate"; case V4L2_CID_BG_COLOR: return "Background color"; + case V4L2_CID_LED: return "Feedback LED"; /* MPEG controls */ case V4L2_CID_MPEG_CLASS: return "MPEG Encoder Controls"; @@ -575,6 +584,7 @@ case V4L2_CID_EXPOSURE_AUTO: case V4L2_CID_COLORFX: case V4L2_CID_TUNE_PREEMPHASIS: + case V4L2_CID_LED: qctrl->type = V4L2_CTRL_TYPE_MENU; step = 1; break; diff -r d8fafa7d88dc linux/include/linux/videodev2.h --- a/linux/include/linux/videodev2.h Thu Feb 18 19:02:51 2010 +0100 +++ b/linux/include/linux/videodev2.h Sun Feb 28 08:41:17 2010 +0100 @@ -1030,8 +1030,14 @@ #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) +#define V4L2_CID_LED (V4L2_CID_BASE+36) +enum v4l2_led { + V4L2_LED_AUTO = 0, + V4L2_LED_ON = 1, + V4L2_LED_OFF = 2, +}; /* last CID + 1 */ -#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) +#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) /* MPEG-class control IDs defined by V4L2 */ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)