1 STMicroelectronics Multi-Function eXpander (STMFX) GPIO expander bindings
3 ST Multi-Function eXpander (STMFX) offers up to 24 GPIOs expansion.
4 Please refer to ../mfd/stmfx.txt for STMFX Core bindings.
7 - compatible: should be "st,stmfx-0300-pinctrl".
8 - #gpio-cells: should be <2>, the first cell is the GPIO number and the second
9 cell is the gpio flags in accordance with <dt-bindings/gpio/gpio.h>.
10 - gpio-controller: marks the device as a GPIO controller.
11 - #interrupt-cells: should be <2>, the first cell is the GPIO number and the
12 second cell is the interrupt flags in accordance with
13 <dt-bindings/interrupt-controller/irq.h>.
14 - interrupt-controller: marks the device as an interrupt controller.
15 - gpio-ranges: specifies the mapping between gpio controller and pin
16 controller pins. Check "Concerning gpio-ranges property" below.
17 Please refer to ../gpio/gpio.txt.
19 Please refer to pinctrl-bindings.txt for pin configuration.
21 Required properties for pin configuration sub-nodes:
22 - pins: list of pins to which the configuration applies.
24 Optional properties for pin configuration sub-nodes (pinconf-generic ones):
25 - bias-disable: disable any bias on the pin.
26 - bias-pull-up: the pin will be pulled up.
27 - bias-pull-pin-default: use the pin-default pull state.
28 - bias-pull-down: the pin will be pulled down.
29 - drive-open-drain: the pin will be driven with open drain.
30 - drive-push-pull: the pin will be driven actively high and low.
31 - output-high: the pin will be configured as an output driving high level.
32 - output-low: the pin will be configured as an output driving low level.
34 Note that STMFX pins[15:0] are called "gpio[15:0]", and STMFX pins[23:16] are
35 called "agpio[7:0]". Example, to refer to pin 18 of STMFX, use "agpio2".
37 Concerning gpio-ranges property:
38 - if all STMFX pins[24:0] are available (no other STMFX function in use), you
39 should use gpio-ranges = <&stmfx_pinctrl 0 0 24>;
40 - if agpio[3:0] are not available (STMFX Touchscreen function in use), you
41 should use gpio-ranges = <&stmfx_pinctrl 0 0 16>, <&stmfx_pinctrl 20 20 4>;
42 - if agpio[7:4] are not available (STMFX IDD function in use), you
43 should use gpio-ranges = <&stmfx_pinctrl 0 0 20>;
51 stmfx_pinctrl: stmfx-pin-controller {
52 compatible = "st,stmfx-0300-pinctrl";
54 #interrupt-cells = <2>;
57 gpio-ranges = <&stmfx_pinctrl 0 0 24>;
59 joystick_pins: joystick {
60 pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
67 Example of STMFX GPIO consumers:
70 compatible = "gpio-keys";
73 pinctrl-0 = <&joystick_pins>;
74 pinctrl-names = "default";
77 linux,code = <KEY_ENTER>;
78 interrupt-parent = <&stmfx_pinctrl>;
79 interrupts = <0 IRQ_TYPE_EDGE_RISING>;
83 linux,code = <KEY_DOWN>;
84 interrupt-parent = <&stmfx_pinctrl>;
85 interrupts = <1 IRQ_TYPE_EDGE_RISING>;
89 linux,code = <KEY_LEFT>;
90 interrupt-parent = <&stmfx_pinctrl>;
91 interrupts = <2 IRQ_TYPE_EDGE_RISING>;
95 linux,code = <KEY_RIGHT>;
96 interrupt-parent = <&stmfx_pinctrl>;
97 interrupts = <3 IRQ_TYPE_EDGE_RISING>;
101 linux,code = <KEY_UP>;
102 interrupt-parent = <&stmfx_pinctrl>;
103 interrupts = <4 IRQ_TYPE_EDGE_RISING>;
108 compatible = "gpio-leds";
110 gpios = <&stmfx_pinctrl 17 1>;
114 gpios = <&stmfx_pinctrl 19 1>;