Thread (50 messages) 50 messages, 6 authors, 2020-11-17

Re: [RFC PATCH net-next 8/9] net: dsa: microchip: ksz9477: add Pulse Per Second (PPS) support

From: Christian Eggers <ceggers@arri.de>
Date: 2020-10-20 08:50:15
Also in: linux-devicetree, lkml

On Monday, 19 October 2020, 19:46:17 CEST, Vladimir Oltean wrote:
On Mon, Oct 19, 2020 at 07:24:34PM +0200, Christian Eggers wrote:
quoted
 static int ksz9477_ptp_enable(struct ptp_clock_info *ptp, struct
 ptp_clock_request *req, int on) {

-	return -ENOTTY;
+	struct ksz_device *dev = container_of(ptp, struct ksz_device, ptp_caps);
+	int ret;
+
+	switch (req->type) {
+	case PTP_CLK_REQ_PPS:
+		mutex_lock(&dev->ptp_mutex);
+		ret = ksz9477_ptp_enable_pps(dev, on);
+		mutex_unlock(&dev->ptp_mutex);
+		return ret;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;

 }
Nope, this is not what you're looking for. Please implement
PTP_CLK_REQ_PEROUT.
Are you sure? I have implemented both (see patch 9/9). I cannot see that the
PTP_ENABLE_PPS(2) ioctls are translated into PTP_CLK_REQ_PEROUT. 

PTP_CLK_REQ_PEROUT is also called in pps_enable_store().

regards
Christian


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help