mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: <netdev@vger.kernel.org>
Cc: linux-kernel@vger.kernel.org,
	"Ben Hutchings" <ben@decadent.org.uk>,
	"Christian Riesch" <christian.riesch@omicron.at>,
	"David Miller" <davem@davemloft.net>,
	"Stefan Sørensen" <stefan.sorensen@spectralink.com>
Subject: [PATCH net-next v2 8/9] dp83640: let external input pins from the module parameters be defaults.
Date: Sun, 16 Mar 2014 14:29:29 +0100	[thread overview]
Message-ID: <d6b7d01cb28c08a11afbc74bb47cefcce7a7e5ce.1394975663.git.richardcochran@gmail.com> (raw)
In-Reply-To: <cover.1394975663.git.richardcochran@gmail.com>

This patch changes the driver to use the new pin configuration method when
programming the external time stamp input signals.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/phy/dp83640.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 43b583b..93db564 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -468,7 +468,10 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
 		event_num = EXT_EVENT + index;
 		evnt = EVNT_WR | (event_num & EVNT_SEL_MASK) << EVNT_SEL_SHIFT;
 		if (on) {
-			gpio_num = gpio_tab[EXTTS0_GPIO + index];
+			gpio_num = 1 + ptp_find_pin(clock->ptp_clock,
+						    PTP_PF_EXTTS, index);
+			if (gpio_num < 1)
+				return -EINVAL;
 			evnt |= (gpio_num & EVNT_GPIO_MASK) << EVNT_GPIO_SHIFT;
 			if (rq->extts.flags & PTP_FALLING_EDGE)
 				evnt |= EVNT_FALL;
-- 
1.7.10.4


  parent reply	other threads:[~2014-03-16 13:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-16 13:29 [PATCH net-next v2 0/9] ptp: dynamic pin control Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 1/9] ptp: introduce programmable pins Richard Cochran
2014-03-18  1:25   ` David Miller
2014-03-20 20:43     ` Richard Cochran
2014-03-20 21:13       ` David Miller
2014-03-16 13:29 ` [PATCH net-next v2 2/9] ptp: add the pin GET/SETFUNC ioctls to the testptp program Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 3/9] ptp: expose the programmable pins via sysfs Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 4/9] ptp: drivers: set the number of programmable pins Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 5/9] dp83640: trivial fixes Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 6/9] dp83640: correct the periodic output frequency Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 7/9] dp83640: implement programmable pin functions Richard Cochran
2014-03-16 13:29 ` Richard Cochran [this message]
2014-03-16 13:29 ` [PATCH net-next v2 9/9] dp83640: let the periodic pin from the module parameter be a default Richard Cochran

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=d6b7d01cb28c08a11afbc74bb47cefcce7a7e5ce.1394975663.git.richardcochran@gmail.com \
    --to=richardcochran@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=christian.riesch@omicron.at \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stefan.sorensen@spectralink.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

all inboxes | Powered by JetHome®