Documentation / devicetree / bindings / leds / nxp,pca963x.yaml


Based on kernel version 6.10. Page generated on 2024-07-16 09:00 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/nxp,pca963x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP PCA963x LED controllers

maintainers:
  - Laurent Pinchart <laurent.pinchart@ideasonboard.com>

description: |
  The NXP PCA963x are I2C-controlled LED drivers optimized for
  Red/Green/Blue/Amber (RGBA) color mixing applications. Each LED is
  individually controllable and has its own PWM controller.
 
  Datasheets are available at
 
  - https://www.nxp.com/docs/en/data-sheet/PCA9632.pdf
  - https://www.nxp.com/docs/en/data-sheet/PCA9633.pdf
  - https://www.nxp.com/docs/en/data-sheet/PCA9634.pdf
  - https://www.nxp.com/docs/en/data-sheet/PCA9635.pdf

properties:
  compatible:
    enum:
      - nxp,pca9632
      - nxp,pca9633
      - nxp,pca9634
      - nxp,pca9635

  reg:
    maxItems: 1
 
  "#address-cells":
    const: 1
 
  "#size-cells":
    const: 0

  nxp,hw-blink:
    type: boolean
    description:
      Use hardware blinking instead of software blinking

  nxp,inverted-out:
    type: boolean
    description:
      Invert the polarity of the generated PWM.

  nxp,period-scale:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      In some configurations, the chip blinks faster than expected. This
      parameter provides a scaling ratio (fixed point, decimal divided by 1000)
      to compensate, e.g. 1300=1.3x and 750=0.75x.

  nxp,totem-pole:
    type: boolean
    description:
      Use totem pole (push-pull) instead of open-drain (pca9632 defaults to
      open-drain, newer chips to totem pole).

patternProperties:
  "^led@[0-9a-f]+$":
    type: object
    $ref: common.yaml#
    unevaluatedProperties: false

    properties:
      reg:
        minimum: 0

    required:
      - reg

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - nxp,pca9632
              - nxp,pca9633
    then:
      patternProperties:
        "^led@[0-9a-f]+$":
          properties:
            reg:
              maximum: 3
    else:
      patternProperties:
        "^led@[0-9a-f]+$":
          properties:
            reg:
              maximum: 7

additionalProperties: false

examples:
  - |
    #include <dt-bindings/leds/common.h>
 
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
 
        led-controller@62 {
            compatible = "nxp,pca9632";
            reg = <0x62>;
            #address-cells = <1>;
            #size-cells = <0>;
 
            led@0 {
                    reg = <0>;
                    color = <LED_COLOR_ID_RED>;
                    function = LED_FUNCTION_STATUS;
            };
 
            led@1 {
                    reg = <1>;
                    color = <LED_COLOR_ID_GREEN>;
                    function = LED_FUNCTION_STATUS;
            };
 
            led@2 {
                    reg = <2>;
                    color = <LED_COLOR_ID_BLUE>;
                    function = LED_FUNCTION_STATUS;
            };
 
            led@3 {
                    reg = <3>;
                    color = <LED_COLOR_ID_WHITE>;
                    function = LED_FUNCTION_STATUS;
            };
        };
    };

...