Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/leds-sgm3140.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: SGMICRO SGM3140 500mA Buck/Boost Charge Pump LED Driver
0008 
0009 maintainers:
0010   - Luca Weiss <luca@z3ntu.xyz>
0011 
0012 description: |
0013   The SGM3140 is a current-regulated charge pump which can regulate two current
0014   levels for Flash and Torch modes.
0015 
0016   The data sheet can be found at:
0017     http://www.sg-micro.com/uploads/soft/20190626/1561535688.pdf
0018 
0019 properties:
0020   compatible:
0021     const: sgmicro,sgm3140
0022 
0023   enable-gpios:
0024     maxItems: 1
0025     description: A connection to the 'EN' pin.
0026 
0027   flash-gpios:
0028     maxItems: 1
0029     description: A connection to the 'FLASH' pin.
0030 
0031   vin-supply:
0032     description: Regulator providing power to the 'VIN' pin.
0033 
0034   led:
0035     type: object
0036     $ref: common.yaml#
0037 
0038 required:
0039   - compatible
0040   - flash-gpios
0041   - enable-gpios
0042 
0043 additionalProperties: false
0044 
0045 examples:
0046   - |
0047     #include <dt-bindings/gpio/gpio.h>
0048     #include <dt-bindings/leds/common.h>
0049 
0050     led-controller {
0051         compatible = "sgmicro,sgm3140";
0052         flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
0053         enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
0054         vin-supply = <&reg_dcdc1>;
0055 
0056         sgm3140_flash: led {
0057             function = LED_FUNCTION_FLASH;
0058             color = <LED_COLOR_ID_WHITE>;
0059             flash-max-timeout-us = <250000>;
0060         };
0061     };