xref: /freebsd-src/sys/contrib/device-tree/Bindings/pinctrl/cypress,cy8c95x0.yaml (revision 01950c46b8155250f64374fb72fc11faa44bf099)
17ef62cebSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
27ef62cebSEmmanuel Vadot%YAML 1.2
37ef62cebSEmmanuel Vadot---
47ef62cebSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/cypress,cy8c95x0.yaml#
57ef62cebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
67ef62cebSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: Cypress CY8C95X0 I2C GPIO expander
87ef62cebSEmmanuel Vadot
97ef62cebSEmmanuel Vadotmaintainers:
107ef62cebSEmmanuel Vadot  - Patrick Rudolph <patrick.rudolph@9elements.com>
117ef62cebSEmmanuel Vadot
127ef62cebSEmmanuel Vadotdescription: |
137ef62cebSEmmanuel Vadot  This supports the 20/40/60 pin Cypress CYC95x0 GPIO I2C expanders.
147ef62cebSEmmanuel Vadot  Pin function configuration is performed on a per-pin basis.
157ef62cebSEmmanuel Vadot
167ef62cebSEmmanuel Vadotproperties:
177ef62cebSEmmanuel Vadot  compatible:
187ef62cebSEmmanuel Vadot    enum:
197ef62cebSEmmanuel Vadot      - cypress,cy8c9520
207ef62cebSEmmanuel Vadot      - cypress,cy8c9540
217ef62cebSEmmanuel Vadot      - cypress,cy8c9560
227ef62cebSEmmanuel Vadot
237ef62cebSEmmanuel Vadot  reg:
247ef62cebSEmmanuel Vadot    maxItems: 1
257ef62cebSEmmanuel Vadot
267ef62cebSEmmanuel Vadot  gpio-controller: true
277ef62cebSEmmanuel Vadot
287ef62cebSEmmanuel Vadot  '#gpio-cells':
297ef62cebSEmmanuel Vadot    description:
307ef62cebSEmmanuel Vadot      The first cell is the GPIO number and the second cell specifies GPIO
317ef62cebSEmmanuel Vadot      flags, as defined in <dt-bindings/gpio/gpio.h>.
327ef62cebSEmmanuel Vadot    const: 2
337ef62cebSEmmanuel Vadot
347ef62cebSEmmanuel Vadot  interrupts:
357ef62cebSEmmanuel Vadot    maxItems: 1
367ef62cebSEmmanuel Vadot
377ef62cebSEmmanuel Vadot  interrupt-controller: true
387ef62cebSEmmanuel Vadot
397ef62cebSEmmanuel Vadot  '#interrupt-cells':
407ef62cebSEmmanuel Vadot    const: 2
417ef62cebSEmmanuel Vadot
427ef62cebSEmmanuel Vadot  gpio-line-names: true
437ef62cebSEmmanuel Vadot
447ef62cebSEmmanuel Vadot  gpio-ranges:
457ef62cebSEmmanuel Vadot    maxItems: 1
467ef62cebSEmmanuel Vadot
477ef62cebSEmmanuel Vadot  gpio-reserved-ranges:
48*01950c46SEmmanuel Vadot    minItems: 1
49*01950c46SEmmanuel Vadot    maxItems: 60
507ef62cebSEmmanuel Vadot
517ef62cebSEmmanuel Vadot  vdd-supply:
527ef62cebSEmmanuel Vadot    description:
537ef62cebSEmmanuel Vadot      Optional power supply.
547ef62cebSEmmanuel Vadot
55aa1a8ff2SEmmanuel Vadot  reset-gpios:
56aa1a8ff2SEmmanuel Vadot    description: GPIO connected to the XRES pin
57aa1a8ff2SEmmanuel Vadot    maxItems: 1
58aa1a8ff2SEmmanuel Vadot
597ef62cebSEmmanuel VadotpatternProperties:
607ef62cebSEmmanuel Vadot  '-pins$':
617ef62cebSEmmanuel Vadot    type: object
627ef62cebSEmmanuel Vadot    description:
637ef62cebSEmmanuel Vadot      Pinctrl node's client devices use subnodes for desired pin configuration.
647ef62cebSEmmanuel Vadot      Client device subnodes use below standard properties.
657ef62cebSEmmanuel Vadot    $ref: pincfg-node.yaml#
667ef62cebSEmmanuel Vadot
677ef62cebSEmmanuel Vadot    properties:
687ef62cebSEmmanuel Vadot      pins:
697ef62cebSEmmanuel Vadot        description:
707ef62cebSEmmanuel Vadot          List of gpio pins affected by the properties specified in this
717ef62cebSEmmanuel Vadot          subnode.
727ef62cebSEmmanuel Vadot        items:
737ef62cebSEmmanuel Vadot          pattern: '^gp([0-7][0-7])$'
747ef62cebSEmmanuel Vadot        minItems: 1
757ef62cebSEmmanuel Vadot        maxItems: 60
767ef62cebSEmmanuel Vadot
777ef62cebSEmmanuel Vadot      function:
787ef62cebSEmmanuel Vadot        description:
797ef62cebSEmmanuel Vadot          Specify the alternative function to be configured for the specified
807ef62cebSEmmanuel Vadot          pins.
817ef62cebSEmmanuel Vadot        enum: [ gpio, pwm ]
827ef62cebSEmmanuel Vadot
837ef62cebSEmmanuel Vadot      bias-pull-down: true
847ef62cebSEmmanuel Vadot
857ef62cebSEmmanuel Vadot      bias-pull-up: true
867ef62cebSEmmanuel Vadot
877ef62cebSEmmanuel Vadot      bias-disable: true
887ef62cebSEmmanuel Vadot
89*01950c46SEmmanuel Vadot      input-enable: true
90*01950c46SEmmanuel Vadot
917ef62cebSEmmanuel Vadot      output-high: true
927ef62cebSEmmanuel Vadot
937ef62cebSEmmanuel Vadot      output-low: true
947ef62cebSEmmanuel Vadot
957ef62cebSEmmanuel Vadot      drive-push-pull: true
967ef62cebSEmmanuel Vadot
977ef62cebSEmmanuel Vadot      drive-open-drain: true
987ef62cebSEmmanuel Vadot
997ef62cebSEmmanuel Vadot      drive-open-source: true
1007ef62cebSEmmanuel Vadot
1017ef62cebSEmmanuel Vadot    required:
1027ef62cebSEmmanuel Vadot      - pins
1037ef62cebSEmmanuel Vadot      - function
1047ef62cebSEmmanuel Vadot
1057ef62cebSEmmanuel Vadot    additionalProperties: false
1067ef62cebSEmmanuel Vadot
1077ef62cebSEmmanuel Vadotrequired:
1087ef62cebSEmmanuel Vadot  - compatible
1097ef62cebSEmmanuel Vadot  - reg
1107ef62cebSEmmanuel Vadot  - interrupts
1117ef62cebSEmmanuel Vadot  - interrupt-controller
1127ef62cebSEmmanuel Vadot  - '#interrupt-cells'
1137ef62cebSEmmanuel Vadot  - gpio-controller
1147ef62cebSEmmanuel Vadot  - '#gpio-cells'
1157ef62cebSEmmanuel Vadot
1167ef62cebSEmmanuel VadotadditionalProperties: false
1177ef62cebSEmmanuel Vadot
1187ef62cebSEmmanuel VadotallOf:
119fac71e4eSEmmanuel Vadot  - $ref: pinctrl.yaml#
1207ef62cebSEmmanuel Vadot
1217ef62cebSEmmanuel Vadotexamples:
1227ef62cebSEmmanuel Vadot  - |
1237ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1247ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
1257ef62cebSEmmanuel Vadot
1267ef62cebSEmmanuel Vadot    i2c {
1277ef62cebSEmmanuel Vadot      #address-cells = <1>;
1287ef62cebSEmmanuel Vadot      #size-cells = <0>;
1297ef62cebSEmmanuel Vadot
1307ef62cebSEmmanuel Vadot      pinctrl@20 {
1317ef62cebSEmmanuel Vadot        compatible = "cypress,cy8c9520";
1327ef62cebSEmmanuel Vadot        reg = <0x20>;
1337ef62cebSEmmanuel Vadot        gpio-controller;
1347ef62cebSEmmanuel Vadot        #gpio-cells = <2>;
1357ef62cebSEmmanuel Vadot        #interrupt-cells = <2>;
1367ef62cebSEmmanuel Vadot        interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
1377ef62cebSEmmanuel Vadot        interrupt-controller;
1387ef62cebSEmmanuel Vadot        vdd-supply = <&p3v3>;
139*01950c46SEmmanuel Vadot        gpio-reserved-ranges = <1 2>, <6 1>, <10 1>, <15 1>;
140*01950c46SEmmanuel Vadot
141*01950c46SEmmanuel Vadot        pinctrl-0 = <&U62160_pins>, <&U62160_ipins>;
142*01950c46SEmmanuel Vadot        pinctrl-names = "default";
143*01950c46SEmmanuel Vadot
144*01950c46SEmmanuel Vadot        U62160_pins: cfg-pins {
145*01950c46SEmmanuel Vadot          pins = "gp03", "gp16", "gp20", "gp50", "gp51";
146*01950c46SEmmanuel Vadot          function = "gpio";
147*01950c46SEmmanuel Vadot          input-enable;
148*01950c46SEmmanuel Vadot          bias-pull-up;
149*01950c46SEmmanuel Vadot        };
150*01950c46SEmmanuel Vadot
151*01950c46SEmmanuel Vadot        U62160_ipins: icfg-pins {
152*01950c46SEmmanuel Vadot          pins = "gp04", "gp17", "gp21", "gp52", "gp53";
153*01950c46SEmmanuel Vadot          function = "gpio";
154*01950c46SEmmanuel Vadot          input-enable;
155*01950c46SEmmanuel Vadot          bias-pull-up;
156*01950c46SEmmanuel Vadot        };
1577ef62cebSEmmanuel Vadot      };
1587ef62cebSEmmanuel Vadot    };
159