linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/7] ptp: switch to use gpiolib
@ 2013-09-10 12:31 Linus Walleij
  2013-09-10 14:19 ` Richard Cochran
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2013-09-10 12:31 UTC (permalink / raw)
  To: linux-gpio, Imre Kaloz, Krzysztof Halasa, Richard Cochran
  Cc: Alexandre Courbot, linux-arm-kernel, Linus Walleij, netdev

This platform supports gpiolib, so remove the custom API use
and replace with calls to gpiolib. Also request the GPIO before
starting to use it.

Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Hi Richard, I'm seeking an ACK on this patch to take it throug
the GPIO tree as part of a clean-out of custom GPIO implementations.
---
 drivers/ptp/ptp_ixp46x.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c
index d49b851..4a08727 100644
--- a/drivers/ptp/ptp_ixp46x.c
+++ b/drivers/ptp/ptp_ixp46x.c
@@ -259,8 +259,15 @@ static struct ixp_clock ixp_clock;
 static int setup_interrupt(int gpio)
 {
 	int irq;
+	int err;
 
-	gpio_line_config(gpio, IXP4XX_GPIO_IN);
+	err = gpio_request(gpio, "ixp4-ptp");
+	if (err)
+		return err;
+
+	err = gpio_direction_input(gpio);
+	if (err)
+		return err;
 
 	irq = gpio_to_irq(gpio);
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-13 17:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 12:31 [PATCH 4/7] ptp: switch to use gpiolib Linus Walleij
2013-09-10 14:19 ` Richard Cochran
2013-09-13  8:38   ` Linus Walleij
2013-09-13 12:22     ` Krzysztof Halasa
2013-09-13 13:36       ` Richard Cochran
2013-09-13 17:36         ` Krzysztof Halasa

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