summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-07-08 11:56:59 -0600
committerTom Rini <[email protected]>2024-07-08 11:56:59 -0600
commit475aa8345a78396d39b42f96eccecd37ebe24e99 (patch)
treec788908a4d8b32a0624c59c4ad60ebbb82998674 /drivers/pinctrl
parente13fcae3fce8b2c4db86339c9e8bafdd403f22b5 (diff)
parent4b45082bf710097c8aa6f3ec25c3f34c54c7398c (diff)
Merge patch series "mediatek: cumulative trivial fix for OF_UPSTREAM support"
Christian Marangi <[email protected]> says: This is an initial series that have all the initial trivial fixes required for usage of OF_UPSTREAM for the mediatek SoC This also contains the pcie-gen3 driver and the required tphy support driver to make it work. Subsequent series will follow with conversion of the mtk-clk to permit usage of OF_UPSTREAM and upstream clk ID. MT7981, MT7986 and MT7988 migration to upstream clock ID is complete and working on MT7623. Series CI tested with PR: https://github.com/u-boot/u-boot/pull/590
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt7981.c1
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7981.c b/drivers/pinctrl/mediatek/pinctrl-mt7981.c
index 3fa198ed79c..4bc4abe6518 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt7981.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7981.c
@@ -1050,4 +1050,5 @@ U_BOOT_DRIVER(mt7981_pinctrl) = {
.ops = &mtk_pinctrl_ops,
.probe = mtk_pinctrl_mt7981_probe,
.priv_auto = sizeof(struct mtk_pinctrl_priv),
+ .flags = DM_FLAG_PRE_RELOC,
};
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 37fc28bb779..ede3959c94f 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -761,6 +761,15 @@ static int mtk_gpiochip_register(struct udevice *parent)
if (!drv)
return -ENOENT;
+ /*
+ * Support upstream linux DTSI that define gpio-controller
+ * in the root node (instead of a dedicated subnode)
+ */
+ if (dev_read_bool(parent, "gpio-controller")) {
+ node = dev_ofnode(parent);
+ goto bind;
+ }
+
ret = -ENOENT;
dev_for_each_subnode(node, parent)
if (ofnode_read_bool(node, "gpio-controller")) {
@@ -771,6 +780,7 @@ static int mtk_gpiochip_register(struct udevice *parent)
if (ret)
return ret;
+bind:
ret = device_bind_with_driver_data(parent, &mtk_gpio_driver,
"mediatek_gpio", 0, node,
&dev);