mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-05 19:24:48 +00:00
pinctrl: mediatek: add support for gpio-controller property in root node
Add support for gpio-controller property in root pinctrl node. This is to follow upstream linux DTSI that doesn't define the gpio-controller and cells in dedicated nodes. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
55269f1019
commit
e499d5d430
1 changed files with 10 additions and 0 deletions
|
@ -761,6 +761,15 @@ static int mtk_gpiochip_register(struct udevice *parent)
|
||||||
if (!drv)
|
if (!drv)
|
||||||
return -ENOENT;
|
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;
|
ret = -ENOENT;
|
||||||
dev_for_each_subnode(node, parent)
|
dev_for_each_subnode(node, parent)
|
||||||
if (ofnode_read_bool(node, "gpio-controller")) {
|
if (ofnode_read_bool(node, "gpio-controller")) {
|
||||||
|
@ -771,6 +780,7 @@ static int mtk_gpiochip_register(struct udevice *parent)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
bind:
|
||||||
ret = device_bind_with_driver_data(parent, &mtk_gpio_driver,
|
ret = device_bind_with_driver_data(parent, &mtk_gpio_driver,
|
||||||
"mediatek_gpio", 0, node,
|
"mediatek_gpio", 0, node,
|
||||||
&dev);
|
&dev);
|
||||||
|
|
Loading…
Add table
Reference in a new issue