18c2ecf20Sopenharmony_ci* Skyworks Solutions, Inc. AAT1290 Current Regulator for Flash LEDs 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciThe device is controlled through two pins: FL_EN and EN_SET. The pins when, 48c2ecf20Sopenharmony_ciasserted high, enable flash strobe and movie mode (max 1/2 of flash current) 58c2ecf20Sopenharmony_cirespectively. In order to add a capability of selecting the strobe signal source 68c2ecf20Sopenharmony_ci(e.g. CPU or camera sensor) there is an additional switch required, independent 78c2ecf20Sopenharmony_ciof the flash chip. The switch is controlled with pin control. 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciRequired properties: 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci- compatible : Must be "skyworks,aat1290". 128c2ecf20Sopenharmony_ci- flen-gpios : Must be device tree identifier of the flash device FL_EN pin. 138c2ecf20Sopenharmony_ci- enset-gpios : Must be device tree identifier of the flash device EN_SET pin. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciOptional properties: 168c2ecf20Sopenharmony_ci- pinctrl-names : Must contain entries: "default", "host", "isp". Entries 178c2ecf20Sopenharmony_ci "default" and "host" must refer to the same pin configuration 188c2ecf20Sopenharmony_ci node, which sets the host as a strobe signal provider. Entry 198c2ecf20Sopenharmony_ci "isp" must refer to the pin configuration node, which sets the 208c2ecf20Sopenharmony_ci ISP as a strobe signal provider. 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciA discrete LED element connected to the device must be represented by a child 238c2ecf20Sopenharmony_cinode - see Documentation/devicetree/bindings/leds/common.txt. 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciRequired properties of the LED child node: 268c2ecf20Sopenharmony_ci- led-max-microamp : see Documentation/devicetree/bindings/leds/common.txt 278c2ecf20Sopenharmony_ci- flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt 288c2ecf20Sopenharmony_ci Maximum flash LED supply current can be calculated using 298c2ecf20Sopenharmony_ci following formula: I = 1A * 162kohm / Rset. 308c2ecf20Sopenharmony_ci- flash-max-timeout-us : see Documentation/devicetree/bindings/leds/common.txt 318c2ecf20Sopenharmony_ci Maximum flash timeout can be calculated using following 328c2ecf20Sopenharmony_ci formula: T = 8.82 * 10^9 * Ct. 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciOptional properties of the LED child node: 358c2ecf20Sopenharmony_ci- function : see Documentation/devicetree/bindings/leds/common.txt 368c2ecf20Sopenharmony_ci- color : see Documentation/devicetree/bindings/leds/common.txt 378c2ecf20Sopenharmony_ci- label : see Documentation/devicetree/bindings/leds/common.txt (deprecated) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciExample (by Ct = 220nF, Rset = 160kohm and exynos4412-trats2 board with 408c2ecf20Sopenharmony_cia switch that allows for routing strobe signal either from the host or from 418c2ecf20Sopenharmony_cithe camera sensor): 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci#include "exynos4412.dtsi" 448c2ecf20Sopenharmony_ci#include <dt-bindings/leds/common.h> 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ciled-controller { 478c2ecf20Sopenharmony_ci compatible = "skyworks,aat1290"; 488c2ecf20Sopenharmony_ci flen-gpios = <&gpj1 1 GPIO_ACTIVE_HIGH>; 498c2ecf20Sopenharmony_ci enset-gpios = <&gpj1 2 GPIO_ACTIVE_HIGH>; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci pinctrl-names = "default", "host", "isp"; 528c2ecf20Sopenharmony_ci pinctrl-0 = <&camera_flash_host>; 538c2ecf20Sopenharmony_ci pinctrl-1 = <&camera_flash_host>; 548c2ecf20Sopenharmony_ci pinctrl-2 = <&camera_flash_isp>; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci camera_flash: led { 578c2ecf20Sopenharmony_ci function = LED_FUNCTION_FLASH; 588c2ecf20Sopenharmony_ci color = <LED_COLOR_ID_WHITE>; 598c2ecf20Sopenharmony_ci led-max-microamp = <520833>; 608c2ecf20Sopenharmony_ci flash-max-microamp = <1012500>; 618c2ecf20Sopenharmony_ci flash-max-timeout-us = <1940000>; 628c2ecf20Sopenharmony_ci }; 638c2ecf20Sopenharmony_ci}; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci&pinctrl_0 { 668c2ecf20Sopenharmony_ci camera_flash_host: camera-flash-host { 678c2ecf20Sopenharmony_ci samsung,pins = "gpj1-0"; 688c2ecf20Sopenharmony_ci samsung,pin-function = <1>; 698c2ecf20Sopenharmony_ci samsung,pin-val = <0>; 708c2ecf20Sopenharmony_ci }; 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci camera_flash_isp: camera-flash-isp { 738c2ecf20Sopenharmony_ci samsung,pins = "gpj1-0"; 748c2ecf20Sopenharmony_ci samsung,pin-function = <1>; 758c2ecf20Sopenharmony_ci samsung,pin-val = <1>; 768c2ecf20Sopenharmony_ci }; 778c2ecf20Sopenharmony_ci}; 78