Lines Matching full:ptp
2 /* PTP 1588 clock using the Renesas Ethernet AVB
73 u32 gti_ns_plus_1 = (priv->ptp.current_addend >> 20) + 1; in ravb_ptp_update_compare()
90 /* PTP clock operations */
91 static int ravb_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ravb_ptp_adjfine() argument
93 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjfine()
94 ptp.info); in ravb_ptp_adjfine()
100 addend = (u32)adjust_by_scaled_ppm(priv->ptp.default_addend, in ravb_ptp_adjfine()
105 priv->ptp.current_addend = addend; in ravb_ptp_adjfine()
120 static int ravb_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) in ravb_ptp_adjtime() argument
122 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjtime()
123 ptp.info); in ravb_ptp_adjtime()
141 static int ravb_ptp_gettime64(struct ptp_clock_info *ptp, struct timespec64 *ts) in ravb_ptp_gettime64() argument
143 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_gettime64()
144 ptp.info); in ravb_ptp_gettime64()
155 static int ravb_ptp_settime64(struct ptp_clock_info *ptp, in ravb_ptp_settime64() argument
158 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_settime64()
159 ptp.info); in ravb_ptp_settime64()
170 static int ravb_ptp_extts(struct ptp_clock_info *ptp, in ravb_ptp_extts() argument
173 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_extts()
174 ptp.info); in ravb_ptp_extts()
189 if (priv->ptp.extts[req->index] == on) in ravb_ptp_extts()
191 priv->ptp.extts[req->index] = on; in ravb_ptp_extts()
205 static int ravb_ptp_perout(struct ptp_clock_info *ptp, in ravb_ptp_perout() argument
208 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_perout()
209 ptp.info); in ravb_ptp_perout()
232 "ptp: start value (nsec) is over limit. Maximum size of start is only 32 bits\n"); in ravb_ptp_perout()
238 "ptp: period value (nsec) is over limit. Maximum size of period is only 32 bits\n"); in ravb_ptp_perout()
244 perout = &priv->ptp.perout[req->index]; in ravb_ptp_perout()
258 perout = &priv->ptp.perout[req->index]; in ravb_ptp_perout()
272 static int ravb_ptp_enable(struct ptp_clock_info *ptp, in ravb_ptp_enable() argument
277 return ravb_ptp_extts(ptp, &req->extts, on); in ravb_ptp_enable()
279 return ravb_ptp_perout(ptp, &req->perout, on); in ravb_ptp_enable()
311 ptp_clock_event(priv->ptp.clock, &event); in ravb_ptp_interrupt()
314 struct ravb_ptp_perout *perout = priv->ptp.perout; in ravb_ptp_interrupt()
330 priv->ptp.info = ravb_ptp_info; in ravb_ptp_init()
332 priv->ptp.default_addend = ravb_read(ndev, GTI); in ravb_ptp_init()
333 priv->ptp.current_addend = priv->ptp.default_addend; in ravb_ptp_init()
340 priv->ptp.clock = ptp_clock_register(&priv->ptp.info, &pdev->dev); in ravb_ptp_init()
350 ptp_clock_unregister(priv->ptp.clock); in ravb_ptp_stop()