xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/leds/leds-aat1290.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* Skyworks Solutions, Inc. AAT1290 Current Regulator for Flash LEDs
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThe device is controlled through two pins: FL_EN and EN_SET. The pins when,
4*4882a593Smuzhiyunasserted high, enable flash strobe and movie mode (max 1/2 of flash current)
5*4882a593Smuzhiyunrespectively. In order to add a capability of selecting the strobe signal source
6*4882a593Smuzhiyun(e.g. CPU or camera sensor) there is an additional switch required, independent
7*4882a593Smuzhiyunof the flash chip. The switch is controlled with pin control.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunRequired properties:
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun- compatible : Must be "skyworks,aat1290".
12*4882a593Smuzhiyun- flen-gpios : Must be device tree identifier of the flash device FL_EN pin.
13*4882a593Smuzhiyun- enset-gpios : Must be device tree identifier of the flash device EN_SET pin.
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunOptional properties:
16*4882a593Smuzhiyun- pinctrl-names : Must contain entries: "default", "host", "isp". Entries
17*4882a593Smuzhiyun		"default" and "host" must refer to the same pin configuration
18*4882a593Smuzhiyun		node, which sets the host as a strobe signal provider. Entry
19*4882a593Smuzhiyun		"isp" must refer to the pin configuration node, which sets the
20*4882a593Smuzhiyun		ISP as a strobe signal provider.
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunA discrete LED element connected to the device must be represented by a child
23*4882a593Smuzhiyunnode - see Documentation/devicetree/bindings/leds/common.txt.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunRequired properties of the LED child node:
26*4882a593Smuzhiyun- led-max-microamp : see Documentation/devicetree/bindings/leds/common.txt
27*4882a593Smuzhiyun- flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt
28*4882a593Smuzhiyun                       Maximum flash LED supply current can be calculated using
29*4882a593Smuzhiyun                       following formula: I = 1A * 162kohm / Rset.
30*4882a593Smuzhiyun- flash-max-timeout-us : see Documentation/devicetree/bindings/leds/common.txt
31*4882a593Smuzhiyun                         Maximum flash timeout can be calculated using following
32*4882a593Smuzhiyun                         formula: T = 8.82 * 10^9 * Ct.
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunOptional properties of the LED child node:
35*4882a593Smuzhiyun- function : see Documentation/devicetree/bindings/leds/common.txt
36*4882a593Smuzhiyun- color : see Documentation/devicetree/bindings/leds/common.txt
37*4882a593Smuzhiyun- label : see Documentation/devicetree/bindings/leds/common.txt (deprecated)
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunExample (by Ct = 220nF, Rset = 160kohm and exynos4412-trats2 board with
40*4882a593Smuzhiyuna switch that allows for routing strobe signal either from the host or from
41*4882a593Smuzhiyunthe camera sensor):
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun#include "exynos4412.dtsi"
44*4882a593Smuzhiyun#include <dt-bindings/leds/common.h>
45*4882a593Smuzhiyun
46*4882a593Smuzhiyunled-controller {
47*4882a593Smuzhiyun	compatible = "skyworks,aat1290";
48*4882a593Smuzhiyun	flen-gpios = <&gpj1 1 GPIO_ACTIVE_HIGH>;
49*4882a593Smuzhiyun	enset-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>;
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun	pinctrl-names = "default", "host", "isp";
52*4882a593Smuzhiyun	pinctrl-0 = <&camera_flash_host>;
53*4882a593Smuzhiyun	pinctrl-1 = <&camera_flash_host>;
54*4882a593Smuzhiyun	pinctrl-2 = <&camera_flash_isp>;
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun	camera_flash: led {
57*4882a593Smuzhiyun		function = LED_FUNCTION_FLASH;
58*4882a593Smuzhiyun		color = <LED_COLOR_ID_WHITE>;
59*4882a593Smuzhiyun		led-max-microamp = <520833>;
60*4882a593Smuzhiyun		flash-max-microamp = <1012500>;
61*4882a593Smuzhiyun		flash-max-timeout-us = <1940000>;
62*4882a593Smuzhiyun	};
63*4882a593Smuzhiyun};
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun&pinctrl_0 {
66*4882a593Smuzhiyun	camera_flash_host: camera-flash-host {
67*4882a593Smuzhiyun		samsung,pins = "gpj1-0";
68*4882a593Smuzhiyun		samsung,pin-function = <1>;
69*4882a593Smuzhiyun		samsung,pin-val = <0>;
70*4882a593Smuzhiyun	};
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun	camera_flash_isp: camera-flash-isp {
73*4882a593Smuzhiyun		samsung,pins = "gpj1-0";
74*4882a593Smuzhiyun		samsung,pin-function = <1>;
75*4882a593Smuzhiyun		samsung,pin-val = <1>;
76*4882a593Smuzhiyun	};
77*4882a593Smuzhiyun};
78