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