Message ID | 1391438210-21941-1-git-send-email-stefan.sorensen@spectralink.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, Feb 03, 2014 at 03:36:50PM +0100, Stefan Sørensen wrote: > 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> > --- Acked-by: Richard Cochran <richardcochran@gmail.com> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Stefan Sørensen <stefan.sorensen@spectralink.com> Date: Mon, 3 Feb 2014 15:36:50 +0100 > 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> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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;
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(-)