From 368e11cd91aea3d90e38431dcd984ceb1d84385e Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Fri, 28 Jul 2017 14:05:18 +0200 Subject: [PATCH] dt-bindings: pinctrl: fix stm32 pin configuration comments STM32 pin configuration comments where offset by 4 bits. Fix this issue and make pin configuration settings easier to read. Signed-off-by: Erwan Gouriou --- include/dt-bindings/pinctrl/stm32-pinctrl.h | 56 +++++++++---------- include/dt-bindings/pinctrl/stm32-pinctrlf1.h | 6 +- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/include/dt-bindings/pinctrl/stm32-pinctrl.h b/include/dt-bindings/pinctrl/stm32-pinctrl.h index 6e559659791..ebb1546d189 100644 --- a/include/dt-bindings/pinctrl/stm32-pinctrl.h +++ b/include/dt-bindings/pinctrl/stm32-pinctrl.h @@ -13,16 +13,34 @@ * * Pin configuration is coded with the following * fields - * Alternate Function [ 0 : 7 ] - * GPIO Mode [ 8 : 9 ] - * GPIO Output type [ 10 ] - * GPIO Speed [ 11 : 12 ] - * GPIO PUPD config [ 13 : 14 ] + * Alternate Functions [ 0 : 3 ] + * GPIO Mode [ 4 : 5 ] + * GPIO Output type [ 6 ] + * GPIO Speed [ 7 : 8 ] + * GPIO PUPD config [ 9 : 10 ] * * Applicable to STM32F3, STM32F4, STM32L4 series */ +/* Alternate functions */ +#define STM32_FUNC_ALT_0 0 +#define STM32_FUNC_ALT_1 1 +#define STM32_FUNC_ALT_2 2 +#define STM32_FUNC_ALT_3 3 +#define STM32_FUNC_ALT_4 4 +#define STM32_FUNC_ALT_5 5 +#define STM32_FUNC_ALT_6 6 +#define STM32_FUNC_ALT_7 7 +#define STM32_FUNC_ALT_8 8 +#define STM32_FUNC_ALT_9 9 +#define STM32_FUNC_ALT_10 10 +#define STM32_FUNC_ALT_11 11 +#define STM32_FUNC_ALT_12 12 +#define STM32_FUNC_ALT_13 13 +#define STM32_FUNC_ALT_14 14 +#define STM32_FUNC_ALT_15 15 #define STM32_AFR_MASK 0xF +#define STM32_AFR_SHIFT 0 /* GPIO Mode */ #define STM32_MODER_INPUT_MODE (0x0<