Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: mfd: Convert stmfx bindings to json-schema

Convert stmfx bindings to json-schema.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Benjamin Gaignard and committed by
Lee Jones
e8da9ed0 c61e1658

+124 -144
+124
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 + additionalProperties: false 79 + 80 + required: 81 + - compatible 82 + - "#gpio-cells" 83 + - "#interrupt-cells" 84 + - gpio-controller 85 + - interrupt-controller 86 + - gpio-ranges 87 + 88 + additionalProperties: false 89 + 90 + required: 91 + - compatible 92 + - reg 93 + - interrupts 94 + 95 + examples: 96 + - | 97 + #include <dt-bindings/interrupt-controller/arm-gic.h> 98 + i2c@0 { 99 + #address-cells = <1>; 100 + #size-cells = <0>; 101 + stmfx@42 { 102 + compatible = "st,stmfx-0300"; 103 + reg = <0x42>; 104 + interrupts = <8 IRQ_TYPE_EDGE_RISING>; 105 + interrupt-parent = <&gpioi>; 106 + vdd-supply = <&v3v3>; 107 + 108 + stmfx_pinctrl: pinctrl { 109 + compatible = "st,stmfx-0300-pinctrl"; 110 + #gpio-cells = <2>; 111 + #interrupt-cells = <2>; 112 + gpio-controller; 113 + interrupt-controller; 114 + gpio-ranges = <&stmfx_pinctrl 0 0 24>; 115 + 116 + joystick_pins: joystick-pins { 117 + pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4"; 118 + drive-push-pull; 119 + bias-pull-up; 120 + }; 121 + }; 122 + }; 123 + }; 124 + ...
-28
Documentation/devicetree/bindings/mfd/stmfx.txt
··· 1 - STMicroelectonics Multi-Function eXpander (STMFX) Core bindings 2 - 3 - ST Multi-Function eXpander (STMFX) is a slave controller using I2C for 4 - communication with the main MCU. Its main features are GPIO expansion, main 5 - MCU IDD measurement (IDD is the amount of current that flows through VDD) and 6 - resistive touchscreen controller. 7 - 8 - Required properties: 9 - - compatible: should be "st,stmfx-0300". 10 - - reg: I2C slave address of the device. 11 - - interrupts: interrupt specifier triggered by MFX_IRQ_OUT signal. 12 - Please refer to ../interrupt-controller/interrupt.txt 13 - 14 - Optional properties: 15 - - drive-open-drain: configure MFX_IRQ_OUT as open drain. 16 - - vdd-supply: phandle of the regulator supplying STMFX. 17 - 18 - Example: 19 - 20 - stmfx: stmfx@42 { 21 - compatible = "st,stmfx-0300"; 22 - reg = <0x42>; 23 - interrupts = <8 IRQ_TYPE_EDGE_RISING>; 24 - interrupt-parent = <&gpioi>; 25 - vdd-supply = <&v3v3>; 26 - }; 27 - 28 - Please refer to ../pinctrl/pinctrl-stmfx.txt for STMFX GPIO expander function bindings.
-116
Documentation/devicetree/bindings/pinctrl/pinctrl-stmfx.txt
··· 1 - STMicroelectronics Multi-Function eXpander (STMFX) GPIO expander bindings 2 - 3 - ST Multi-Function eXpander (STMFX) offers up to 24 GPIOs expansion. 4 - Please refer to ../mfd/stmfx.txt for STMFX Core bindings. 5 - 6 - Required properties: 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. 18 - 19 - Please refer to pinctrl-bindings.txt for pin configuration. 20 - 21 - Required properties for pin configuration sub-nodes: 22 - - pins: list of pins to which the configuration applies. 23 - 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. 33 - 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". 36 - 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>; 44 - 45 - 46 - Example: 47 - 48 - stmfx: stmfx@42 { 49 - ... 50 - 51 - stmfx_pinctrl: stmfx-pin-controller { 52 - compatible = "st,stmfx-0300-pinctrl"; 53 - #gpio-cells = <2>; 54 - #interrupt-cells = <2>; 55 - gpio-controller; 56 - interrupt-controller; 57 - gpio-ranges = <&stmfx_pinctrl 0 0 24>; 58 - 59 - joystick_pins: joystick { 60 - pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4"; 61 - drive-push-pull; 62 - bias-pull-up; 63 - }; 64 - }; 65 - }; 66 - 67 - Example of STMFX GPIO consumers: 68 - 69 - joystick { 70 - compatible = "gpio-keys"; 71 - #address-cells = <1>; 72 - #size-cells = <0>; 73 - pinctrl-0 = <&joystick_pins>; 74 - pinctrl-names = "default"; 75 - button-0 { 76 - label = "JoySel"; 77 - linux,code = <KEY_ENTER>; 78 - interrupt-parent = <&stmfx_pinctrl>; 79 - interrupts = <0 IRQ_TYPE_EDGE_RISING>; 80 - }; 81 - button-1 { 82 - label = "JoyDown"; 83 - linux,code = <KEY_DOWN>; 84 - interrupt-parent = <&stmfx_pinctrl>; 85 - interrupts = <1 IRQ_TYPE_EDGE_RISING>; 86 - }; 87 - button-2 { 88 - label = "JoyLeft"; 89 - linux,code = <KEY_LEFT>; 90 - interrupt-parent = <&stmfx_pinctrl>; 91 - interrupts = <2 IRQ_TYPE_EDGE_RISING>; 92 - }; 93 - button-3 { 94 - label = "JoyRight"; 95 - linux,code = <KEY_RIGHT>; 96 - interrupt-parent = <&stmfx_pinctrl>; 97 - interrupts = <3 IRQ_TYPE_EDGE_RISING>; 98 - }; 99 - button-4 { 100 - label = "JoyUp"; 101 - linux,code = <KEY_UP>; 102 - interrupt-parent = <&stmfx_pinctrl>; 103 - interrupts = <4 IRQ_TYPE_EDGE_RISING>; 104 - }; 105 - }; 106 - 107 - leds { 108 - compatible = "gpio-leds"; 109 - orange { 110 - gpios = <&stmfx_pinctrl 17 1>; 111 - }; 112 - 113 - blue { 114 - gpios = <&stmfx_pinctrl 19 1>; 115 - }; 116 - }