summaryrefslogtreecommitdiff
path: root/include/soc
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2022-01-14 07:59:43 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-01-14 09:24:28 +0100
commit83d37125f34f1bc343f1b087ab690fc0f551d8db (patch)
treecf50c7b3abbcb653f7804013ab40a51849bf5b81 /include/soc
parentb91d1beeb355b4270eb27c589f33ae27bb0fec6a (diff)
downloadbarebox-83d37125f34f1bc343f1b087ab690fc0f551d8db.tar.gz
pinctrl: stm32: replace magic values with defines for STM32_PINMODE
Makes the code easier to follow and allows using the new macros in PBL code for early pinmuxing of e.g. the debug UART. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114065943.698337-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/stm32/gpio.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/soc/stm32/gpio.h b/include/soc/stm32/gpio.h
index 13b492a693..448fb19e2e 100644
--- a/include/soc/stm32/gpio.h
+++ b/include/soc/stm32/gpio.h
@@ -25,6 +25,10 @@
#define STM32_PIN_AF(x) ((x) + 1)
#define STM32_PIN_ANALOG (STM32_PIN_AF(15) + 1)
+#define STM32_PINMODE_GPIO 0
+#define STM32_PINMODE_AF 2
+#define STM32_PINMODE_ANALOG 3
+
#define STM32_GPIO_PINS_PER_BANK 16
enum stm32_pin_bias { STM32_PIN_NO_BIAS, STM32_PIN_PULL_UP, STM32_PIN_PULL_DOWN };