summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/dp83640.c
diff options
context:
space:
mode:
authorStefan Sørensen <stefan.sorensen@spectralink.com>2014-02-03 15:36:50 +0100
committerDavid S. Miller <davem@davemloft.net>2014-02-05 05:07:36 +0100
commit80671bd2a91b81b8e06634e8309ce94df688c42c (patch)
treec1f143588dd56643cdf80777ca04a561acca3a91 /drivers/net/phy/dp83640.c
parentnet:phy:dp83640: Declare that TX timestamping possible (diff)
downloadlinux-80671bd2a91b81b8e06634e8309ce94df688c42c.tar.xz
linux-80671bd2a91b81b8e06634e8309ce94df688c42c.zip
net:phy:dp83640: Do not hardcode timestamping event edge
Currently the external timestamping code is hardcoded to use the rising edge even though the hardware has configurable event edge detection. This patch changes the code to use falling edge detection if PTP_FALLING_EDGE is set in the user supplied flags. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Acked-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 3f882eea6e1d..e347c8a218fc 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -437,7 +437,10 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
if (on) {
gpio_num = gpio_tab[EXTTS0_GPIO + index];
evnt |= (gpio_num & EVNT_GPIO_MASK) << EVNT_GPIO_SHIFT;
- evnt |= EVNT_RISE;
+ if (rq->extts.flags & PTP_FALLING_EDGE)
+ evnt |= EVNT_FALL;
+ else
+ evnt |= EVNT_RISE;
}
ext_write(0, phydev, PAGE5, PTP_EVNT, evnt);
return 0;