Merge tag 'spi-fix-v5.9-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / mfd / st,stmfx.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/mfd/st,stmfx.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: STMicroelectonics Multi-Function eXpander (STMFX) bindings
8
9 description: ST Multi-Function eXpander (STMFX) is a slave controller using I2C for
10                communication with the main MCU. Its main features are GPIO expansion,
11                main MCU IDD measurement (IDD is the amount of current that flows
12                through VDD) and resistive touchscreen controller.
13
14 maintainers:
15   - Amelie Delaunay <amelie.delaunay@st.com>
16
17 properties:
18   compatible:
19     const: st,stmfx-0300
20
21   reg:
22     enum: [ 0x42, 0x43 ]
23
24   interrupts:
25     maxItems: 1
26
27   drive-open-drain: true
28
29   vdd-supply:
30     maxItems: 1
31
32   pinctrl:
33     type: object
34
35     properties:
36       compatible:
37         const: st,stmfx-0300-pinctrl
38
39       "#gpio-cells":
40         const: 2
41
42       "#interrupt-cells":
43         const: 2
44
45       gpio-controller: true
46
47       interrupt-controller: true
48
49       gpio-ranges:
50         description: if all STMFX pins[24:0] are available (no other STMFX function in use),
51                      you should use gpio-ranges = <&stmfx_pinctrl 0 0 24>;
52                      if agpio[3:0] are not available (STMFX Touchscreen function in use),
53                      you should use gpio-ranges = <&stmfx_pinctrl 0 0 16>, <&stmfx_pinctrl 20 20 4>;
54                      if agpio[7:4] are not available (STMFX IDD function in use),
55                      you should use gpio-ranges = <&stmfx_pinctrl 0 0 20>;
56         maxItems: 1
57
58     patternProperties:
59       "^[a-zA-Z]*-pins$":
60         type: object
61
62         allOf:
63           - $ref: ../pinctrl/pinmux-node.yaml
64
65         properties:
66           pins: true
67           bias-disable: true
68           bias-pull-up: true
69           bias-pull-pin-default: true
70           bias-pull-down: true
71           drive-open-drain: true
72           drive-push-pull: true
73           output-high: true
74           output-low: true
75
76     additionalProperties: false
77
78     required:
79       - compatible
80       - "#gpio-cells"
81       - "#interrupt-cells"
82       - gpio-controller
83       - interrupt-controller
84       - gpio-ranges
85
86 additionalProperties: false
87
88 required:
89   - compatible
90   - reg
91   - interrupts
92
93 examples:
94   - |
95     #include <dt-bindings/interrupt-controller/arm-gic.h>
96     i2c {
97       #address-cells = <1>;
98       #size-cells = <0>;
99       stmfx@42 {
100         compatible = "st,stmfx-0300";
101         reg = <0x42>;
102         interrupts = <8 IRQ_TYPE_EDGE_RISING>;
103         interrupt-parent = <&gpioi>;
104         vdd-supply = <&v3v3>;
105
106         stmfx_pinctrl: pinctrl {
107           compatible = "st,stmfx-0300-pinctrl";
108           #gpio-cells = <2>;
109           #interrupt-cells = <2>;
110           gpio-controller;
111           interrupt-controller;
112           gpio-ranges = <&stmfx_pinctrl 0 0 24>;
113
114           joystick_pins: joystick-pins {
115             pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
116             drive-push-pull;
117             bias-pull-up;
118           };
119         };
120       };
121     };
122 ...