linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@marvell.com>
To: sebastian.hesselbarth@gmail.com, linus.walleij@linaro.org,
	antoine.tenart@free-electrons.com
Cc: catalin.marinas@arm.com, will.deacon@arm.com,
	mark.rutland@arm.com, robh+dt@kernel.org, pawel.moll@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jisheng Zhang <jszhang@marvell.com>
Subject: [PATCH v5 1/7] pinctrl: berlin: introduce berlin_pinctrl_probe_regmap()
Date: Fri, 9 Oct 2015 19:56:44 +0800	[thread overview]
Message-ID: <1444391810-5045-2-git-send-email-jszhang@marvell.com> (raw)
In-Reply-To: <1444391810-5045-1-git-send-email-jszhang@marvell.com>

This is to prepare for the next berlin4ct support, where we won't use
simple-mfd any more.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/pinctrl/berlin/berlin.c | 26 +++++++++++++++++---------
 drivers/pinctrl/berlin/berlin.h |  4 ++++
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index f495806..898afa4 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -292,20 +292,14 @@ static struct pinctrl_desc berlin_pctrl_desc = {
 	.owner		= THIS_MODULE,
 };
 
-int berlin_pinctrl_probe(struct platform_device *pdev,
-			 const struct berlin_pinctrl_desc *desc)
+int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
+				const struct berlin_pinctrl_desc *desc,
+				struct regmap *regmap)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *parent_np = of_get_parent(dev->of_node);
 	struct berlin_pinctrl *pctrl;
-	struct regmap *regmap;
 	int ret;
 
-	regmap = syscon_node_to_regmap(parent_np);
-	of_node_put(parent_np);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
-
 	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
 	if (!pctrl)
 		return -ENOMEM;
@@ -330,3 +324,17 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
 
 	return 0;
 }
+
+int berlin_pinctrl_probe(struct platform_device *pdev,
+			 const struct berlin_pinctrl_desc *desc)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *parent_np = of_get_parent(dev->of_node);
+	struct regmap *regmap = syscon_node_to_regmap(parent_np);
+
+	of_node_put(parent_np);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
+}
diff --git a/drivers/pinctrl/berlin/berlin.h b/drivers/pinctrl/berlin/berlin.h
index e1aa841..dabbd2a 100644
--- a/drivers/pinctrl/berlin/berlin.h
+++ b/drivers/pinctrl/berlin/berlin.h
@@ -58,4 +58,8 @@ struct berlin_pinctrl_function {
 int berlin_pinctrl_probe(struct platform_device *pdev,
 			 const struct berlin_pinctrl_desc *desc);
 
+int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
+				const struct berlin_pinctrl_desc *desc,
+				struct regmap *regmap);
+
 #endif /* __PINCTRL_BERLIN_H */
-- 
2.6.1

  reply	other threads:[~2015-10-09 11:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 11:56 [PATCH v5 0/7] arm64: berlin: add pinctrl support Jisheng Zhang
2015-10-09 11:56 ` Jisheng Zhang [this message]
     [not found] ` <1444391810-5045-1-git-send-email-jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
2015-10-09 11:56   ` [PATCH v5 2/7] pinctrl: berlin: Make berlin pinctrl driver visible if COMPILE_TEST=y Jisheng Zhang
2015-10-09 11:56 ` [PATCH v5 3/7] pinctrl: berlin: add the berlin4ct pinctrl driver Jisheng Zhang
2015-10-15 21:52   ` Sebastian Hesselbarth
2015-10-09 11:56 ` [PATCH v5 4/7] arm64: berlin: add the pinctrl dependency for Marvell Berlin SoCs Jisheng Zhang
2015-10-09 11:56 ` [PATCH v5 5/7] pinctrl: dt-binding: document berlin4ct SoC pinctrl Jisheng Zhang
2015-10-09 11:56 ` [PATCH v5 6/7] arm64: dts: berlin4ct: add the pinctrl node Jisheng Zhang
2015-10-09 11:56 ` [PATCH v5 7/7] arm64: dts: berlin4ct: add default pinmux for uart0 Jisheng Zhang
2015-10-10 22:36 ` [PATCH v5 0/7] arm64: berlin: add pinctrl support Antoine Tenart
2015-10-12  2:39   ` Jisheng Zhang
2015-10-10 22:40 ` Antoine Tenart
2015-10-15 21:55   ` Sebastian Hesselbarth

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=1444391810-5045-2-git-send-email-jszhang@marvell.com \
    --to=jszhang@marvell.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=will.deacon@arm.com \
    /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).