pwm-backlight.yaml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: pwm-backlight
  7. maintainers:
  8. - Lee Jones <lee@kernel.org>
  9. - Daniel Thompson <daniel.thompson@linaro.org>
  10. - Jingoo Han <jingoohan1@gmail.com>
  11. allOf:
  12. - $ref: common.yaml#
  13. properties:
  14. compatible:
  15. const: pwm-backlight
  16. pwms:
  17. maxItems: 1
  18. pwm-names: true
  19. power-supply:
  20. description: regulator for supply voltage
  21. enable-gpios:
  22. description:
  23. Contains a single GPIO specifier for the GPIO which enables and disables
  24. the backlight.
  25. maxItems: 1
  26. post-pwm-on-delay-ms:
  27. description:
  28. Delay in ms between setting an initial (non-zero) PWM and enabling the
  29. backlight using GPIO.
  30. pwm-off-delay-ms:
  31. description:
  32. Delay in ms between disabling the backlight using GPIO and setting PWM
  33. value to 0.
  34. num-interpolated-steps:
  35. description:
  36. Number of interpolated steps between each value of brightness-levels
  37. table. This way a high resolution pwm duty cycle can be used without
  38. having to list out every possible value in the brightness-level array.
  39. $ref: /schemas/types.yaml#/definitions/uint32
  40. dependencies:
  41. default-brightness-level: [brightness-levels]
  42. num-interpolated-steps: [brightness-levels]
  43. required:
  44. - compatible
  45. - pwms
  46. unevaluatedProperties: false
  47. examples:
  48. - |
  49. backlight {
  50. compatible = "pwm-backlight";
  51. pwms = <&pwm 0 5000000>;
  52. brightness-levels = <0 4 8 16 32 64 128 255>;
  53. default-brightness-level = <6>;
  54. power-supply = <&vdd_bl_reg>;
  55. enable-gpios = <&gpio 58 0>;
  56. post-pwm-on-delay-ms = <10>;
  57. pwm-off-delay-ms = <10>;
  58. };
  59. - |
  60. // Example using num-interpolation-steps:
  61. backlight {
  62. compatible = "pwm-backlight";
  63. pwms = <&pwm 0 5000000>;
  64. brightness-levels = <0 2048 4096 8192 16384 65535>;
  65. num-interpolated-steps = <2048>;
  66. default-brightness-level = <4096>;
  67. power-supply = <&vdd_bl_reg>;
  68. enable-gpios = <&gpio 58 0>;
  69. };
  70. ...