linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: djw@t-chip.com.cn
To: linux-rockchip@lists.infradead.org
Cc: Wayne Chou <zxf@t-chip.com.cn>, Levin Du <djw@t-chip.com.cn>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-gpio@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v1 1/5] gpio: syscon: allow fetching syscon from parent node
Date: Thu, 10 May 2018 17:16:36 +0800	[thread overview]
Message-ID: <1525943800-14095-2-git-send-email-djw@t-chip.com.cn> (raw)
In-Reply-To: <1525943800-14095-1-git-send-email-djw@t-chip.com.cn>

From: Heiko Stuebner <heiko@sntech.de>

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>
---

Changes in v1:
- New

 drivers/gpio/gpio-syscon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 537cec7..7325b86 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -205,6 +205,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);
 
-- 
2.7.4

  reply	other threads:[~2018-05-10  9:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  9:16 [PATCH v1 0/5] Add sdmmc UHS support to ROC-RK3328-CC board djw
2018-05-10  9:16 ` djw [this message]
2018-05-10  9:16 ` [PATCH v1 2/5] gpio: syscon: Add gpio-syscon for rockchip djw
2018-05-10 14:56   ` Robin Murphy
2018-05-11  2:16     ` Levin Du
2018-05-10  9:16 ` [PATCH v1 3/5] arm64: dts: rockchip: Add gpio-syscon10 to rk3328 djw
2018-05-10 12:50   ` Robin Murphy
2018-05-11  3:45     ` Levin Du
2018-05-11 12:24       ` Rob Herring
2018-05-14  1:28         ` Levin Du
2018-05-11 12:22   ` Rob Herring
2018-05-14  1:22     ` Levin Du
2018-05-10  9:16 ` [PATCH v1 4/5] arm64: dts: rockchip: Add io-domain to roc-rk3328-cc djw
2018-05-10  9:27 ` djw
2018-05-10  9:28 ` [PATCH v1 5/5] arm64: dts: rockchip: Add sdmmc UHS support for roc-rk3328-cc djw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1525943800-14095-2-git-send-email-djw@t-chip.com.cn \
    --to=djw@t-chip.com.cn \
    --cc=heiko@sntech.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=zxf@t-chip.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).