xref: /freebsd-src/sys/contrib/device-tree/Bindings/leds/backlight/pwm-backlight.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadotpwm-backlight bindings
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot  - compatible: "pwm-backlight"
5*c66ec88fSEmmanuel Vadot  - pwms: OF device-tree PWM specification (see PWM binding[0])
6*c66ec88fSEmmanuel Vadot  - power-supply: regulator for supply voltage
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel VadotOptional properties:
9*c66ec88fSEmmanuel Vadot  - pwm-names: a list of names for the PWM devices specified in the
10*c66ec88fSEmmanuel Vadot               "pwms" property (see PWM binding[0])
11*c66ec88fSEmmanuel Vadot  - enable-gpios: contains a single GPIO specifier for the GPIO which enables
12*c66ec88fSEmmanuel Vadot                  and disables the backlight (see GPIO binding[1])
13*c66ec88fSEmmanuel Vadot  - post-pwm-on-delay-ms: Delay in ms between setting an initial (non-zero) PWM
14*c66ec88fSEmmanuel Vadot                          and enabling the backlight using GPIO.
15*c66ec88fSEmmanuel Vadot  - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO
16*c66ec88fSEmmanuel Vadot                      and setting PWM value to 0.
17*c66ec88fSEmmanuel Vadot  - brightness-levels: Array of distinct brightness levels. Typically these
18*c66ec88fSEmmanuel Vadot                       are in the range from 0 to 255, but any range starting at
19*c66ec88fSEmmanuel Vadot                       0 will do. The actual brightness level (PWM duty cycle)
20*c66ec88fSEmmanuel Vadot                       will be interpolated from these values. 0 means a 0% duty
21*c66ec88fSEmmanuel Vadot                       cycle (darkest/off), while the last value in the array
22*c66ec88fSEmmanuel Vadot                       represents a 100% duty cycle (brightest).
23*c66ec88fSEmmanuel Vadot  - default-brightness-level: The default brightness level (index into the
24*c66ec88fSEmmanuel Vadot                              array defined by the "brightness-levels" property).
25*c66ec88fSEmmanuel Vadot  - num-interpolated-steps: Number of interpolated steps between each value
26*c66ec88fSEmmanuel Vadot                            of brightness-levels table. This way a high
27*c66ec88fSEmmanuel Vadot                            resolution pwm duty cycle can be used without
28*c66ec88fSEmmanuel Vadot                            having to list out every possible value in the
29*c66ec88fSEmmanuel Vadot                            brightness-level array.
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadot[0]: Documentation/devicetree/bindings/pwm/pwm.txt
32*c66ec88fSEmmanuel Vadot[1]: Documentation/devicetree/bindings/gpio/gpio.txt
33*c66ec88fSEmmanuel Vadot
34*c66ec88fSEmmanuel VadotExample:
35*c66ec88fSEmmanuel Vadot
36*c66ec88fSEmmanuel Vadot	backlight {
37*c66ec88fSEmmanuel Vadot		compatible = "pwm-backlight";
38*c66ec88fSEmmanuel Vadot		pwms = <&pwm 0 5000000>;
39*c66ec88fSEmmanuel Vadot
40*c66ec88fSEmmanuel Vadot		brightness-levels = <0 4 8 16 32 64 128 255>;
41*c66ec88fSEmmanuel Vadot		default-brightness-level = <6>;
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot		power-supply = <&vdd_bl_reg>;
44*c66ec88fSEmmanuel Vadot		enable-gpios = <&gpio 58 0>;
45*c66ec88fSEmmanuel Vadot		post-pwm-on-delay-ms = <10>;
46*c66ec88fSEmmanuel Vadot		pwm-off-delay-ms = <10>;
47*c66ec88fSEmmanuel Vadot	};
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotExample using num-interpolation-steps:
50*c66ec88fSEmmanuel Vadot
51*c66ec88fSEmmanuel Vadot	backlight {
52*c66ec88fSEmmanuel Vadot		compatible = "pwm-backlight";
53*c66ec88fSEmmanuel Vadot		pwms = <&pwm 0 5000000>;
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel Vadot		brightness-levels = <0 2048 4096 8192 16384 65535>;
56*c66ec88fSEmmanuel Vadot		num-interpolated-steps = <2048>;
57*c66ec88fSEmmanuel Vadot		default-brightness-level = <4096>;
58*c66ec88fSEmmanuel Vadot
59*c66ec88fSEmmanuel Vadot		power-supply = <&vdd_bl_reg>;
60*c66ec88fSEmmanuel Vadot		enable-gpios = <&gpio 58 0>;
61*c66ec88fSEmmanuel Vadot	};
62