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

title: Cypress CY8C95X0 I2C GPIO expander

maintainers:
  - Patrick Rudolph <patrick.rudolph@9elements.com>

description: |
  This supports the 20/40/60 pin Cypress CYC95x0 GPIO I2C expanders.
  Pin function configuration is performed on a per-pin basis.

properties:
  compatible:
    enum:
      - cypress,cy8c9520
      - cypress,cy8c9540
      - cypress,cy8c9560

  reg:
    maxItems: 1

  gpio-controller: true

  '#gpio-cells':
    description:
      The first cell is the GPIO number and the second cell specifies GPIO
      flags, as defined in <dt-bindings/gpio/gpio.h>.
    const: 2

  interrupts:
    maxItems: 1

  interrupt-controller: true

  '#interrupt-cells':
    const: 2

  gpio-line-names: true

  gpio-ranges:
    maxItems: 1

  gpio-reserved-ranges:
    maxItems: 1

  vdd-supply:
    description:
      Optional power supply.

  reset-gpios:
    description: GPIO connected to the XRES pin
    maxItems: 1

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

    properties:
      pins:
        description:
          List of gpio pins affected by the properties specified in this
          subnode.
        items:
          pattern: '^gp([0-7][0-7])$'
        minItems: 1
        maxItems: 60

      function:
        description:
          Specify the alternative function to be configured for the specified
          pins.
        enum: [ gpio, pwm ]

      bias-pull-down: true

      bias-pull-up: true

      bias-disable: true

      output-high: true

      output-low: true

      drive-push-pull: true

      drive-open-drain: true

      drive-open-source: true

    required:
      - pins
      - function

    additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - interrupt-controller
  - '#interrupt-cells'
  - gpio-controller
  - '#gpio-cells'

additionalProperties: false

allOf:
  - $ref: pinctrl.yaml#

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>

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

      pinctrl@20 {
        compatible = "cypress,cy8c9520";
        reg = <0x20>;
        gpio-controller;
        #gpio-cells = <2>;
        #interrupt-cells = <2>;
        interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
        interrupt-controller;
        vdd-supply = <&p3v3>;
        gpio-reserved-ranges = <5 1>;
      };
    };