xref: /linux/Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml (revision cf9610f9116d55c5a66ef9f1faecacabd93a9322)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/microchip,pic32mzda-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Microchip PIC32 Pin Controller
8
9maintainers:
10  - Linus Walleij <linusw@kernel.org>
11
12description:
13  PIC32 pin configuration node is a node of a group of pins which can be used
14  for a specific device or function. This node represents configurations of
15  pins, optional function, and optional mux related configuration.
16
17properties:
18  compatible:
19    const: microchip,pic32mzda-pinctrl
20
21  reg:
22    maxItems: 1
23
24  clocks:
25    maxItems: 1
26
27$defs:
28  pin-node:
29    type: object
30    allOf:
31      - $ref: /schemas/pinctrl/pincfg-node.yaml#
32      - $ref: /schemas/pinctrl/pinmux-node.yaml#
33
34    properties:
35      pins:
36        description: List of pins to which the configuration applies.
37        items:
38          type: string
39        minItems: 1
40
41      function: true
42
43      bias-pull-up: true
44      bias-pull-down: true
45      input-enable: true
46      output-low: true
47      output-high: true
48
49      microchip,digital:
50        description: Enable digital I/O.
51        type: boolean
52
53      microchip,analog:
54        description: Enable analog I/O.
55        type: boolean
56
57    required:
58      - pins
59
60    unevaluatedProperties: false
61
62additionalProperties:
63  oneOf:
64    - additionalProperties:
65        $ref: '#/$defs/pin-node'
66    - $ref: '#/$defs/pin-node'
67
68required:
69  - compatible
70  - reg
71  - clocks
72
73examples:
74  - |
75    #include <dt-bindings/clock/microchip,pic32-clock.h>
76    #include <dt-bindings/interrupt-controller/irq.h>
77
78    pic32_pinctrl: pinctrl@1f801400 {
79        compatible = "microchip,pic32mzda-pinctrl";
80        reg = <0x1f801400 0x400>;
81        clocks = <&rootclk PB1CLK>;
82
83        pinctrl_uart2: pinctrl_uart2 {
84            uart2-tx {
85                pins = "G9";
86                function = "U2TX";
87                microchip,digital;
88                output-low;
89            };
90
91            uart2-rx {
92                pins = "B0";
93                function = "U2RX";
94                microchip,digital;
95                input-enable;
96            };
97        };
98    };
99
100    uart2: serial@1f822200 {
101        compatible = "microchip,pic32mzda-uart";
102        reg = <0x1f822200 0x50>;
103        interrupts = <145 IRQ_TYPE_LEVEL_HIGH>,
104                     <146 IRQ_TYPE_LEVEL_HIGH>,
105                     <147 IRQ_TYPE_LEVEL_HIGH>;
106        clocks = <&rootclk PB2CLK>;
107        pinctrl-names = "default";
108        pinctrl-0 = <&pinctrl_uart2>;
109    };
110