Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80671bd2 authored by Stefan Sørensen's avatar Stefan Sørensen Committed by David S. Miller
Browse files

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: default avatarStefan Sørensen <stefan.sorensen@spectralink.com>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2e2f51d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -437,6 +437,9 @@ 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;
			if (rq->extts.flags & PTP_FALLING_EDGE)
				evnt |= EVNT_FALL;
			else
				evnt |= EVNT_RISE;
		}
		ext_write(0, phydev, PAGE5, PTP_EVNT, evnt);