aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-syscon.c
diff options
context:
space:
mode:
authorHeiko Stuebner <[email protected]>2018-05-18 03:52:04 +0000
committerLinus Walleij <[email protected]>2018-05-23 08:07:26 +0000
commitaa1fdda8f7ebf83f678e8d3c2ab4f1638c94195f (patch)
tree54cc822d6ffe2409563c4e62fd5adc343399e880 /drivers/gpio/gpio-syscon.c
parentgpio: rcar: Add DT binding for r8a77990 (diff)
downloadkernel-aa1fdda8f7ebf83f678e8d3c2ab4f1638c94195f.tar.gz
kernel-aa1fdda8f7ebf83f678e8d3c2ab4f1638c94195f.zip
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 <[email protected]> Signed-off-by: Levin Du <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-syscon.c')
-rw-r--r--drivers/gpio/gpio-syscon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 2512acd99027..8b0a69c5ba88 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -200,6 +200,8 @@ static int syscon_gpio_probe(struct platform_device *pdev)
} else {
priv->syscon =
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))
return PTR_ERR(priv->syscon);