xref: /freebsd/sys/contrib/device-tree/Bindings/leds/leds-sgm3140.yaml (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/leds-sgm3140.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: SGMICRO SGM3140 500mA Buck/Boost Charge Pump LED Driver
8
9maintainers:
10  - Luca Weiss <luca@z3ntu.xyz>
11
12description: |
13  The SGM3140 is a current-regulated charge pump which can regulate two current
14  levels for Flash and Torch modes.
15
16  The data sheet can be found at:
17    http://www.sg-micro.com/uploads/soft/20190626/1561535688.pdf
18
19properties:
20  compatible:
21    enum:
22      - ocs,ocp8110
23      - sgmicro,sgm3140
24
25  enable-gpios:
26    maxItems: 1
27    description: A connection to the 'EN' pin.
28
29  flash-gpios:
30    maxItems: 1
31    description: A connection to the 'FLASH' pin.
32
33  vin-supply:
34    description: Regulator providing power to the 'VIN' pin.
35
36  led:
37    type: object
38    $ref: common.yaml#
39    unevaluatedProperties: false
40
41required:
42  - compatible
43  - flash-gpios
44  - enable-gpios
45
46additionalProperties: false
47
48examples:
49  - |
50    #include <dt-bindings/gpio/gpio.h>
51    #include <dt-bindings/leds/common.h>
52
53    led-controller {
54        compatible = "sgmicro,sgm3140";
55        flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
56        enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
57        vin-supply = <&reg_dcdc1>;
58
59        sgm3140_flash: led {
60            function = LED_FUNCTION_FLASH;
61            color = <LED_COLOR_ID_WHITE>;
62            flash-max-timeout-us = <250000>;
63        };
64    };
65