All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] Documentation: leds: Add description of v4l2-flash sub-device
@ 2015-03-30  9:52 Jacek Anaszewski
  2015-03-30  9:52 ` [PATCH v3] DT: Add documentation for the mfd Maxim max77693 Jacek Anaszewski
  2015-03-30  9:52 ` [PATCH v3] leds: Add support for max77693 mfd flash cell Jacek Anaszewski
  0 siblings, 2 replies; 10+ messages in thread
From: Jacek Anaszewski @ 2015-03-30  9:52 UTC (permalink / raw)
  To: linux-leds, linux-media
  Cc: kyungmin.park, pavel, cooloney, rpurdie, sakari.ailus, s.nawrocki,
	Jacek Anaszewski

This patch extends LED Flash class documention by
the description of interactions with v4l2-flash sub-device.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
---
 Documentation/leds/leds-class-flash.txt |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

- extended description of v4l2_flash API

diff --git a/Documentation/leds/leds-class-flash.txt b/Documentation/leds/leds-class-flash.txt
index 19bb673..9d45667 100644
--- a/Documentation/leds/leds-class-flash.txt
+++ b/Documentation/leds/leds-class-flash.txt
@@ -20,3 +20,49 @@ Following sysfs attributes are exposed for controlling flash LED devices:
 	- max_flash_timeout
 	- flash_strobe
 	- flash_fault
+
+
+V4L2 Flash wrapper for flash LEDs
+=================================
+
+A LED subsystem driver can be controlled also from the level of VideoForLinux2
+subsystem. In order to enable this CONFIG_V4L2_FLASH_LED_CLASS symbol has to
+be defined in the kernel config.
+
+The driver must call the v4l2_flash_init function to get registered in the
+V4L2 subsystem. The function takes three arguments:
+- fled_cdev : the LED Flash class device to wrap
+- ops : V4L2 specific ops
+	* external_strobe_set - defines the source of the flash LED strobe -
+		V4L2_CID_FLASH_STROBE control or external source, typically
+		a sensor, which makes it possible to synchronise the flash
+		strobe start with exposure start,
+	* intensity_to_led_brightness and led_brightness_to_intensity - perform
+		enum led_brightness <-> V4L2 intensity conversion in a device
+		specific manner - they can be used for devices with non-linear
+		LED current scale.
+- config : configuration for V4L2 Flash sub-device
+	* dev_name - the name of the media entity, unique in the system,
+	* flash_faults - bitmask of flash faults that the LED Flash class
+		device can report; corresponding LED_FAULT* bit definitions are
+		available in <linux/led-class-flash.h>,
+	* intensity - constraints for the LED in the TORCH or INDICATOR mode,
+		in microamperes,
+	* has_external_strobe - external strobe capability,
+	* indicator_led - signifies that a led is of indicator type, which
+		implies that it can have only two V4L2 controls:
+		V4L2_CID_FLASH_INDICATOR_INTENSITY and V4L2_CID_FLASH_FAULT.
+
+On remove the v4l2_flash_release function has to be called, which takes one
+argument - struct v4l2_flash pointer returned previously by v4l2_flash_init.
+
+Please refer to the drivers/leds/leds-max77693.c for an exemplary usage of the
+v4l2-flash API.
+
+Once the V4L2 sub-device is registered by the driver which created the Media
+controller device, the sub-device node acts just as a node of a native V4L2
+flash API device would. The calls are simply routed to the LED flash API.
+
+Opening the V4L2 Flash sub-device makes the LED subsystem sysfs interface
+unavailable. The interface is re-enabled after the V4L2 Flash sub-device
+is closed.
-- 
1.7.9.5

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

end of thread, other threads:[~2015-03-31 10:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30  9:52 [PATCH v3] Documentation: leds: Add description of v4l2-flash sub-device Jacek Anaszewski
2015-03-30  9:52 ` [PATCH v3] DT: Add documentation for the mfd Maxim max77693 Jacek Anaszewski
     [not found]   ` <1427709149-15014-2-git-send-email-j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-03-30 11:57     ` Mark Rutland
2015-03-30 11:57       ` Mark Rutland
2015-03-30 12:43       ` Jacek Anaszewski
2015-03-30 13:20         ` Mark Rutland
2015-03-30 13:46           ` Jacek Anaszewski
2015-03-31  9:14           ` sakari.ailus
2015-03-31 10:58             ` Jacek Anaszewski
2015-03-30  9:52 ` [PATCH v3] leds: Add support for max77693 mfd flash cell Jacek Anaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.