LED / flash API integration - Documentation
Subsystems (5)
v6 cover LED / flash API integration - Documentation
This patch set is the follow-up of the LED / flash API integration series [1]. For clarity reasons the patchset has been split into four subsets:
- LED Flash Class
- V4L2 Flash
- LED Flash Class drivers
- Documentation
========================
Changes since version 5:
========================
- removed flash manager framework - its implementation needs further thorough discussion.
- removed external strobe facilities from the LED Flash Class and provided external_strobe_set op in v4l2-flash. LED subsystem should be strobe provider agnostic.
Thanks,
Jacek Anaszewski
[1] https://lkml.org/lkml/2014/7/11/914
Jacek Anaszewski (6):
Documentation: leds: Add description of LED Flash Class extension
DT: leds: Add flash led devices related properties
DT: Add documentation for exynos4-is 'flashes' property
DT: Add documentation for the mfd Maxim max77693
of: Add Skyworks Solutions, Inc. vendor prefix
DT: Add documentation for the Skyworks AAT1290
Documentation/devicetree/bindings/leds/common.txt | 16 +++++ .../devicetree/bindings/leds/leds-aat1290.txt | 17 ++++++ .../devicetree/bindings/media/samsung-fimc.txt | 5 ++ Documentation/devicetree/bindings/mfd/max77693.txt | 62 ++++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + Documentation/leds/leds-class-flash.txt | 51 ++++++++++++++++ 6 files changed, 152 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-aat1290.txt create mode 100644 Documentation/leds/leds-class-flash.txt
Signature · 1 line
1.7.9.5
PATCH v6 1/6 Documentation: leds: Add description of LED Flash Class extension
The documentation being added contains overall description of the LED Flash Class and the related sysfs attributes. There are also chapters devoted specifically to the Flash Manager feature.
--- Documentation/leds/leds-class-flash.txt | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Documentation/leds/leds-class-flash.txt
Documentation/leds/leds-class-flash.txt new file +51 -0
@@ -0,0 +1,51 @@ + +Flash LED handling under Linux +============================== + +Some LED devices support two modes - torch and flash. In order to enable +support for flash LEDs CONFIG_LEDS_CLASS_FLASH symbol must be defined +in the kernel config. A flash LED driver must register in the LED subsystem +with led_classdev_flash_register to gain flash capabilities. + +Following sysfs attributes are exposed for controlling flash led devices: + + - flash_brightness - flash LED brightness in microamperes (RW) + - max_flash_brightness - maximum available flash LED brightness (RO) + - indicator_brightness - privacy LED brightness in microamperes (RW) + - max_indicator_brightness - maximum privacy LED brightness in + microamperes (RO) + - flash_timeout - flash strobe duration in microseconds (RW) + - max_flash_timeout - maximum available flash strobe duration (RO) + - flash_strobe - flash strobe state (RW) + - flash_fault - bitmask of flash faults that may have occurred, + possible flags are: + * 0x01 - flash controller voltage to the flash LED has exceeded + the limit specific to the flash controller + * 0x02 - the flash strobe was still on when the timeout set by + the user has expired; not all flash controllers may + set this in all such conditions + * 0x04 - the flash controller has overheated + * 0x08 - the short circuit protection of the flash controller + has been triggered + * 0x10 - current in the LED power supply has exceeded the limit + specific to the flash controller + * 0x40 - flash controller voltage to the flash LED has been + below the minimum limit specific to the flash + * 0x80 - the input voltage of the flash controller is below + the limit under which strobing the flash at full + current will not be possible. The condition persists + until this flag is no longer set + * 0x100 - the temperature of the LED has exceeded its allowed + upper limit + +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 v4l2_flash_init function +to get registered in the V4L2 subsystem. On remove v4l2_flash_release function +has to be called (see <media/v4l2-flash.h>). + +After proper initialization V4L2 Flash sub-device is created. The sub-device +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.
Signature · 1 line
1.7.9.5
PATCH v6 2/6 DT: leds: Add flash led devices related properties
In reply to Jacek AnaszewskiAddition of a LED Flash Class extension entails the need for flash led specific device tree properties. The properties being added are:
iout-torch, iout-flash, iout-indicator and flash-timeout.
--- Documentation/devicetree/bindings/leds/common.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/leds/common.txt +16 -0
@@ -3,6 +3,17 @@ Common leds properties. Optional properties for child nodes: - label : The label for this LED. If omitted, the label is taken from the node name (excluding the unit address). +- iout-torch : Array of maximum intensities in microamperes of the torch + led currents in order from sub-led 0 to N-1, where N is the number + of torch sub-leds exposed by the device +- iout-flash : Array of maximum intensities in microamperes of the flash + led currents in order from sub-led 0 to N-1, where N is the number + of flash sub-leds exposed by the device +- iout-indicator : Array of maximum intensities in microamperes of + the indicator led currents in order from sub-led 0 to N-1, + where N is the number of indicator sub-leds exposed by the device +- flash-timeout : timeout in microseconds after which flash led + is turned off - linux,default-trigger : This parameter, if present, is a string defining the trigger assigned to the LED. Current triggers are:
@@ -19,5 +30,10 @@ Examples: system-status { label = "Status"; linux,default-trigger = "heartbeat"; + iout-torch = <500 500>; + iout-flash = <1000 1000>; + iout-indicator = <100 100>; + flash-timeout = <1000>; + ... };
Signature · 1 line
1.7.9.5
PATCH v6 3/6 DT: Add documentation for exynos4-is 'flashes' property
In reply to Jacek AnaszewskiThis patch adds a description of 'flashes' property to the samsung-fimc.txt.
--- .../devicetree/bindings/media/samsung-fimc.txt | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/media/samsung-fimc.txt +5 -0
@@ -40,6 +40,10 @@ should be inactive. For the "active-a" state the camera port A must be activated and the port B deactivated and for the state "active-b" it should be the other way around. +Optional properties: + +- flashes - array of phandles to the available flash led devices + The 'camera' node must include at least one 'fimc' child node.
@@ -166,6 +170,7 @@ Example: clock-output-names = "cam_a_clkout", "cam_b_clkout"; pinctrl-names = "default"; pinctrl-0 = <&cam_port_a_clk_active>; + flashes = <&max77693-flash>, <&aat1290>; status = "okay"; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
1.7.9.5
PATCH v6 4/6 DT: Add documentation for the mfd Maxim max77693
In reply to Jacek AnaszewskiThis patch adds device tree binding documentation for the flash cell of the Maxim max77693 multifunctional device.
--- Documentation/devicetree/bindings/mfd/max77693.txt | 62 ++++++++++++++++++++ 1 file changed, 62 insertions(+)
Documentation/devicetree/bindings/mfd/max77693.txt +62 -0
@@ -27,6 +27,55 @@ Optional properties: [*] refer Documentation/devicetree/bindings/regulator/regulator.txt +Optional node: +- led-flash : the LED submodule device node + +Required properties of "led-flash" node: +- compatible : must be "maxim,max77693-flash" +- maxim,num-leds : number of connected leds + Possible values: 1 or 2. +- maxim,fleds : array of current outputs in order: fled1, fled2 + Note: both current outputs can be connected to a single led + Possible values: + 0 - the output is left disconnected, + 1 - a diode is connected to the output. + +Optional properties of "led-flash" node: +- maxim,boost-mode : + In boost mode the device can produce up to 1.2A of total current + on both outputs. The maximum current on each output is reduced + to 625mA then. If maxim,num-leds == <2> boost must be enabled + (it defaults to 1 if not set): + Possible values: + 0 - no boost, + 1 - adaptive mode, + 2 - fixed mode. +- iout-torch : Array of maximum intensities in microamperes of the torch + led currents in order: fled1, fled2. + 15625 - 250000 +- iout-flash : Array of maximum intensities in microamperes of the flash + led currents in order: fled1, fled2. + Range: + 15625 - 1000000 (max 625000 if boost mode is enabled) +- flash-timeout : timeout in microseconds after which flash led + is turned off + Range: + 62500 - 1000000 +- maxim,trigger : Array of flags indicating which trigger can activate given led + in order: fled1, fled2 + Possible flag values (can be combined): + 1 - FLASH pin of the chip, + 2 - TORCH pin of the chip, + 4 - software via I2C command. +- maxim,trigger-type : Array of trigger types in order: flash, torch. + Possible trigger types: + 0 - Rising edge of the signal triggers the flash/torch, + 1 - Signal level controls duration of the flash/torch. +- maxim,boost-vout : Output voltage of the boost module in millivolts. +- maxim,vsys-min : Low input voltage level in millivolts. Flash is not fired + if chip estimates that system voltage could drop below this level due + to flash power consumption. + Example: max77693@66 { compatible = "maxim,max77693";
@@ -52,4 +101,17 @@ Example: regulator-boot-on; }; }; + led_flash: led-flash { + compatible = "maxim,max77693-flash"; + iout-torch = <500000 0>; + iout-flash = <1250000 0>; + flash-timeout = <1000000 1000000>; + maxim,num-leds = <1>; + maxim,fleds = <1 1>; + maxim,trigger = <7 7>; + maxim,trigger-type = <0 1>; + maxim,boost-mode = <1>; + maxim,boost-vout = <5000>; + maxim,vsys-min = <2400>; + }; };
Signature · 1 line
1.7.9.5
PATCH v6 5/6 of: Add Skyworks Solutions, Inc. vendor prefix
In reply to Jacek AnaszewskiUse "skyworks" as the vendor prefix for the
Skyworks Solutions, Inc.
--- .../devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -117,6 +117,7 @@ renesas Renesas Electronics Corporation ricoh Ricoh Co. Ltd. rockchip Fuzhou Rockchip Electronics Co., Ltd samsung Samsung Semiconductor +skyworks Skyworks Solutions, Inc. sbs Smart Battery System schindler Schindler seagate Seagate Technology PLC
Signature · 1 line
1.7.9.5
PATCH v6 6/6 DT: Add documentation for the Skyworks AAT1290
In reply to Jacek AnaszewskiThis patch adds device tree binding documentation for 1.5A Step-Up Current Regulator for Flash LEDs.
--- .../devicetree/bindings/leds/leds-aat1290.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-aat1290.txt
Documentation/devicetree/bindings/leds/leds-aat1290.txt new file +17 -0
@@ -0,0 +1,17 @@ +* Skyworks Solutions, Inc. AAT1290 Current Regulator for Flash LEDs + +Required properties: + +- compatible : should be "skyworks,aat1290" +- gpios : two gpio pins in order FLEN, EN/SET +- skyworks,flash-timeout : maximum flash timeout in microseconds - + it can be calculated using following formula: + T = 8.82 * 10^9 * Ct + +Example: + +flash_led: flash-led { + compatible = "skyworks,aat1290"; + gpios = <&gpj1 1 0>, <&gpj1 2 0>; + flash-timeout = <1940000>; +}
Signature · 1 line
1.7.9.5