diff mbox

[PATCH/RFC,v5,02/10] Documentation: leds: Add description of Flash Manager

Message ID 1408542259-415-3-git-send-email-j.anaszewski@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jacek Anaszewski Aug. 20, 2014, 1:44 p.m. UTC
The documentation being added contains overall description
of the Flash Manager functionality and the related sysfs
attributes.

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 |   64 +++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
diff mbox

Patch

diff --git a/Documentation/leds/leds-class-flash.txt b/Documentation/leds/leds-class-flash.txt
index 8a9c17e..417b984 100644
--- a/Documentation/leds/leds-class-flash.txt
+++ b/Documentation/leds/leds-class-flash.txt
@@ -52,3 +52,67 @@  exposes a number of V4L2 controls. When the V4L2_CID_FLASH_LED_MODE control
 is set to V4L2_FLASH_LED_MODE_TORCH or V4L2_FLASH_LED_MODE_FLASH the
 LED subsystem sysfs interface becomes unavailable. The interface can be
 unlocked by setting the mode back to V4L2_FLASH_LED_MODE_NONE.
+
+
+Flash Manager
+=============
+
+Flash LED devices often provide two ways of strobing the flash: software
+(e.g. by setting a bit in a register) and hardware, by asserting dedicated pin,
+which is usually connected to a camera sensor device. There are also flash led
+devices which support only hardware strobing - in such cases a multiplexer
+device is employed to route the flash strobe signal either from the SoC GPIO or
+from the external strobe signal provider, e.g. camera sensor.
+Use of multiplexers allows also to change the flash-sensor connection
+dynamically if there is more than one flash or external strobe signal provider
+available on the board.
+
+In order to address the aforementioned cases the Flash Manager functionality
+has been introduced. Flash Manager is a part of the LED Flash Class.
+It maintains information about flashes, software and external strobe signal
+providers and multiplexers that route strobe signals among them.
+Flash Manager becomes available after defining CONFIG_LEDS_FLASH_MANAGER
+symbol in the kernel config.
+
+A flash led device is registered in the Flash Manager only if its Device Tree
+node contains information about the topology of strobe signals that can be
+routed to the device. The related device node has to be passed int the third
+argument to the led_classdev_flash_register function.
+The device_node is expected to include one gate-software-strobe subnode and
+at least one gate-external-strobeN subnode. Besides that there must defined
+a flash_muxes node aggregating all the multiplexers that can be referenced
+by the flash led devices. (for mote details see Documentation/devicetree/
+bindings/leds/ leds-flash-manager.txt).
+
+Flash manager adds following sysfs attributes to the LED Flash Clash
+device sysfs interface:
+
+	- strobe_provider - id of the external strobe signal provider associated
+                            with the flash led device. It is created only if
+			    there is more than one external strobe signal
+			    provider defined (RW).
+	- strobe_providerN - names of the strobe signal providers available
+			     for the flash led device, where N is the
+			     identifier of a strobe signal provider (RO)
+
+
+LED Flash Class multiplexers
+============================
+
+Multiplexers are an indispensable part of the Flash Manager. Flash Manager has
+its own led_flash_gpio_mux* helpers for creating, releasing and operating on
+the simple gpio driven multiplexers (the ones whose lines are selected by
+changing the state of its selector pins).
+
+It is however possible that a more advanced device will be used for routing
+strobe signals. This kind of devices are known to the Flash Manager as
+"asynchronous muxes" and can be registered in arbitrary moment with use of
+led_flash_manager_bind_async_mux API and unregistered with
+led_flash_manager_unbind_async_mux. (see Documentation/leds/leds-async-mux.c
+for the exemplary implementation of the async mux driver).
+
+If a LED Flash Class device declares dependency on an async mux, then strobing
+the flash, or setting external strobe, will succeed only wnen the async mux
+has been bound to the Flash Manager. Async mux module, once bound, can be
+removed only after all LED Flash Class devices using it are unregistered
+from the Flash Manager.