From: Stefan Sørensen Date: Mon, 3 Feb 2014 14:36:50 +0000 (+0100) Subject: net:phy:dp83640: Do not hardcode timestamping event edge X-Git-Tag: v3.14-rc3~36^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80671bd2a91b81b8e06634e8309ce94df688c42c;p=platform%2Fkernel%2Flinux-stable.git 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 Acked-by: Richard Cochran Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index 3f882ee..e347c8a 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;