Re: [PATCH net-next 10/11] ptp: ocp: Add IRIG-B output mode control

From
Jakub Kicinski <kuba@kernel.org>
Date
2021-09-02 00:07:05
Reply to
Jonathan Lemon, 2021-08-30
On Mon, 30 Aug 2021 16:52:35 -0700 Jonathan Lemon wrote:
quoted hunk ↗ jump to hunk
+	err = kstrtou8(buf, 0, &val);
+	if (err)
+		return err;
+	if (val > 7)
+		return -EINVAL;
+
+	reg = ((val & 0x7) << 16);
+
+	spin_lock_irqsave(&bp->lock, flags);
+	iowrite32(0, &bp->irig_out->ctrl);		/* disable */
+	iowrite32(reg, &bp->irig_out->ctrl);		/* change mode */
+	iowrite32(reg | IRIG_M_CTRL_ENABLE, &bp->irig_out->ctrl);
+	spin_unlock_irqrestore(&bp->lock, flags);
locking
Thread (21 messages) 21 messages, 2 authors, last reply 2021-09-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help