[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1403863533-27675-4-git-send-email-stefan.sorensen@spectralink.com>
Date: Fri, 27 Jun 2014 12:05:31 +0200
From: Stefan Sørensen
<stefan.sorensen@...ctralink.com>
To: davem@...emloft.net, richardcochran@...il.com
Cc: netdev@...r.kernel.org,
Stefan Sørensen
<stefan.sorensen@...ctralink.com>
Subject: [PATCH net-next v2 3/5] dp83640: Verify calibration pin assignment
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@...ctralink.com>
---
drivers/net/phy/dp83640.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index eabecff..ab48112 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -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;
}
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists