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