* [PATCH] net:phy:dp83640: Do not hardcode timestamping event edge
@ 2014-02-03 14:36 Stefan Sørensen
2014-02-03 16:20 ` Richard Cochran
2014-02-05 4:08 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Sørensen @ 2014-02-03 14:36 UTC (permalink / raw)
To: richardcochran, netdev; +Cc: Stefan Sørensen
Currently the external timestamping code it hardcoded to use
the rising edge even though the hardware has configurable event
edge detection. This patch change 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>
---
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 baa1a75..80c5fc8 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -440,7 +440,10 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
if (on) {
gpio_num = extts_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;
--
1.8.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-05 4:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03 14:36 [PATCH] net:phy:dp83640: Do not hardcode timestamping event edge Stefan Sørensen
2014-02-03 16:20 ` Richard Cochran
2014-02-05 4:08 ` David Miller
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).