From cc528862d961d007d3d72e827897a38b297bc6c8 Mon Sep 17 00:00:00 2001 From: Alexandre Torgue Date: Wed, 10 Apr 2019 13:30:21 +0200 Subject: pinctrl: stm32: introduce package support A same SoC can be available in several packages. Differences between packages are only the numbers of available balls. In order not to write a driver for each new package, same driver (ex: pinctrl-stm32mp157.c) will be used. This patch introduces the "package" property for each pin. So on a same driver, it will be possible to indicate on which package the pin is available. The package information will be got from the device tree. Signed-off-by: Alexandre Torgue Signed-off-by: Linus Walleij --- drivers/pinctrl/stm32/pinctrl-stm32.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/pinctrl/stm32/pinctrl-stm32.h') diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.h b/drivers/pinctrl/stm32/pinctrl-stm32.h index 473a6238a27b..8acdf4811470 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.h +++ b/drivers/pinctrl/stm32/pinctrl-stm32.h @@ -26,6 +26,7 @@ struct stm32_desc_function { struct stm32_desc_pin { struct pinctrl_pin_desc pin; const struct stm32_desc_function *functions; + const unsigned int pkg; }; #define STM32_PIN(_pin, ...) \ @@ -35,6 +36,13 @@ struct stm32_desc_pin { __VA_ARGS__, { } }, \ } +#define STM32_PIN_PKG(_pin, _pkg, ...) \ + { \ + .pin = _pin, \ + .pkg = _pkg, \ + .functions = (struct stm32_desc_function[]){ \ + __VA_ARGS__, { } }, \ + } #define STM32_FUNCTION(_num, _name) \ { \ .num = _num, \ -- cgit v1.2.3