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

dt-bindings: mfd: Convert stm32 low power timers bindings to json-schema

Convert the STM32 low power timers binding to DT schema format using json-schema

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Benjamin Gaignard and committed by
Rob Herring
b88091f5 b9da2fcc

+120 -130
-29
Documentation/devicetree/bindings/counter/stm32-lptimer-cnt.txt
··· 1 - STMicroelectronics STM32 Low-Power Timer quadrature encoder and counter 2 - 3 - STM32 Low-Power Timer provides several counter modes. It can be used as: 4 - - quadrature encoder to detect angular position and direction of rotary 5 - elements, from IN1 and IN2 input signals. 6 - - simple counter from IN1 input signal. 7 - 8 - Must be a sub-node of an STM32 Low-Power Timer device tree node. 9 - See ../mfd/stm32-lptimer.txt for details about the parent node. 10 - 11 - Required properties: 12 - - compatible: Must be "st,stm32-lptimer-counter". 13 - - pinctrl-names: Set to "default". An additional "sleep" state can be 14 - defined to set pins in sleep state. 15 - - pinctrl-n: List of phandles pointing to pin configuration nodes, 16 - to set IN1/IN2 pins in mode of operation for Low-Power 17 - Timer input on external pin. 18 - 19 - Example: 20 - timer@40002400 { 21 - compatible = "st,stm32-lptimer"; 22 - ... 23 - counter { 24 - compatible = "st,stm32-lptimer-counter"; 25 - pinctrl-names = "default", "sleep"; 26 - pinctrl-0 = <&lptim1_in_pins>; 27 - pinctrl-1 = <&lptim1_sleep_in_pins>; 28 - }; 29 - };
-23
Documentation/devicetree/bindings/iio/timer/stm32-lptimer-trigger.txt
··· 1 - STMicroelectronics STM32 Low-Power Timer Trigger 2 - 3 - STM32 Low-Power Timer provides trigger source (LPTIM output) that can be used 4 - by STM32 internal ADC and/or DAC. 5 - 6 - Must be a sub-node of an STM32 Low-Power Timer device tree node. 7 - See ../mfd/stm32-lptimer.txt for details about the parent node. 8 - 9 - Required properties: 10 - - compatible: Must be "st,stm32-lptimer-trigger". 11 - - reg: Identify trigger hardware block. Must be 0, 1 or 2 12 - respectively for lptimer1, lptimer2 or lptimer3 13 - trigger output. 14 - 15 - Example: 16 - timer@40002400 { 17 - compatible = "st,stm32-lptimer"; 18 - ... 19 - trigger@0 { 20 - compatible = "st,stm32-lptimer-trigger"; 21 - reg = <0>; 22 - }; 23 - };
+120
Documentation/devicetree/bindings/mfd/st,stm32-lptimer.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,stm32-lptimer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: STMicroelectronics STM32 Low-Power Timers bindings 8 + 9 + description: | 10 + The STM32 Low-Power Timer (LPTIM) is a 16-bit timer that provides several 11 + functions 12 + - PWM output (with programmable prescaler, configurable polarity) 13 + - Trigger source for STM32 ADC/DAC (LPTIM_OUT) 14 + - Several counter modes: 15 + - quadrature encoder to detect angular position and direction of rotary 16 + elements, from IN1 and IN2 input signals. 17 + - simple counter from IN1 input signal. 18 + 19 + maintainers: 20 + - Fabrice Gasnier <fabrice.gasnier@st.com> 21 + 22 + properties: 23 + compatible: 24 + const: st,stm32-lptimer 25 + 26 + reg: 27 + maxItems: 1 28 + 29 + clocks: 30 + maxItems: 1 31 + 32 + clock-names: 33 + items: 34 + - const: mux 35 + 36 + "#address-cells": 37 + const: 1 38 + 39 + "#size-cells": 40 + const: 0 41 + 42 + pwm: 43 + type: object 44 + 45 + properties: 46 + compatible: 47 + const: st,stm32-pwm-lp 48 + 49 + "#pwm-cells": 50 + const: 3 51 + 52 + required: 53 + - "#pwm-cells" 54 + - compatible 55 + 56 + patternProperties: 57 + "^trigger@[0-9]+$": 58 + type: object 59 + 60 + properties: 61 + compatible: 62 + const: st,stm32-lptimer-trigger 63 + 64 + reg: 65 + description: Identify trigger hardware block. 66 + items: 67 + minimum: 0 68 + maximum: 2 69 + 70 + required: 71 + - compatible 72 + - reg 73 + 74 + counter: 75 + type: object 76 + 77 + properties: 78 + compatible: 79 + const: st,stm32-lptimer-counter 80 + 81 + required: 82 + - compatible 83 + 84 + required: 85 + - "#address-cells" 86 + - "#size-cells" 87 + - compatible 88 + - reg 89 + - clocks 90 + - clock-names 91 + 92 + additionalProperties: false 93 + 94 + examples: 95 + - | 96 + #include <dt-bindings/clock/stm32mp1-clks.h> 97 + timer@40002400 { 98 + compatible = "st,stm32-lptimer"; 99 + reg = <0x40002400 0x400>; 100 + clocks = <&timer_clk>; 101 + clock-names = "mux"; 102 + #address-cells = <1>; 103 + #size-cells = <0>; 104 + 105 + pwm { 106 + compatible = "st,stm32-pwm-lp"; 107 + #pwm-cells = <3>; 108 + }; 109 + 110 + trigger@0 { 111 + compatible = "st,stm32-lptimer-trigger"; 112 + reg = <0>; 113 + }; 114 + 115 + counter { 116 + compatible = "st,stm32-lptimer-counter"; 117 + }; 118 + }; 119 + 120 + ...
-48
Documentation/devicetree/bindings/mfd/stm32-lptimer.txt
··· 1 - STMicroelectronics STM32 Low-Power Timer 2 - 3 - The STM32 Low-Power Timer (LPTIM) is a 16-bit timer that provides several 4 - functions: 5 - - PWM output (with programmable prescaler, configurable polarity) 6 - - Quadrature encoder, counter 7 - - Trigger source for STM32 ADC/DAC (LPTIM_OUT) 8 - 9 - Required properties: 10 - - compatible: Must be "st,stm32-lptimer". 11 - - reg: Offset and length of the device's register set. 12 - - clocks: Phandle to the clock used by the LP Timer module. 13 - - clock-names: Must be "mux". 14 - - #address-cells: Should be '<1>'. 15 - - #size-cells: Should be '<0>'. 16 - 17 - Optional subnodes: 18 - - pwm: See ../pwm/pwm-stm32-lp.txt 19 - - counter: See ../counter/stm32-lptimer-cnt.txt 20 - - trigger: See ../iio/timer/stm32-lptimer-trigger.txt 21 - 22 - Example: 23 - 24 - timer@40002400 { 25 - compatible = "st,stm32-lptimer"; 26 - reg = <0x40002400 0x400>; 27 - clocks = <&timer_clk>; 28 - clock-names = "mux"; 29 - #address-cells = <1>; 30 - #size-cells = <0>; 31 - 32 - pwm { 33 - compatible = "st,stm32-pwm-lp"; 34 - pinctrl-names = "default"; 35 - pinctrl-0 = <&lppwm1_pins>; 36 - }; 37 - 38 - trigger@0 { 39 - compatible = "st,stm32-lptimer-trigger"; 40 - reg = <0>; 41 - }; 42 - 43 - counter { 44 - compatible = "st,stm32-lptimer-counter"; 45 - pinctrl-names = "default"; 46 - pinctrl-0 = <&lptim1_in_pins>; 47 - }; 48 - };
-30
Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt
··· 1 - STMicroelectronics STM32 Low-Power Timer PWM 2 - 3 - STM32 Low-Power Timer provides single channel PWM. 4 - 5 - Must be a sub-node of an STM32 Low-Power Timer device tree node. 6 - See ../mfd/stm32-lptimer.txt for details about the parent node. 7 - 8 - Required parameters: 9 - - compatible: Must be "st,stm32-pwm-lp". 10 - - #pwm-cells: Should be set to 3. This PWM chip uses the default 3 cells 11 - bindings defined in pwm.yaml. 12 - 13 - Optional properties: 14 - - pinctrl-names: Set to "default". An additional "sleep" state can be 15 - defined to set pins in sleep state when in low power. 16 - - pinctrl-n: Phandle(s) pointing to pin configuration node for PWM, 17 - respectively for "default" and "sleep" states. 18 - 19 - Example: 20 - timer@40002400 { 21 - compatible = "st,stm32-lptimer"; 22 - ... 23 - pwm { 24 - compatible = "st,stm32-pwm-lp"; 25 - #pwm-cells = <3>; 26 - pinctrl-names = "default", "sleep"; 27 - pinctrl-0 = <&lppwm1_pins>; 28 - pinctrl-1 = <&lppwm1_sleep_pins>; 29 - }; 30 - };