mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
pinctrl: exynos: bind GPIO driver along with pinctrl
The devicetree of Samsung devices typically have the pin controller and GPIO bank descriptors under the same pinctrl node. In U-Boot, these are handled by two separate drivers. It is not possible to invoke both drivers from a single node compatible. Bind the GPIO driver on pinctrl driver bind, with the same OF node as the pinctrl driver. This solution is already being used in other pinctrl drivers. The hierarchy, as represented in `dm tree`, is as follows: pinctrl@13750000 |-- gpio-banks | |-- gpr0-gpio-bank | |-- gpr1-gpio-bank | |-- gpr2-gpio-bank | |-- gpr3-gpio-bank | `-- gpr4-gpio-bank |-- sd0-bus-width1-pins |-- sd0-bus-width4-pins |-- sd0-bus-width8-pins `-- sd0-clk-pins Since a bind function doesn't exist, create and add it to all pinctrl drivers. Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
committed by
Minkyu Kang
parent
07b8261d48
commit
b526ec6f3c
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <log.h>
|
||||
#include <dm.h>
|
||||
#include <dm/lists.h>
|
||||
#include <errno.h>
|
||||
#include <asm/io.h>
|
||||
#include "pinctrl-exynos.h"
|
||||
@@ -178,3 +179,13 @@ int exynos_pinctrl_probe(struct udevice *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int exynos_pinctrl_bind(struct udevice *dev)
|
||||
{
|
||||
/*
|
||||
* Attempt to bind the Exynos GPIO driver. The GPIOs and
|
||||
* pin controller descriptors are found in the same OF node.
|
||||
*/
|
||||
return device_bind_driver_to_node(dev, "gpio_exynos", "gpio-banks",
|
||||
dev_ofnode(dev), NULL);
|
||||
}
|
||||
|
||||
@@ -97,5 +97,6 @@ void exynos_pinctrl_setup_peri(struct exynos_pinctrl_config_data *conf,
|
||||
int exynos_pinctrl_set_state(struct udevice *dev,
|
||||
struct udevice *config);
|
||||
int exynos_pinctrl_probe(struct udevice *dev);
|
||||
int exynos_pinctrl_bind(struct udevice *dev);
|
||||
|
||||
#endif /* __PINCTRL_EXYNOS_H_ */
|
||||
|
||||
@@ -114,4 +114,5 @@ U_BOOT_DRIVER(pinctrl_exynos7420) = {
|
||||
.priv_auto = sizeof(struct exynos_pinctrl_priv),
|
||||
.ops = &exynos7420_pinctrl_ops,
|
||||
.probe = exynos_pinctrl_probe,
|
||||
.bind = exynos_pinctrl_bind,
|
||||
};
|
||||
|
||||
@@ -115,4 +115,5 @@ U_BOOT_DRIVER(pinctrl_exynos78x0) = {
|
||||
.priv_auto = sizeof(struct exynos_pinctrl_priv),
|
||||
.ops = &exynos78x0_pinctrl_ops,
|
||||
.probe = exynos_pinctrl_probe,
|
||||
.bind = exynos_pinctrl_bind,
|
||||
};
|
||||
|
||||
@@ -122,4 +122,5 @@ U_BOOT_DRIVER(pinctrl_exynos850) = {
|
||||
.priv_auto = sizeof(struct exynos_pinctrl_priv),
|
||||
.ops = &exynos850_pinctrl_ops,
|
||||
.probe = exynos_pinctrl_probe,
|
||||
.bind = exynos_pinctrl_bind,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user