Skip to content

Commit

Permalink
dp83640: Verify calibration pin assignment
Browse files Browse the repository at this point in the history
This constraints the pin assignment to not allow the calibration function to
be reassigned and only allow reassigning the calibratin pin if only one phy is
connected.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stefan Sørensen authored and David S. Miller committed Jul 2, 2014
1 parent ad01577 commit 6f39eb8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/phy/dp83640.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,16 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
static int ptp_dp83640_verify(struct ptp_clock_info *ptp, unsigned int pin,
enum ptp_pin_function func, unsigned int chan)
{
struct dp83640_clock *clock =
container_of(ptp, struct dp83640_clock, caps);

if (clock->caps.pin_config[pin].func == PTP_PF_PHYSYNC &&
!list_empty(&clock->phylist))
return 1;

if (func == PTP_PF_PHYSYNC)
return 1;

return 0;
}

Expand Down

0 comments on commit 6f39eb8

Please sign in to comment.