LKML Archive on lore.kernel.org
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 v3 1/5] gpio: syscon: allow fetching syscon from parent node
Date: Thu, 31 May 2018 11:27:49 +0800	[thread overview]
Message-ID: <1527737273-8387-2-git-send-email-djw@t-chip.com.cn> (raw)
In-Reply-To: <1527737273-8387-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 v3: None
Changes in v2: None
Changes in v1:
- New: allow fetching syscon from parent node in gpio-syscon driver

 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-31  3:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  3:27 [PATCH v3 0/5] Add sdmmc UHS support to ROC-RK3328-CC board djw
2018-05-31  3:27 ` djw [this message]
2018-06-08  7:54   ` [PATCH v3 1/5] gpio: syscon: allow fetching syscon from parent node Linus Walleij
2018-05-31  3:27 ` [PATCH v3 2/5] gpio: syscon: rockchip: add GPIO_MUTE support for rk3328 djw
2018-05-31 14:45   ` Rob Herring
2018-06-01  2:05     ` Levin
2018-06-01 17:03       ` Rob Herring
2018-06-02  8:40         ` Levin Du
2018-06-05 19:58           ` Rob Herring
2018-06-07  1:32             ` Levin
2018-06-28  7:22               ` djw
2018-07-06 21:10                 ` Rob Herring
2018-05-31  3:27 ` [PATCH v3 3/5] arm64: dts: rockchip: Add GPIO_MUTE pin support to rk3328 djw
2018-05-31  3:27 ` [PATCH v3 4/5] arm64: dts: rockchip: Add io-domain to roc-rk3328-cc djw
2018-05-31  5:03 ` [PATCH v3 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=1527737273-8387-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 \
    --subject='Re: [PATCH v3 1/5] gpio: syscon: allow fetching syscon from parent node' \
    /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

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