From: Boris BREZILLON <linux-arm@overkiz.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: linux-kernel@vger.kernel.org, Boris BREZILLON <linux-arm@overkiz.com>
Subject: [PATCH RESEND] pwm: pwm-atmel-tcb: pinctrl support
Date: Tue, 2 Apr 2013 18:09:46 +0200 [thread overview]
Message-ID: <1364918986-15336-1-git-send-email-linux-arm@overkiz.com> (raw)
Setup tcb pins using pinctrl subsystem.
Signed-off-by: Boris BREZILLON <linux-arm@overkiz.com>
---
drivers/pwm/pwm-atmel-tcb.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
index 16cb530..985b7bf 100644
--- a/drivers/pwm/pwm-atmel-tcb.c
+++ b/drivers/pwm/pwm-atmel-tcb.c
@@ -21,6 +21,7 @@
#include <linux/pwm.h>
#include <linux/of_device.h>
#include <linux/slab.h>
+#include <linux/pinctrl/consumer.h>
#define NPWM 6
@@ -365,6 +366,7 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)
struct atmel_tcb_pwm_chip *tcbpwm;
struct device_node *np = pdev->dev.of_node;
struct atmel_tc *tc;
+ struct pinctrl *pinctrl;
int err;
int tcblock;
@@ -389,6 +391,13 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)
return -ENOMEM;
}
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl)) {
+ atmel_tc_free(tc);
+ dev_err(&pdev->dev, "failed to get pinctrl config\n");
+ return PTR_ERR(pinctrl);
+ }
+
tcbpwm->chip.dev = &pdev->dev;
tcbpwm->chip.ops = &atmel_tcb_pwm_ops;
tcbpwm->chip.of_xlate = of_pwm_xlate_with_flags;
--
1.7.9.5
reply other threads:[~2013-04-02 19:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1364918986-15336-1-git-send-email-linux-arm@overkiz.com \
--to=linux-arm@overkiz.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thierry.reding@avionic-design.de \
/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
all inboxes | Powered by JetHome®