xref: /freebsd/sys/contrib/device-tree/Bindings/leds/backlight/pwm-backlight.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: pwm-backlight
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10b97ee269SEmmanuel Vadot  - Lee Jones <lee@kernel.org>
11c66ec88fSEmmanuel Vadot  - Daniel Thompson <daniel.thompson@linaro.org>
12c66ec88fSEmmanuel Vadot  - Jingoo Han <jingoohan1@gmail.com>
13c66ec88fSEmmanuel Vadot
14*84943d6fSEmmanuel VadotallOf:
15*84943d6fSEmmanuel Vadot  - $ref: common.yaml#
16*84943d6fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadotproperties:
18c66ec88fSEmmanuel Vadot  compatible:
19c66ec88fSEmmanuel Vadot    const: pwm-backlight
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot  pwms:
22c66ec88fSEmmanuel Vadot    maxItems: 1
23c66ec88fSEmmanuel Vadot
24c66ec88fSEmmanuel Vadot  pwm-names: true
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  power-supply:
27c66ec88fSEmmanuel Vadot    description: regulator for supply voltage
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  enable-gpios:
30c66ec88fSEmmanuel Vadot    description:
31c66ec88fSEmmanuel Vadot      Contains a single GPIO specifier for the GPIO which enables and disables
32c66ec88fSEmmanuel Vadot      the backlight.
33c66ec88fSEmmanuel Vadot    maxItems: 1
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  post-pwm-on-delay-ms:
36c66ec88fSEmmanuel Vadot    description:
37c66ec88fSEmmanuel Vadot      Delay in ms between setting an initial (non-zero) PWM and enabling the
38c66ec88fSEmmanuel Vadot      backlight using GPIO.
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  pwm-off-delay-ms:
41c66ec88fSEmmanuel Vadot    description:
42c66ec88fSEmmanuel Vadot      Delay in ms between disabling the backlight using GPIO and setting PWM
43c66ec88fSEmmanuel Vadot      value to 0.
44c66ec88fSEmmanuel Vadot
45c66ec88fSEmmanuel Vadot  num-interpolated-steps:
46c66ec88fSEmmanuel Vadot    description:
47c66ec88fSEmmanuel Vadot      Number of interpolated steps between each value of brightness-levels
48c66ec88fSEmmanuel Vadot      table. This way a high resolution pwm duty cycle can be used without
49c66ec88fSEmmanuel Vadot      having to list out every possible value in the brightness-level array.
50c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadotdependencies:
53c66ec88fSEmmanuel Vadot  default-brightness-level: [brightness-levels]
54c66ec88fSEmmanuel Vadot  num-interpolated-steps: [brightness-levels]
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadotrequired:
57c66ec88fSEmmanuel Vadot  - compatible
58c66ec88fSEmmanuel Vadot  - pwms
59c66ec88fSEmmanuel Vadot
60*84943d6fSEmmanuel VadotunevaluatedProperties: false
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadotexamples:
63c66ec88fSEmmanuel Vadot  - |
64c66ec88fSEmmanuel Vadot    backlight {
65c66ec88fSEmmanuel Vadot        compatible = "pwm-backlight";
66c66ec88fSEmmanuel Vadot        pwms = <&pwm 0 5000000>;
67c66ec88fSEmmanuel Vadot
68c66ec88fSEmmanuel Vadot        brightness-levels = <0 4 8 16 32 64 128 255>;
69c66ec88fSEmmanuel Vadot        default-brightness-level = <6>;
70c66ec88fSEmmanuel Vadot
71c66ec88fSEmmanuel Vadot        power-supply = <&vdd_bl_reg>;
72c66ec88fSEmmanuel Vadot        enable-gpios = <&gpio 58 0>;
73c66ec88fSEmmanuel Vadot        post-pwm-on-delay-ms = <10>;
74c66ec88fSEmmanuel Vadot        pwm-off-delay-ms = <10>;
75c66ec88fSEmmanuel Vadot    };
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot  - |
78c66ec88fSEmmanuel Vadot    // Example using num-interpolation-steps:
79c66ec88fSEmmanuel Vadot    backlight {
80c66ec88fSEmmanuel Vadot        compatible = "pwm-backlight";
81c66ec88fSEmmanuel Vadot        pwms = <&pwm 0 5000000>;
82c66ec88fSEmmanuel Vadot
83c66ec88fSEmmanuel Vadot        brightness-levels = <0 2048 4096 8192 16384 65535>;
84c66ec88fSEmmanuel Vadot        num-interpolated-steps = <2048>;
85c66ec88fSEmmanuel Vadot        default-brightness-level = <4096>;
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadot        power-supply = <&vdd_bl_reg>;
88c66ec88fSEmmanuel Vadot        enable-gpios = <&gpio 58 0>;
89c66ec88fSEmmanuel Vadot    };
90c66ec88fSEmmanuel Vadot
91c66ec88fSEmmanuel Vadot...
92