Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) |
| 2 | %YAML 1.2 |
| 3 | --- |
| 4 | $id: http://devicetree.org/schemas/gpio/microchip,mpfs-gpio.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: Microchip MPFS GPIO Controller |
| 8 | |
| 9 | maintainers: |
| 10 | - Conor Dooley <conor.dooley@microchip.com> |
| 11 | |
| 12 | properties: |
| 13 | compatible: |
| 14 | items: |
| 15 | - enum: |
| 16 | - microchip,mpfs-gpio |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 17 | - microchip,coregpio-rtl-v3 |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 18 | |
| 19 | reg: |
| 20 | maxItems: 1 |
| 21 | |
| 22 | interrupts: |
| 23 | description: |
| 24 | Interrupt mapping, one per GPIO. Maximum 32 GPIOs. |
| 25 | minItems: 1 |
| 26 | maxItems: 32 |
| 27 | |
| 28 | interrupt-controller: true |
| 29 | |
| 30 | clocks: |
| 31 | maxItems: 1 |
| 32 | |
| 33 | "#gpio-cells": |
| 34 | const: 2 |
| 35 | |
| 36 | "#interrupt-cells": |
| 37 | const: 1 |
| 38 | |
| 39 | ngpios: |
| 40 | description: |
| 41 | The number of GPIOs available. |
| 42 | minimum: 1 |
| 43 | maximum: 32 |
| 44 | default: 32 |
| 45 | |
| 46 | gpio-controller: true |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 47 | gpio-line-names: true |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 48 | |
| 49 | patternProperties: |
| 50 | "^.+-hog(-[0-9]+)?$": |
| 51 | type: object |
| 52 | |
| 53 | additionalProperties: false |
| 54 | |
| 55 | properties: |
| 56 | gpio-hog: true |
| 57 | gpios: true |
| 58 | input: true |
| 59 | output-high: true |
| 60 | output-low: true |
| 61 | line-name: true |
| 62 | |
| 63 | required: |
| 64 | - gpio-hog |
| 65 | - gpios |
| 66 | |
Tom Rini | 762f85b | 2024-07-20 11:15:10 -0600 | [diff] [blame] | 67 | allOf: |
| 68 | - if: |
| 69 | properties: |
| 70 | compatible: |
| 71 | contains: |
| 72 | const: microchip,mpfs-gpio |
| 73 | then: |
| 74 | required: |
| 75 | - interrupts |
| 76 | - "#interrupt-cells" |
| 77 | - interrupt-controller |
| 78 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 79 | required: |
| 80 | - compatible |
| 81 | - reg |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 82 | - "#gpio-cells" |
| 83 | - gpio-controller |
| 84 | - clocks |
| 85 | |
| 86 | additionalProperties: false |
| 87 | |
| 88 | examples: |
| 89 | - | |
| 90 | gpio@20122000 { |
| 91 | compatible = "microchip,mpfs-gpio"; |
| 92 | reg = <0x20122000 0x1000>; |
| 93 | clocks = <&clkcfg 25>; |
| 94 | interrupt-parent = <&plic>; |
| 95 | gpio-controller; |
| 96 | #gpio-cells = <2>; |
| 97 | interrupt-controller; |
| 98 | #interrupt-cells = <1>; |
| 99 | interrupts = <53>, <53>, <53>, <53>, |
| 100 | <53>, <53>, <53>, <53>, |
| 101 | <53>, <53>, <53>, <53>, |
| 102 | <53>, <53>, <53>, <53>, |
| 103 | <53>, <53>, <53>, <53>, |
| 104 | <53>, <53>, <53>, <53>, |
| 105 | <53>, <53>, <53>, <53>, |
| 106 | <53>, <53>, <53>, <53>; |
| 107 | }; |
| 108 | ... |