leds-consumer.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/leds/leds-consumer.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Common leds consumer
  7. maintainers:
  8. - Aleksandrs Vinarskis <alex@vinarskis.com>
  9. description:
  10. Some LED defined in DT are required by other DT consumers, for example
  11. v4l2 subnode may require privacy or flash LED. Unlike trigger-source
  12. approach which is typically used as 'soft' binding, referencing LED
  13. devices by phandle makes things simpler when 'hard' binding is desired.
  14. Document LED properties that its consumers may define.
  15. select: true
  16. properties:
  17. leds:
  18. oneOf:
  19. - type: object
  20. - $ref: /schemas/types.yaml#/definitions/phandle-array
  21. description:
  22. A list of LED device(s) required by a particular consumer.
  23. items:
  24. maxItems: 1
  25. led-names:
  26. description:
  27. A list of device name(s). Used to map LED devices to their respective
  28. functions, when consumer requires more than one LED.
  29. additionalProperties: true
  30. examples:
  31. - |
  32. #include <dt-bindings/gpio/gpio.h>
  33. #include <dt-bindings/leds/common.h>
  34. leds {
  35. compatible = "gpio-leds";
  36. privacy_led: privacy-led {
  37. color = <LED_COLOR_ID_RED>;
  38. default-state = "off";
  39. function = LED_FUNCTION_INDICATOR;
  40. gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
  41. };
  42. };
  43. i2c {
  44. #address-cells = <1>;
  45. #size-cells = <0>;
  46. v4l2_node: camera@36 {
  47. reg = <0x36>;
  48. leds = <&privacy_led>;
  49. led-names = "privacy";
  50. };
  51. };
  52. ...