xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/pinctrl-single.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2aa1a8ff2SEmmanuel Vadot%YAML 1.2
3aa1a8ff2SEmmanuel Vadot---
4aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/pinctrl-single.yaml#
5aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6aa1a8ff2SEmmanuel Vadot
7aa1a8ff2SEmmanuel Vadottitle: Generic Pin Controller with a Single Register for One or More Pins
8aa1a8ff2SEmmanuel Vadot
9aa1a8ff2SEmmanuel Vadotmaintainers:
10aa1a8ff2SEmmanuel Vadot  - Tony Lindgren <tony@atomide.com>
11aa1a8ff2SEmmanuel Vadot
12aa1a8ff2SEmmanuel Vadotdescription:
13aa1a8ff2SEmmanuel Vadot  Some pin controller devices use a single register for one or more pins. The
14aa1a8ff2SEmmanuel Vadot  range of pin control registers can vary from one to many for each controller
15aa1a8ff2SEmmanuel Vadot  instance. Some SoCs from Altera, Broadcom, HiSilicon, Ralink, and TI have this
16aa1a8ff2SEmmanuel Vadot  kind of pin controller instances.
17aa1a8ff2SEmmanuel Vadot
18aa1a8ff2SEmmanuel Vadotproperties:
19aa1a8ff2SEmmanuel Vadot  compatible:
20aa1a8ff2SEmmanuel Vadot    oneOf:
21aa1a8ff2SEmmanuel Vadot      - enum:
22aa1a8ff2SEmmanuel Vadot          - pinctrl-single
23aa1a8ff2SEmmanuel Vadot          - pinconf-single
24aa1a8ff2SEmmanuel Vadot      - items:
25aa1a8ff2SEmmanuel Vadot          - enum:
26aa1a8ff2SEmmanuel Vadot              - ti,am437-padconf
27aa1a8ff2SEmmanuel Vadot              - ti,am654-padconf
28aa1a8ff2SEmmanuel Vadot              - ti,dra7-padconf
29aa1a8ff2SEmmanuel Vadot              - ti,omap2420-padconf
30aa1a8ff2SEmmanuel Vadot              - ti,omap2430-padconf
31aa1a8ff2SEmmanuel Vadot              - ti,omap3-padconf
32aa1a8ff2SEmmanuel Vadot              - ti,omap4-padconf
33aa1a8ff2SEmmanuel Vadot              - ti,omap5-padconf
34*8d13bc63SEmmanuel Vadot              - ti,j7200-padconf
35aa1a8ff2SEmmanuel Vadot          - const: pinctrl-single
36aa1a8ff2SEmmanuel Vadot
37aa1a8ff2SEmmanuel Vadot  reg:
38aa1a8ff2SEmmanuel Vadot    maxItems: 1
39aa1a8ff2SEmmanuel Vadot
40aa1a8ff2SEmmanuel Vadot  interrupt-controller: true
41aa1a8ff2SEmmanuel Vadot
42aa1a8ff2SEmmanuel Vadot  '#interrupt-cells':
43aa1a8ff2SEmmanuel Vadot    const: 1
44aa1a8ff2SEmmanuel Vadot
45aa1a8ff2SEmmanuel Vadot  '#address-cells':
46aa1a8ff2SEmmanuel Vadot    const: 1
47aa1a8ff2SEmmanuel Vadot
48aa1a8ff2SEmmanuel Vadot  '#size-cells':
49aa1a8ff2SEmmanuel Vadot    const: 0
50aa1a8ff2SEmmanuel Vadot
51aa1a8ff2SEmmanuel Vadot  '#pinctrl-cells':
52aa1a8ff2SEmmanuel Vadot    description:
53aa1a8ff2SEmmanuel Vadot      Number of cells. Usually 2, consisting of register offset, pin configuration
54aa1a8ff2SEmmanuel Vadot      value, and pinmux mode. Some controllers may use 1 for just offset and value.
55aa1a8ff2SEmmanuel Vadot    enum: [ 1, 2 ]
56aa1a8ff2SEmmanuel Vadot
57aa1a8ff2SEmmanuel Vadot  pinctrl-single,bit-per-mux:
58aa1a8ff2SEmmanuel Vadot    description: Optional flag to indicate register controls more than one pin
59aa1a8ff2SEmmanuel Vadot    type: boolean
60aa1a8ff2SEmmanuel Vadot
61aa1a8ff2SEmmanuel Vadot  pinctrl-single,function-mask:
62aa1a8ff2SEmmanuel Vadot    description: Mask of the allowed register bits
63aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
64aa1a8ff2SEmmanuel Vadot
65aa1a8ff2SEmmanuel Vadot  pinctrl-single,function-off:
66aa1a8ff2SEmmanuel Vadot    description: Optional function off mode for disabled state
67aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
68aa1a8ff2SEmmanuel Vadot
69aa1a8ff2SEmmanuel Vadot  pinctrl-single,register-width:
70aa1a8ff2SEmmanuel Vadot    description: Width of pin specific bits in the register
71aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
72aa1a8ff2SEmmanuel Vadot    enum: [ 8, 16, 32 ]
73aa1a8ff2SEmmanuel Vadot
74aa1a8ff2SEmmanuel Vadot  pinctrl-single,gpio-range:
75aa1a8ff2SEmmanuel Vadot    description: Optional list of pin base, nr pins & gpio function
76aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle-array
77aa1a8ff2SEmmanuel Vadot    items:
78aa1a8ff2SEmmanuel Vadot      - items:
79aa1a8ff2SEmmanuel Vadot          - description: phandle of a gpio-range node
80aa1a8ff2SEmmanuel Vadot          - description: pin base
81aa1a8ff2SEmmanuel Vadot          - description: number of pins
82aa1a8ff2SEmmanuel Vadot          - description: gpio function
83aa1a8ff2SEmmanuel Vadot
84aa1a8ff2SEmmanuel Vadot  '#gpio-range-cells':
85aa1a8ff2SEmmanuel Vadot    description: No longer needed, may exist in older files for gpio-ranges
86aa1a8ff2SEmmanuel Vadot    deprecated: true
87aa1a8ff2SEmmanuel Vadot    const: 3
88aa1a8ff2SEmmanuel Vadot
89aa1a8ff2SEmmanuel Vadot  gpio-range:
90aa1a8ff2SEmmanuel Vadot    description: Optional node for gpio range cells
91aa1a8ff2SEmmanuel Vadot    type: object
92aa1a8ff2SEmmanuel Vadot    additionalProperties: false
93aa1a8ff2SEmmanuel Vadot    properties:
94aa1a8ff2SEmmanuel Vadot      '#pinctrl-single,gpio-range-cells':
95aa1a8ff2SEmmanuel Vadot        description: Number of gpio range cells
96aa1a8ff2SEmmanuel Vadot        const: 3
97aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
98aa1a8ff2SEmmanuel Vadot
99aa1a8ff2SEmmanuel VadotpatternProperties:
100aa1a8ff2SEmmanuel Vadot  '-pins(-[0-9]+)?$|-pin$':
101aa1a8ff2SEmmanuel Vadot    description:
102aa1a8ff2SEmmanuel Vadot      Pin group node name using naming ending in -pins followed by an optional
103aa1a8ff2SEmmanuel Vadot      instance number
104aa1a8ff2SEmmanuel Vadot    type: object
105aa1a8ff2SEmmanuel Vadot    additionalProperties: false
106aa1a8ff2SEmmanuel Vadot
107aa1a8ff2SEmmanuel Vadot    properties:
108aa1a8ff2SEmmanuel Vadot      pinctrl-single,pins:
109aa1a8ff2SEmmanuel Vadot        description:
110aa1a8ff2SEmmanuel Vadot          Array of pins as described in pinmux-node.yaml for pinctrl-pin-array
111aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
112aa1a8ff2SEmmanuel Vadot
113aa1a8ff2SEmmanuel Vadot      pinctrl-single,bits:
114aa1a8ff2SEmmanuel Vadot        description: Register bit configuration for pinctrl-single,bit-per-mux
115aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
116aa1a8ff2SEmmanuel Vadot        items:
117aa1a8ff2SEmmanuel Vadot          - description: register offset
118aa1a8ff2SEmmanuel Vadot          - description: value
119aa1a8ff2SEmmanuel Vadot          - description: pin bitmask in the register
120aa1a8ff2SEmmanuel Vadot
121aa1a8ff2SEmmanuel Vadot      pinctrl-single,bias-pullup:
122aa1a8ff2SEmmanuel Vadot        description: Optional bias pull up configuration
123aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
124aa1a8ff2SEmmanuel Vadot        items:
125aa1a8ff2SEmmanuel Vadot          - description: input
126aa1a8ff2SEmmanuel Vadot          - description: enabled pull up bits
127aa1a8ff2SEmmanuel Vadot          - description: disabled pull up bits
128aa1a8ff2SEmmanuel Vadot          - description: bias pull up mask
129aa1a8ff2SEmmanuel Vadot
130aa1a8ff2SEmmanuel Vadot      pinctrl-single,bias-pulldown:
131aa1a8ff2SEmmanuel Vadot        description: Optional bias pull down configuration
132aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
133aa1a8ff2SEmmanuel Vadot        items:
134aa1a8ff2SEmmanuel Vadot          - description: input
135aa1a8ff2SEmmanuel Vadot          - description: enabled pull down bits
136aa1a8ff2SEmmanuel Vadot          - description: disabled pull down bits
137aa1a8ff2SEmmanuel Vadot          - description: bias pull down mask
138aa1a8ff2SEmmanuel Vadot
139aa1a8ff2SEmmanuel Vadot      pinctrl-single,drive-strength:
140aa1a8ff2SEmmanuel Vadot        description: Optional drive strength configuration
141aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
142aa1a8ff2SEmmanuel Vadot        items:
143aa1a8ff2SEmmanuel Vadot          - description: drive strength current
144aa1a8ff2SEmmanuel Vadot          - description: drive strength mask
145aa1a8ff2SEmmanuel Vadot
146aa1a8ff2SEmmanuel Vadot      pinctrl-single,input-schmitt:
147aa1a8ff2SEmmanuel Vadot        description: Optional input schmitt configuration
148aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
149aa1a8ff2SEmmanuel Vadot        items:
150aa1a8ff2SEmmanuel Vadot          - description: input
151aa1a8ff2SEmmanuel Vadot          - description: enable bits
152aa1a8ff2SEmmanuel Vadot          - description: disable bits
153aa1a8ff2SEmmanuel Vadot          - description: input schmitt mask
154aa1a8ff2SEmmanuel Vadot
155aa1a8ff2SEmmanuel Vadot      pinctrl-single,low-power-mode:
156aa1a8ff2SEmmanuel Vadot        description: Optional low power mode configuration
157aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
158aa1a8ff2SEmmanuel Vadot        items:
159aa1a8ff2SEmmanuel Vadot          - description: low power mode value
160aa1a8ff2SEmmanuel Vadot          - description: low power mode mask
161aa1a8ff2SEmmanuel Vadot
162aa1a8ff2SEmmanuel Vadot      pinctrl-single,slew-rate:
163aa1a8ff2SEmmanuel Vadot        description: Optional slew rate configuration
164aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-array
165aa1a8ff2SEmmanuel Vadot        items:
166aa1a8ff2SEmmanuel Vadot          - description: slew rate
167aa1a8ff2SEmmanuel Vadot          - description: slew rate mask
168aa1a8ff2SEmmanuel Vadot
169aa1a8ff2SEmmanuel VadotallOf:
170aa1a8ff2SEmmanuel Vadot  - $ref: pinctrl.yaml#
171aa1a8ff2SEmmanuel Vadot
172aa1a8ff2SEmmanuel Vadotrequired:
173aa1a8ff2SEmmanuel Vadot  - compatible
174aa1a8ff2SEmmanuel Vadot  - reg
175aa1a8ff2SEmmanuel Vadot  - pinctrl-single,register-width
176aa1a8ff2SEmmanuel Vadot
177aa1a8ff2SEmmanuel VadotadditionalProperties: false
178aa1a8ff2SEmmanuel Vadot
179aa1a8ff2SEmmanuel Vadotexamples:
180aa1a8ff2SEmmanuel Vadot  - |
181aa1a8ff2SEmmanuel Vadot    soc {
182aa1a8ff2SEmmanuel Vadot      #address-cells = <1>;
183aa1a8ff2SEmmanuel Vadot      #size-cells = <1>;
184aa1a8ff2SEmmanuel Vadot
185aa1a8ff2SEmmanuel Vadot      pinmux@4a100040 {
186aa1a8ff2SEmmanuel Vadot        compatible = "pinctrl-single";
187aa1a8ff2SEmmanuel Vadot        reg = <0x4a100040 0x0196>;
188aa1a8ff2SEmmanuel Vadot        #address-cells = <1>;
189aa1a8ff2SEmmanuel Vadot        #size-cells = <0>;
190aa1a8ff2SEmmanuel Vadot        #pinctrl-cells = <2>;
191aa1a8ff2SEmmanuel Vadot        #interrupt-cells = <1>;
192aa1a8ff2SEmmanuel Vadot        interrupt-controller;
193aa1a8ff2SEmmanuel Vadot        pinctrl-single,register-width = <16>;
194aa1a8ff2SEmmanuel Vadot        pinctrl-single,function-mask = <0xffff>;
195aa1a8ff2SEmmanuel Vadot        pinctrl-single,gpio-range = <&range 0 3 0>;
196aa1a8ff2SEmmanuel Vadot        range: gpio-range {
197aa1a8ff2SEmmanuel Vadot          #pinctrl-single,gpio-range-cells = <3>;
198aa1a8ff2SEmmanuel Vadot        };
199aa1a8ff2SEmmanuel Vadot
200aa1a8ff2SEmmanuel Vadot        uart2-pins {
201aa1a8ff2SEmmanuel Vadot          pinctrl-single,pins =
202aa1a8ff2SEmmanuel Vadot            <0xd8 0x118>,
203aa1a8ff2SEmmanuel Vadot            <0xda 0>,
204aa1a8ff2SEmmanuel Vadot            <0xdc 0x118>,
205aa1a8ff2SEmmanuel Vadot            <0xde 0>;
206aa1a8ff2SEmmanuel Vadot        };
207aa1a8ff2SEmmanuel Vadot      };
208aa1a8ff2SEmmanuel Vadot    };
209