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-pwm.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: LEDs connected to PWM
0008 
0009 maintainers:
0010   - Pavel Machek <pavel@ucw.cz>
0011 
0012 description:
0013   Each LED is represented as a sub-node of the pwm-leds device.  Each
0014   node's name represents the name of the corresponding LED.
0015 
0016 properties:
0017   compatible:
0018     const: pwm-leds
0019 
0020 patternProperties:
0021   "^led(-[0-9a-f]+)?$":
0022     type: object
0023 
0024     $ref: common.yaml#
0025 
0026     properties:
0027       pwms:
0028         maxItems: 1
0029 
0030       pwm-names: true
0031 
0032       max-brightness:
0033         description:
0034           Maximum brightness possible for the LED
0035         $ref: /schemas/types.yaml#/definitions/uint32
0036 
0037       active-low:
0038         description:
0039           For PWMs where the LED is wired to supply rather than ground.
0040         type: boolean
0041 
0042     required:
0043       - pwms
0044       - max-brightness
0045 
0046 additionalProperties: false
0047 
0048 examples:
0049   - |
0050 
0051     #include <dt-bindings/leds/common.h>
0052 
0053     led-controller {
0054         compatible = "pwm-leds";
0055 
0056         led-1 {
0057             label = "omap4::keypad";
0058             pwms = <&twl_pwm 0 7812500>;
0059             max-brightness = <127>;
0060         };
0061 
0062         led-2 {
0063             color = <LED_COLOR_ID_GREEN>;
0064             function = LED_FUNCTION_CHARGING;
0065             pwms = <&twl_pwmled 0 7812500>;
0066             max-brightness = <255>;
0067         };
0068     };
0069 
0070 ...