summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/stm32/pinctrl-stm32.h
diff options
context:
space:
mode:
authorMaxime Coquelin <mcoquelin.stm32@gmail.com>2016-02-08 20:57:38 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-02-09 12:52:28 +0300
commit38a3fbf16a47868231894cdabef862d2f4e7b40a (patch)
tree6ad102d540ad6383d5dc173104bdd1a309a4c7eb /drivers/pinctrl/stm32/pinctrl-stm32.h
parent2ba384e6c3810733e14e183dedc3406f402a686f (diff)
downloadlinux-38a3fbf16a47868231894cdabef862d2f4e7b40a.tar.xz
pinctrl: stm32: Remove dependency with DT bindings header files
Some macros where defined in DT bindings headers, whereas only used in the driver. This patch moves these macros to the driver side. Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/stm32/pinctrl-stm32.h')
-rw-r--r--drivers/pinctrl/stm32/pinctrl-stm32.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.h b/drivers/pinctrl/stm32/pinctrl-stm32.h
index 1b7c369acd8c..35ebc94c01e4 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.h
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.h
@@ -9,6 +9,14 @@
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinconf-generic.h>
+#define STM32_PIN_NO(x) ((x) << 8)
+#define STM32_GET_PIN_NO(x) ((x) >> 8)
+#define STM32_GET_PIN_FUNC(x) ((x) & 0xff)
+
+#define STM32_PIN_GPIO 0
+#define STM32_PIN_AF(x) ((x) + 1)
+#define STM32_PIN_ANALOG (STM32_PIN_AF(15) + 1)
+
struct stm32_desc_function {
const char *name;
const unsigned char num;