From patchwork Mon Jan 21 07:34:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 16377 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TxBuG-0002Vf-HC; Mon, 21 Jan 2013 08:35:00 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1TxBuF-0000J1-BD; Mon, 21 Jan 2013 08:35:00 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404Ab3AUHe5 (ORCPT + 1 other); Mon, 21 Jan 2013 02:34:57 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:16988 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247Ab3AUHe4 (ORCPT ); Mon, 21 Jan 2013 02:34:56 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGY005EFT1VON80@mailout2.w1.samsung.com> for linux-media@vger.kernel.org; Mon, 21 Jan 2013 07:34:54 +0000 (GMT) X-AuditID: cbfec7f5-b7fd76d000007247-b9-50fcef9ef794 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 2F.BA.29255.E9FECF05; Mon, 21 Jan 2013 07:34:54 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MGY002TYT201L00@eusync1.samsung.com> for linux-media@vger.kernel.org; Mon, 21 Jan 2013 07:34:54 +0000 (GMT) From: Andrzej Hajda To: linux-media@vger.kernel.org Cc: Kyungmin Park , Seung-Woo Kim , Sylwester Nawrocki , Andrzej Hajda Subject: [PATCH RFC] V4L: Add underexposure metering flash controls Date: Mon, 21 Jan 2013 08:34:35 +0100 Message-id: <1358753675-10784-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDJMWRmVeSWpSXmKPExsVy+t/xy7rz3v8JMDj8UsGiZ8NWVgdGj8+b 5AIYo7hsUlJzMstSi/TtErgy/vwOLTigUPH23xu2BsbJUl2MnBwSAiYSc89OZ4GwxSQu3FvP 1sXIxSEksJRRovHydChnHZNE/5PPYFVsApoSfzffZAOxRQTkJZ703gArYhZYC9Tx9g0zSEJY wFni7a/X7CA2i4CqxIY1c8GaeYHi16/NY4VYpyjR/WwC2wRG7gWMDKsYRVNLkwuKk9JzjfSK E3OLS/PS9ZLzczcxQnz4dQfj0mNWhxgFOBiVeHgT+v4ECLEmlhVX5h5ilOBgVhLh/TkDKMSb klhZlVqUH19UmpNafIiRiYNTqoHx1HQOzWn18vvSlmdFvpxRFnDad9GK9gtG/16yTvjudEvh 4a6r75/N3SbEbBhzwcCi9dCTP9u5MxpW7G5//TNIescM5W1X+hJtvXKvynMrFTXuzHrPrK+o 4PSj0DK8QzxM5ZbNH/0JuXtKQuMONxn7mAi7acslqrfH5zx/r6swNUAo8mbbhmglluKMREMt 5qLiRACe6jaHvwEAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.21.72415 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' HTML_NO_HTTP 0.1, MULTIPLE_RCPTS 0.1, HTML_00_10 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Add flash controls for metering of the light conditions regarding the necessity of the flash firing. Signed-off-by: Andrzej Hajda Signed-off-by: Kyungmin Park --- Documentation/DocBook/media/v4l/controls.xml | 25 +++++++++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++ include/uapi/linux/v4l2-controls.h | 3 +++ 3 files changed, 32 insertions(+) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 9d4af8a..7496dca 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -4247,6 +4247,31 @@ interface and may change in the future. after strobe during which another strobe will not be possible. This is a read-only control. + + V4L2_CID_FLASH_UNDEREXPOSURE_METERING + boolean + + + Enable or disable metering of the light + conditions regarding the necessity of the flash firing. + + + V4L2_CID_FLASH_UNDEREXPOSURE_LEVEL + integer + + + This is a read-only control that can be read + by the application and used as a hint to determine if the flash + should be used to obtain optimal exposure. Valid only if + V4L2_CID_FLASH_UNDEREXPOSURE_METERING + is enabled. Value 0 means the flash should not be used. + Otherwise the flash should be used and the value indicates the + optimal intensity of the flash. It should use the same units as + V4L2_CID_FLASH_INTENSITY. In case + V4L2_CID_FLASH_INTENSITY is not supported the + maximum value should be 1. + + diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 9cdf4b8..8a7e4f7 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -779,6 +779,8 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_FLASH_FAULT: return "Faults"; case V4L2_CID_FLASH_CHARGE: return "Charge"; case V4L2_CID_FLASH_READY: return "Ready to Strobe"; + case V4L2_CID_FLASH_UNDEREXPOSURE_METERING: return "Underexposure Metering"; + case V4L2_CID_FLASH_UNDEREXPOSURE_LEVEL: return "Underexposure Level"; /* JPEG encoder controls */ /* Keep the order of the 'case's the same as in videodev2.h! */ @@ -857,6 +859,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL: case V4L2_CID_WIDE_DYNAMIC_RANGE: case V4L2_CID_IMAGE_STABILIZATION: + case V4L2_CID_FLASH_UNDEREXPOSURE_METERING: *type = V4L2_CTRL_TYPE_BOOLEAN; *min = 0; *max = *step = 1; @@ -962,6 +965,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, break; case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: + case V4L2_CID_FLASH_UNDEREXPOSURE_LEVEL: *type = V4L2_CTRL_TYPE_INTEGER; *flags |= V4L2_CTRL_FLAG_READ_ONLY; break; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 0eb1c1a..4cb493a 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -763,6 +763,9 @@ enum v4l2_flash_strobe_source { #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) +#define V4L2_CID_FLASH_UNDEREXPOSURE_METERING (V4L2_CID_FLASH_CLASS_BASE + 13) +#define V4L2_CID_FLASH_UNDEREXPOSURE_LEVEL (V4L2_CID_FLASH_CLASS_BASE + 14) + /* JPEG-class control IDs */