Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: pwm-backlight bindings
0008 
0009 maintainers:
0010   - Lee Jones <lee@kernel.org>
0011   - Daniel Thompson <daniel.thompson@linaro.org>
0012   - Jingoo Han <jingoohan1@gmail.com>
0013 
0014 properties:
0015   compatible:
0016     const: pwm-backlight
0017 
0018   pwms:
0019     maxItems: 1
0020 
0021   pwm-names: true
0022 
0023   power-supply:
0024     description: regulator for supply voltage
0025 
0026   enable-gpios:
0027     description:
0028       Contains a single GPIO specifier for the GPIO which enables and disables
0029       the backlight.
0030     maxItems: 1
0031 
0032   post-pwm-on-delay-ms:
0033     description:
0034       Delay in ms between setting an initial (non-zero) PWM and enabling the
0035       backlight using GPIO.
0036 
0037   pwm-off-delay-ms:
0038     description:
0039       Delay in ms between disabling the backlight using GPIO and setting PWM
0040       value to 0.
0041 
0042   brightness-levels:
0043     description:
0044       Array of distinct brightness levels. Typically these are in the range
0045       from 0 to 255, but any range starting at 0 will do. The actual brightness
0046       level (PWM duty cycle) will be interpolated from these values. 0 means a
0047       0% duty cycle (darkest/off), while the last value in the array represents
0048       a 100% duty cycle (brightest).
0049     $ref: /schemas/types.yaml#/definitions/uint32-array
0050 
0051   default-brightness-level:
0052     description:
0053       The default brightness level (index into the array defined by the
0054       "brightness-levels" property).
0055     $ref: /schemas/types.yaml#/definitions/uint32
0056 
0057   num-interpolated-steps:
0058     description:
0059       Number of interpolated steps between each value of brightness-levels
0060       table. This way a high resolution pwm duty cycle can be used without
0061       having to list out every possible value in the brightness-level array.
0062     $ref: /schemas/types.yaml#/definitions/uint32
0063 
0064 dependencies:
0065   default-brightness-level: [brightness-levels]
0066   num-interpolated-steps: [brightness-levels]
0067 
0068 required:
0069   - compatible
0070   - pwms
0071   - power-supply
0072 
0073 additionalProperties: false
0074 
0075 examples:
0076   - |
0077     backlight {
0078         compatible = "pwm-backlight";
0079         pwms = <&pwm 0 5000000>;
0080 
0081         brightness-levels = <0 4 8 16 32 64 128 255>;
0082         default-brightness-level = <6>;
0083 
0084         power-supply = <&vdd_bl_reg>;
0085         enable-gpios = <&gpio 58 0>;
0086         post-pwm-on-delay-ms = <10>;
0087         pwm-off-delay-ms = <10>;
0088     };
0089 
0090   - |
0091     // Example using num-interpolation-steps:
0092     backlight {
0093         compatible = "pwm-backlight";
0094         pwms = <&pwm 0 5000000>;
0095 
0096         brightness-levels = <0 2048 4096 8192 16384 65535>;
0097         num-interpolated-steps = <2048>;
0098         default-brightness-level = <4096>;
0099 
0100         power-supply = <&vdd_bl_reg>;
0101         enable-gpios = <&gpio 58 0>;
0102     };
0103 
0104 ...