summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/pinctrl/awinic,aw9523-pinctrl.yaml
blob: 98c310a3c63cdaaca3c6da76813bea84537775af (plain)
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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/awinic,aw9523-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Awinic AW9523/AW9523B I2C GPIO Expander

maintainers:
  - AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>

description: |
  The Awinic AW9523/AW9523B I2C GPIO Expander featuring 16 multi-function
  I/O, 256 steps PWM mode and interrupt support.

properties:
  compatible:
    const: awinic,aw9523-pinctrl

  reg:
    maxItems: 1

  '#gpio-cells':
    description: |
      Specifying the pin number and flags, as defined in
      include/dt-bindings/gpio/gpio.h
    const: 2

  gpio-controller: true

  gpio-ranges:
    maxItems: 1

  interrupt-controller: true

  interrupts:
    maxItems: 1
    description: Specifies the INTN pin IRQ.

  '#interrupt-cells':
    description:
      Specifies the PIN numbers and Flags, as defined in defined in
      include/dt-bindings/interrupt-controller/irq.h
    const: 2

  reset-gpios:
    maxItems: 1

# PIN CONFIGURATION NODES
patternProperties:
  '-pins$':
    type: object
    description:
      Pinctrl node's client devices use subnodes for desired pin configuration.
      Client device subnodes use below standard properties.
    $ref: /schemas/pinctrl/pincfg-node.yaml

    properties:
      pins:
        description:
          List of gpio pins affected by the properties specified in
          this subnode.
        items:
          pattern: "^gpio([0-9]|1[0-5])$"
        minItems: 1
        maxItems: 16

      function:
        description:
          Specify the alternative function to be configured for the
          specified pins.

        enum: [ gpio, pwm ]

      bias-disable: true
      bias-pull-down: true
      bias-pull-up: true
      drive-open-drain: true
      drive-push-pull: true
      input-enable: true
      input-disable: true
      output-high: true
      output-low: true

    required:
      - pins
      - function

    additionalProperties: false

required:
  - compatible
  - reg
  - gpio-controller
  - '#gpio-cells'
  - gpio-ranges

additionalProperties: false

examples:
  # Example configuration to drive pins for a keyboard matrix
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        aw9523: gpio-expander@58 {
                compatible = "awinic,aw9523-pinctrl";
                reg = <0x58>;
                interrupt-parent = <&tlmm>;
                interrupts = <50 IRQ_TYPE_EDGE_FALLING>;
                gpio-controller;
                #gpio-cells = <2>;
                gpio-ranges = <&tlmm 0 0 16>;
                interrupt-controller;
                #interrupt-cells = <2>;
                reset-gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;

                keyboard-matrix-col-pins {
                        pins = "gpio8", "gpio9", "gpio10", "gpio11",
                               "gpio12", "gpio13", "gpio14", "gpio15";
                        function = "gpio";
                        input-disable;
                        output-low;
                };

                keyboard-matrix-row-pins {
                        pins = "gpio0", "gpio1", "gpio2", "gpio3",
                               "gpio4", "gpio5", "gpio6", "gpio7";
                        function = "gpio";
                        bias-pull-up;
                        drive-open-drain;
                        input-enable;
                };
        };
    };