linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] pwm: pwm-mxs: add pinctrl support
Date: Tue, 26 Jun 2012 16:58:11 +0800	[thread overview]
Message-ID: <1340701091-8488-5-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1340701091-8488-1-git-send-email-shawn.guo@linaro.org>

Call pinctrl subsystem to set up pwm pin.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/pwm/pwm-mxs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
index bbda509..dd25975 100644
--- a/drivers/pwm/pwm-mxs.c
+++ b/drivers/pwm/pwm-mxs.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/pwm.h>
 #include <linux/slab.h>
@@ -130,6 +131,7 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct mxs_pwm_chip *mxs;
 	struct resource *res;
+	struct pinctrl *pinctrl;
 	int ret;
 
 	mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL);
@@ -141,6 +143,10 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 	if (!mxs->base)
 		return -EADDRNOTAVAIL;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl))
+		return PTR_ERR(pinctrl);
+
 	mxs->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(mxs->clk))
 		return PTR_ERR(mxs->clk);
-- 
1.7.5.4

      parent reply	other threads:[~2012-06-26  8:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26  8:58 [PATCH 0/4] pwm-mxs driver updates Shawn Guo
2012-06-26  8:58 ` [PATCH 1/4] pwm: pwm-mxs: encode soc name in compatible string Shawn Guo
2012-06-26  8:58 ` [PATCH 2/4] pwm: pwm-mxs: use global reset function stmp_reset_block Shawn Guo
2012-06-26  9:54   ` Thierry Reding
2012-06-26  9:57     ` Thierry Reding
2012-06-26 11:14       ` Shawn Guo
2012-06-27 13:36   ` [PATCH v2 " Shawn Guo
2012-06-27 13:39     ` Thierry Reding
2012-06-26  8:58 ` [PATCH 3/4] pwm: pwm-mxs: use devm_* managed functions Shawn Guo
2012-06-26  8:58 ` Shawn Guo [this message]

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=1340701091-8488-5-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).