summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/dp83640.c
diff options
context:
space:
mode:
authorRichard Cochran2014-03-20 22:21:59 +0100
committerDavid S. Miller2014-03-21 19:21:15 +0100
commitfaa8971607322d9244b3c15799f02ae533769bf8 (patch)
tree360063f197af86320d787b6ea30920bbc45e4775 /drivers/net/phy/dp83640.c
parentdp83640: implement programmable pin functions. (diff)
downloadkernel-qcow2-linux-faa8971607322d9244b3c15799f02ae533769bf8.tar.gz
kernel-qcow2-linux-faa8971607322d9244b3c15799f02ae533769bf8.tar.xz
kernel-qcow2-linux-faa8971607322d9244b3c15799f02ae533769bf8.zip
dp83640: let external input pins from the module parameters be defaults.
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/dp83640.c')
-rw-r--r--drivers/net/phy/dp83640.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 43b583b2bed7..93db56438915 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;