xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/semtech,sx1501q.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1*8bab661aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*8bab661aSEmmanuel Vadot# Copyright 2022 Linaro Ltd.
3*8bab661aSEmmanuel Vadot%YAML 1.2
4*8bab661aSEmmanuel Vadot---
5*8bab661aSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/semtech,sx1501q.yaml#
6*8bab661aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7*8bab661aSEmmanuel Vadot
8*8bab661aSEmmanuel Vadottitle: Semtech SX150x GPIO expander
9*8bab661aSEmmanuel Vadot
10*8bab661aSEmmanuel Vadotmaintainers:
11*8bab661aSEmmanuel Vadot  - Neil Armstrong <neil.armstrong@linaro.org>
12*8bab661aSEmmanuel Vadot
13*8bab661aSEmmanuel Vadotproperties:
14*8bab661aSEmmanuel Vadot  compatible:
15*8bab661aSEmmanuel Vadot    enum:
16*8bab661aSEmmanuel Vadot      - semtech,sx1501q
17*8bab661aSEmmanuel Vadot      - semtech,sx1502q
18*8bab661aSEmmanuel Vadot      - semtech,sx1503q
19*8bab661aSEmmanuel Vadot      - semtech,sx1504q
20*8bab661aSEmmanuel Vadot      - semtech,sx1505q
21*8bab661aSEmmanuel Vadot      - semtech,sx1506q
22*8bab661aSEmmanuel Vadot      - semtech,sx1507q
23*8bab661aSEmmanuel Vadot      - semtech,sx1508q
24*8bab661aSEmmanuel Vadot      - semtech,sx1509q
25*8bab661aSEmmanuel Vadot
26*8bab661aSEmmanuel Vadot  reg:
27*8bab661aSEmmanuel Vadot    maxItems: 1
28*8bab661aSEmmanuel Vadot
29*8bab661aSEmmanuel Vadot  interrupts:
30*8bab661aSEmmanuel Vadot    maxItems: 1
31*8bab661aSEmmanuel Vadot
32*8bab661aSEmmanuel Vadot  '#interrupt-cells':
33*8bab661aSEmmanuel Vadot    const: 2
34*8bab661aSEmmanuel Vadot
35*8bab661aSEmmanuel Vadot  interrupt-controller: true
36*8bab661aSEmmanuel Vadot
37*8bab661aSEmmanuel Vadot  '#gpio-cells':
38*8bab661aSEmmanuel Vadot    const: 2
39*8bab661aSEmmanuel Vadot
40*8bab661aSEmmanuel Vadot  gpio-controller: true
41*8bab661aSEmmanuel Vadot
42*8bab661aSEmmanuel Vadot  semtech,probe-reset:
43*8bab661aSEmmanuel Vadot    description: Will trigger a reset of the GPIO expander on probe
44*8bab661aSEmmanuel Vadot    type: boolean
45*8bab661aSEmmanuel Vadot
46*8bab661aSEmmanuel VadotpatternProperties:
47*8bab661aSEmmanuel Vadot  '-cfg$':
48*8bab661aSEmmanuel Vadot    type: object
49*8bab661aSEmmanuel Vadot    properties:
50*8bab661aSEmmanuel Vadot      pins: true
51*8bab661aSEmmanuel Vadot
52*8bab661aSEmmanuel Vadot      bias-disable: true
53*8bab661aSEmmanuel Vadot      bias-pull-up: true
54*8bab661aSEmmanuel Vadot      bias-pull-down: true
55*8bab661aSEmmanuel Vadot      bias-pull-pin-default: true
56*8bab661aSEmmanuel Vadot      drive-push-pull: true
57*8bab661aSEmmanuel Vadot      output-low: true
58*8bab661aSEmmanuel Vadot      output-high: true
59*8bab661aSEmmanuel Vadot      drive-open-drain: true
60*8bab661aSEmmanuel Vadot
61*8bab661aSEmmanuel Vadot    required:
62*8bab661aSEmmanuel Vadot      - pins
63*8bab661aSEmmanuel Vadot
64*8bab661aSEmmanuel Vadot    allOf:
65*8bab661aSEmmanuel Vadot      - $ref: "pincfg-node.yaml#"
66*8bab661aSEmmanuel Vadot      - $ref: "pinmux-node.yaml#"
67*8bab661aSEmmanuel Vadot      - if:
68*8bab661aSEmmanuel Vadot          properties:
69*8bab661aSEmmanuel Vadot            pins:
70*8bab661aSEmmanuel Vadot              contains:
71*8bab661aSEmmanuel Vadot                const: oscio
72*8bab661aSEmmanuel Vadot        then:
73*8bab661aSEmmanuel Vadot          properties:
74*8bab661aSEmmanuel Vadot            bias-disable: false
75*8bab661aSEmmanuel Vadot            bias-pull-up: false
76*8bab661aSEmmanuel Vadot            bias-pull-down: false
77*8bab661aSEmmanuel Vadot            bias-pull-pin-default: false
78*8bab661aSEmmanuel Vadot            drive-open-drain: false
79*8bab661aSEmmanuel Vadot
80*8bab661aSEmmanuel Vadot    additionalProperties: false
81*8bab661aSEmmanuel Vadot
82*8bab661aSEmmanuel Vadotrequired:
83*8bab661aSEmmanuel Vadot  - compatible
84*8bab661aSEmmanuel Vadot  - reg
85*8bab661aSEmmanuel Vadot  - '#gpio-cells'
86*8bab661aSEmmanuel Vadot  - gpio-controller
87*8bab661aSEmmanuel Vadot
88*8bab661aSEmmanuel VadotallOf:
89*8bab661aSEmmanuel Vadot  - $ref: "pinctrl.yaml#"
90*8bab661aSEmmanuel Vadot  - if:
91*8bab661aSEmmanuel Vadot      not:
92*8bab661aSEmmanuel Vadot        properties:
93*8bab661aSEmmanuel Vadot          compatible:
94*8bab661aSEmmanuel Vadot            contains:
95*8bab661aSEmmanuel Vadot              enum:
96*8bab661aSEmmanuel Vadot                - semtech,sx1507q
97*8bab661aSEmmanuel Vadot                - semtech,sx1508q
98*8bab661aSEmmanuel Vadot                - semtech,sx1509q
99*8bab661aSEmmanuel Vadot    then:
100*8bab661aSEmmanuel Vadot      properties:
101*8bab661aSEmmanuel Vadot        semtech,probe-reset: false
102*8bab661aSEmmanuel Vadot  - if:
103*8bab661aSEmmanuel Vadot      properties:
104*8bab661aSEmmanuel Vadot        compatible:
105*8bab661aSEmmanuel Vadot          contains:
106*8bab661aSEmmanuel Vadot            enum:
107*8bab661aSEmmanuel Vadot              - semtech,sx1501q
108*8bab661aSEmmanuel Vadot              - semtech,sx1504q
109*8bab661aSEmmanuel Vadot    then:
110*8bab661aSEmmanuel Vadot      patternProperties:
111*8bab661aSEmmanuel Vadot        '-cfg$':
112*8bab661aSEmmanuel Vadot          properties:
113*8bab661aSEmmanuel Vadot            pins:
114*8bab661aSEmmanuel Vadot              items:
115*8bab661aSEmmanuel Vadot                pattern: '^gpio[0-3]$'
116*8bab661aSEmmanuel Vadot  - if:
117*8bab661aSEmmanuel Vadot      properties:
118*8bab661aSEmmanuel Vadot        compatible:
119*8bab661aSEmmanuel Vadot          contains:
120*8bab661aSEmmanuel Vadot            enum:
121*8bab661aSEmmanuel Vadot              - semtech,sx1502q
122*8bab661aSEmmanuel Vadot              - semtech,sx1505q
123*8bab661aSEmmanuel Vadot    then:
124*8bab661aSEmmanuel Vadot      patternProperties:
125*8bab661aSEmmanuel Vadot        '-cfg$':
126*8bab661aSEmmanuel Vadot          properties:
127*8bab661aSEmmanuel Vadot            pins:
128*8bab661aSEmmanuel Vadot              items:
129*8bab661aSEmmanuel Vadot                pattern: '^gpio[0-7]$'
130*8bab661aSEmmanuel Vadot  - if:
131*8bab661aSEmmanuel Vadot      properties:
132*8bab661aSEmmanuel Vadot        compatible:
133*8bab661aSEmmanuel Vadot          contains:
134*8bab661aSEmmanuel Vadot            enum:
135*8bab661aSEmmanuel Vadot              - semtech,sx1503q
136*8bab661aSEmmanuel Vadot              - semtech,sx1506q
137*8bab661aSEmmanuel Vadot    then:
138*8bab661aSEmmanuel Vadot      patternProperties:
139*8bab661aSEmmanuel Vadot        '-cfg$':
140*8bab661aSEmmanuel Vadot          properties:
141*8bab661aSEmmanuel Vadot            pins:
142*8bab661aSEmmanuel Vadot              items:
143*8bab661aSEmmanuel Vadot                pattern: '^(gpio[0-9]|gpio1[0-5])$'
144*8bab661aSEmmanuel Vadot  - if:
145*8bab661aSEmmanuel Vadot      properties:
146*8bab661aSEmmanuel Vadot        compatible:
147*8bab661aSEmmanuel Vadot          contains:
148*8bab661aSEmmanuel Vadot            const: semtech,sx1507q
149*8bab661aSEmmanuel Vadot    then:
150*8bab661aSEmmanuel Vadot      patternProperties:
151*8bab661aSEmmanuel Vadot        '-cfg$':
152*8bab661aSEmmanuel Vadot          properties:
153*8bab661aSEmmanuel Vadot            pins:
154*8bab661aSEmmanuel Vadot              items:
155*8bab661aSEmmanuel Vadot                pattern: '^(oscio|gpio[0-3])$'
156*8bab661aSEmmanuel Vadot  - if:
157*8bab661aSEmmanuel Vadot      properties:
158*8bab661aSEmmanuel Vadot        compatible:
159*8bab661aSEmmanuel Vadot          contains:
160*8bab661aSEmmanuel Vadot            const: semtech,sx1508q
161*8bab661aSEmmanuel Vadot    then:
162*8bab661aSEmmanuel Vadot      patternProperties:
163*8bab661aSEmmanuel Vadot        '-cfg$':
164*8bab661aSEmmanuel Vadot          properties:
165*8bab661aSEmmanuel Vadot            pins:
166*8bab661aSEmmanuel Vadot              items:
167*8bab661aSEmmanuel Vadot                pattern: '^(oscio|gpio[0-7])$'
168*8bab661aSEmmanuel Vadot  - if:
169*8bab661aSEmmanuel Vadot      properties:
170*8bab661aSEmmanuel Vadot        compatible:
171*8bab661aSEmmanuel Vadot          contains:
172*8bab661aSEmmanuel Vadot            const: semtech,sx1509q
173*8bab661aSEmmanuel Vadot    then:
174*8bab661aSEmmanuel Vadot      patternProperties:
175*8bab661aSEmmanuel Vadot        '-cfg$':
176*8bab661aSEmmanuel Vadot          properties:
177*8bab661aSEmmanuel Vadot            pins:
178*8bab661aSEmmanuel Vadot              items:
179*8bab661aSEmmanuel Vadot                pattern: '^(oscio|gpio[0-9]|gpio1[0-5])$'
180*8bab661aSEmmanuel Vadot
181*8bab661aSEmmanuel VadotadditionalProperties: false
182*8bab661aSEmmanuel Vadot
183*8bab661aSEmmanuel Vadotexamples:
184*8bab661aSEmmanuel Vadot  - |
185*8bab661aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
186*8bab661aSEmmanuel Vadot    i2c@1000 {
187*8bab661aSEmmanuel Vadot        reg = <0x1000 0x80>;
188*8bab661aSEmmanuel Vadot        #address-cells = <1>;
189*8bab661aSEmmanuel Vadot        #size-cells = <0>;
190*8bab661aSEmmanuel Vadot
191*8bab661aSEmmanuel Vadot        pinctrl@20 {
192*8bab661aSEmmanuel Vadot            compatible = "semtech,sx1501q";
193*8bab661aSEmmanuel Vadot            reg = <0x20>;
194*8bab661aSEmmanuel Vadot
195*8bab661aSEmmanuel Vadot            #gpio-cells = <2>;
196*8bab661aSEmmanuel Vadot            #interrupt-cells = <2>;
197*8bab661aSEmmanuel Vadot
198*8bab661aSEmmanuel Vadot            interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
199*8bab661aSEmmanuel Vadot
200*8bab661aSEmmanuel Vadot            gpio-controller;
201*8bab661aSEmmanuel Vadot            interrupt-controller;
202*8bab661aSEmmanuel Vadot
203*8bab661aSEmmanuel Vadot            gpio1-cfg {
204*8bab661aSEmmanuel Vadot                  pins = "gpio1";
205*8bab661aSEmmanuel Vadot                  bias-pull-up;
206*8bab661aSEmmanuel Vadot            };
207*8bab661aSEmmanuel Vadot        };
208*8bab661aSEmmanuel Vadot    };
209