linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] v4l: Add V4L2_CID_FLASH_HW_STROBE_MODE control
@ 2011-12-05 19:56 Sylwester Nawrocki
  2011-12-05 22:41 ` Sakari Ailus
  0 siblings, 1 reply; 14+ messages in thread
From: Sylwester Nawrocki @ 2011-12-05 19:56 UTC (permalink / raw)
  To: linux-media
  Cc: laurent.pinchart, sakari.ailus, hverkuil, riverful.kim,
	s.nawrocki, Sylwester Nawrocki

The V4L2_CID_FLASH_HW_STROBE_MODE mode control is intended
for devices that are source of an external flash strobe for flash
devices. This part seems to be missing in current Flash control
class, i.e. a means for configuring devices that are not camera
flash drivers but involve a flash related functionality.

The V4L2_CID_FLASH_HW_STROBE_MODE control enables the user
to determine the flash control behavior, for instance, at an image
sensor device.

The control has effect only when V4L2_CID_FLASH_STROBE_SOURCE control
is set to V4L2_FLASH_STROBE_SOURCE_EXTERNAL at a flash subdev, if
a flash subdev is present in the system.

Signed-off-by: Sylwester Nawrocki <snjw23@gmail.com>
---

Hi Sakari,

My apologies for not bringing this earlier when you were designing
the Flash control API.
It seems like a use case were a sensor controller drives a strobe
signal for a Flash and the sensor side requires some set up doesn't
quite fit in the Flash Control API.

Or is there already a control allowing to set Flash strobe mode at
the sensor to: OFF, ON (per each exposed frame), AUTO ?

--

Regards,
Sylwester
---
 Documentation/DocBook/media/v4l/controls.xml |   30 ++++++++++++++++++++++++++
 drivers/media/video/v4l2-ctrls.c             |    2 +
 include/linux/videodev2.h                    |    7 ++++++
 3 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index 48a0434..1745187 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -3462,6 +3462,36 @@ interface and may change in the future.</para>
 	    after strobe during which another strobe will not be
 	    possible. This is a read-only control.</entry>
 	  </row>
+	  <row>
+	    <entry spanname="id"><constant>V4L2_CID_FLASH_HW_STROBE_MODE</constant></entry>
+	    <entry>menu</entry>
+	  </row>
+	  <row id="v4l2-flash-hw-strobe-mode">
+	    <entry spanname="descr">Determines the mode of hardware flash strobe
+	    at the device external to a flash controller, e.g. image sensor. This
+	    control has effect only when <constant>V4L2_CID_FLASH_STROBE_SOURCE
+	    </constant> is set to <constant>V4L2_FLASH_STROBE_SOURCE_EXTERNAL
+	    </constant> at the flash controller.
+            </entry>
+	  </row>
+	  <row>
+	    <entrytbl spanname="descr" cols="2">
+	      <tbody valign="top">
+		<row>
+		  <entry><constant>V4L2_FLASH_HW_STROBE_MODE_OFF</constant></entry>
+		  <entry>Flash strobe disabled.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_FLASH_HW_STROBE_MODE_ON</constant></entry>
+		  <entry>Flash strobe enabled for each exposed frame.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_FLASH_HW_STROBE_MODE_AUTO</constant></entry>
+		  <entry>Flash strobe determined automatically.</entry>
+		</row>
+	      </tbody>
+	    </entrytbl>
+	  </row>
 	  <row><entry></entry></row>
 	</tbody>
       </tgroup>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index 96ec73d..0d188e3 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -619,6 +619,7 @@ 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_HW_STROBE_MODE:	return "Hardware strobe mode";

 	default:
 		return NULL;
@@ -699,6 +700,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_TUNE_PREEMPHASIS:
 	case V4L2_CID_FLASH_LED_MODE:
 	case V4L2_CID_FLASH_STROBE_SOURCE:
+	case V4L2_CID_FLASH_HW_STROBE_MODE:
 	case V4L2_CID_MPEG_VIDEO_HEADER_MODE:
 	case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE:
 	case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d43149c..7ffb47d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1705,6 +1705,13 @@ 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_HW_STROBE_MODE		(V4L2_CID_FLASH_CLASS_BASE + 13)
+enum v4l2_flash_hw_strobe_mode {
+	V4L2_FLASH_HW_STROBE_OFF,
+	V4L2_FLASH_HW_STROBE_ON,
+	V4L2_FLASH_HW_STROBE_AUTO,
+};
+
 /*
  *	T U N I N G
  */
--
1.7.4.1


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

end of thread, other threads:[~2012-11-14 13:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-05 19:56 [RFC/PATCH] v4l: Add V4L2_CID_FLASH_HW_STROBE_MODE control Sylwester Nawrocki
2011-12-05 22:41 ` Sakari Ailus
2011-12-10 13:55   ` Sylwester Nawrocki
2011-12-14 21:51     ` Sakari Ailus
2011-12-28 16:06       ` Sylwester Nawrocki
2012-01-04 15:15         ` Sakari Ailus
2012-10-13 18:52     ` Sylwester Nawrocki
2012-10-14  9:16       ` Sylwester Nawrocki
2012-10-14 18:30         ` Sakari Ailus
2012-10-16 21:45           ` Sylwester Nawrocki
2012-10-23 20:07             ` Sakari Ailus
2012-10-24  9:04               ` Sylwester Nawrocki
2012-11-13 21:53                 ` Sakari Ailus
2012-11-14 13:30                   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).