mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-17 20:26:49 +00:00
gpio: syscon: allow fetching syscon from parent node
Syscon nodes can be a simple-mfd and the syscon-users then be declared as children of this node. That way the parent-child structure can be better represented for devices that are fully embedded in the syscon. Therefore allow getting the syscon from the parent if neither a special compatible nor a gpio,syscon-dev property is defined. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Levin Du <djw@t-chip.com.cn> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
c65ef0ced1
commit
aa1fdda8f7
1 changed files with 2 additions and 0 deletions
|
|
@ -200,6 +200,8 @@ static int syscon_gpio_probe(struct platform_device *pdev)
|
||||||
} else {
|
} else {
|
||||||
priv->syscon =
|
priv->syscon =
|
||||||
syscon_regmap_lookup_by_phandle(np, "gpio,syscon-dev");
|
syscon_regmap_lookup_by_phandle(np, "gpio,syscon-dev");
|
||||||
|
if (IS_ERR(priv->syscon) && np->parent)
|
||||||
|
priv->syscon = syscon_node_to_regmap(np->parent);
|
||||||
if (IS_ERR(priv->syscon))
|
if (IS_ERR(priv->syscon))
|
||||||
return PTR_ERR(priv->syscon);
|
return PTR_ERR(priv->syscon);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue