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


Based on kernel version 6.13. Page generated on 2025-01-21 08:20 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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/nxp,pca955x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP PCA955X LED controllers

maintainers:
  - Nate Case <ncase@xes-inc.com>

description: |
  The PCA955x family of chips are I2C LED blinkers whose pins not used
  to control LEDs can be used as general purpose I/Os. The GPIO pins can
  be input or output, and output pins can also be pulse-width controlled.
 
  For more product information please see the link below:
  - https://www.nxp.com/docs/en/data-sheet/PCA9552.pdf

properties:
  compatible:
    enum:
      - nxp,pca9550
      - nxp,pca9551
      - nxp,pca9552
      - ibm,pca9552
      - nxp,pca9553

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

  gpio-controller: true

  gpio-line-names:
    minItems: 1
    maxItems: 16
 
  "#gpio-cells":
    const: 2

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

    properties:
      reg:
        maxItems: 1
      type:
        description: |
          Output configuration, see include/dt-bindings/leds/leds-pca955x.h
        $ref: /schemas/types.yaml#/definitions/uint32
        default: 0
        minimum: 0
        maximum: 2

    required:
      - reg

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - nxp,pca9550
    then:
      patternProperties:
        "^led@[0-9a-f]$":
          properties:
            reg:
              maximum: 1
  - if:
      properties:
        compatible:
          contains:
            enum:
              - nxp,pca9551
    then:
      patternProperties:
        "^led@[0-9a-f]$":
          properties:
            reg:
              maximum: 7
  - if:
      properties:
        compatible:
          contains:
            enum:
              - nxp,pca9552
              - ibm,pca9552
    then:
      patternProperties:
        "^led@[0-9a-f]$":
          properties:
            reg:
              maximum: 15
  - if:
      properties:
        compatible:
          contains:
            enum:
              - nxp,pca9553
    then:
      patternProperties:
        "^led@[0-9a-f]$":
          properties:
            reg:
              maximum: 3

additionalProperties: false

examples:
  - |
    #include <dt-bindings/leds/leds-pca955x.h>
 
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
 
        led-controller@60 {
            compatible = "nxp,pca9552";
            reg = <0x60>;
            #address-cells = <1>;
            #size-cells = <0>;
 
            led@0 {
                reg = <0>;
                label = "red:power";
                linux,default-trigger = "default-on";
                type = <PCA955X_TYPE_LED>;
            };
            led@1 {
                reg = <1>;
                label = "green:power";
                type = <PCA955X_TYPE_LED>;
            };
            led@2 {
                reg = <2>;
                label = "pca9552:yellow";
                type = <PCA955X_TYPE_LED>;
            };
            led@3 {
                reg = <3>;
                label = "pca9552:white";
                type = <PCA955X_TYPE_LED>;
            };
        };
    };

...