aboutsummaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorPatrick Delaunay2019-08-02 14:48:00 +0200
committerSimon Glass2019-10-15 08:40:03 -0600
commite878b53a79d1a4f06c7c03d706da6b2993e8ff41 (patch)
treee0b9a6ad983d31589cf39fd7a429ac2b72faad98 /drivers/pinctrl
parent52edfed65de967a86983a55c51ba0727090efc43 (diff)
dm: pinctrl: introduce PINCONF_RECURSIVE option
In the Linux pinctrl binding, the pin configuration nodes don't need to be direct children of the pin controller device (may be grandchildren for example). This behavior is managed with the pinconfig u-class which recursively bind all the sub-node of the pin controller. But for some binding (when pin configuration is only children of pin controller) that is not necessary. U-Boot can save memory and reduce the number of pinconf instance when this feature is deactivated (for arch stm32mp for example for SPL). This patch allows to control this feature with a new option CONFIG_PINCONF_RECURSIVE when it is possible for each individual pin controller device. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Fixed CONFIG_IF_ENABLED() condition, added __maybe_unused: Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/Kconfig25
-rw-r--r--drivers/pinctrl/pinctrl-uclass.c4
2 files changed, 28 insertions, 1 deletions
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index deee92411c9..6b41f66a86c 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -75,6 +75,22 @@ config PINCONF_RECURSIVE
configuration; you can save memory footprint when this feature is
no needed.
+config PINCONF_RECURSIVE
+ bool "Support recursive binding for pin configuration nodes"
+ depends on PINCTRL_FULL
+ default n if ARCH_STM32MP
+ default y
+ help
+ In the Linux pinctrl binding, the pin configuration nodes need not be
+ direct children of the pin controller device (may be grandchildren for
+ example). It is define is each individual pin controller device.
+ Say Y here if you want to keep this behavior with the pinconfig
+ u-class: all sub are recursivelly bounded.
+ If the option is disabled, this behavior is deactivated and only
+ the direct children of pin controller will be assumed as pin
+ configuration; you can save memory footprint when this feature is
+ no needed.
+
config SPL_PINCTRL
bool "Support pin controllers in SPL"
depends on SPL && SPL_DM
@@ -129,6 +145,15 @@ config SPL_PINCONF_RECURSIVE
This option is an SPL-variant of the PINCONF_RECURSIVE option.
See the help of PINCONF_RECURSIVE for details.
+config SPL_PINCONF_RECURSIVE
+ bool "Support recursive binding for pin configuration nodes in SPL"
+ depends on SPL_PINCTRL_FULL
+ default n if ARCH_STM32MP
+ default y
+ help
+ This option is an SPL-variant of the PINCONF_RECURSIVE option.
+ See the help of PINCONF_RECURSIVE for details.
+
if PINCTRL || SPL_PINCTRL
config PINCTRL_AR933X
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index a2da63f598c..0b1eb7fab4a 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -403,7 +403,7 @@ int pinctrl_get_pin_muxing(struct udevice *dev, int selector, char *buf,
* @dev: pinctrl device
* @return: 0 on success, or negative error code on failure
*/
-static int pinctrl_post_bind(struct udevice *dev)
+static int __maybe_unused pinctrl_post_bind(struct udevice *dev)
{
const struct pinctrl_ops *ops = pinctrl_get_ops(dev);
@@ -426,7 +426,9 @@ static int pinctrl_post_bind(struct udevice *dev)
UCLASS_DRIVER(pinctrl) = {
.id = UCLASS_PINCTRL,
+#if CONFIG_IS_ENABLED(PINCONF_RECURSIVE)
.post_bind = pinctrl_post_bind,
+#endif
.flags = DM_UC_FLAG_SEQ_ALIAS,
.name = "pinctrl",
};