summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-uclass.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-09-06 01:44:50 +0900
committerSimon Glass <sjg@chromium.org>2015-09-19 15:42:15 -0600
commit8a5f6129d1450f5ff92a55cfcfd7b96ee019e303 (patch)
tree570037dd6b2c7dd79c3bba22cc0e489629a7db29 /drivers/pinctrl/pinctrl-uclass.c
parent1fb8d7933924aa5deb7e722d64c1d9fc7f0b2b82 (diff)
downloadu-boot-8a5f6129d1450f5ff92a55cfcfd7b96ee019e303.tar.gz
u-boot-8a5f6129d1450f5ff92a55cfcfd7b96ee019e303.tar.xz
u-boot-8a5f6129d1450f5ff92a55cfcfd7b96ee019e303.zip
pinctrl: move dm_scan_fdt_node() out of pinctrl uclass
Commit c5acf4a2b3c6 ("pinctrl: Add the concept of peripheral IDs") added some additional change that was not mentioned in the git-log. That commit added dm_scan_fdt_node() in the pinctrl uclass binding. It should be handled by the simple-bus driver or the low-level driver, not by the pinctrl framework. I guess Simon's motivation was to bind GPIO banks located under the Rockchip pinctrl device. It is true some chips have sub-devices under their pinctrl devices, but it is basically SoC-specific matter. This commit partly reverts commit c5acf4a2b3c6 to keep the only pinctrl-generic features in the uclass. The dm_scan_fdt_node() should be called from the rk3288_pinctrl driver. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-uclass.c')
-rw-r--r--drivers/pinctrl/pinctrl-uclass.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 58001ef572..b5fdcd12a8 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -11,7 +11,6 @@
#include <dm/device.h>
#include <dm/lists.h>
#include <dm/pinctrl.h>
-#include <dm/root.h>
#include <dm/uclass.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -160,8 +159,7 @@ static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
static int pinconfig_post_bind(struct udevice *dev)
{
- /* Scan the bus for devices */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return 0;
}
#endif
@@ -249,10 +247,15 @@ static int pinctrl_post_bind(struct udevice *dev)
}
/*
- * The pinctrl driver child nodes should be bound so that peripheral
- * devices can easily search in parent devices during later DT-parsing.
+ * If set_state callback is set, we assume this pinctrl driver is the
+ * full implementation. In this case, its child nodes should be bound
+ * so that peripheral devices can easily search in parent devices
+ * during later DT-parsing.
*/
- return pinconfig_post_bind(dev);
+ if (ops->set_state)
+ return pinconfig_post_bind(dev);
+
+ return 0;
}
UCLASS_DRIVER(pinctrl) = {