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