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_adjfreq(struct ptp_clock_info *ptp, s32 ppb) in ravb_ptp_adjfreq() argument
93 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjfreq()
94 ptp.info); in ravb_ptp_adjfreq()
105 addend = priv->ptp.default_addend; in ravb_ptp_adjfreq()
112 priv->ptp.current_addend = addend; in ravb_ptp_adjfreq()
127 static int ravb_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) in ravb_ptp_adjtime() argument
129 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_adjtime()
130 ptp.info); in ravb_ptp_adjtime()
148 static int ravb_ptp_gettime64(struct ptp_clock_info *ptp, struct timespec64 *ts) in ravb_ptp_gettime64() argument
150 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_gettime64()
151 ptp.info); in ravb_ptp_gettime64()
162 static int ravb_ptp_settime64(struct ptp_clock_info *ptp, in ravb_ptp_settime64() argument
165 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_settime64()
166 ptp.info); in ravb_ptp_settime64()
177 static int ravb_ptp_extts(struct ptp_clock_info *ptp, in ravb_ptp_extts() argument
180 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_extts()
181 ptp.info); in ravb_ptp_extts()
195 if (priv->ptp.extts[req->index] == on) in ravb_ptp_extts()
197 priv->ptp.extts[req->index] = on; in ravb_ptp_extts()
211 static int ravb_ptp_perout(struct ptp_clock_info *ptp, in ravb_ptp_perout() argument
214 struct ravb_private *priv = container_of(ptp, struct ravb_private, in ravb_ptp_perout()
215 ptp.info); in ravb_ptp_perout()
237 "ptp: start value (nsec) is over limit. Maximum size of start is only 32 bits\n"); in ravb_ptp_perout()
243 "ptp: period value (nsec) is over limit. Maximum size of period is only 32 bits\n"); in ravb_ptp_perout()
249 perout = &priv->ptp.perout[req->index]; in ravb_ptp_perout()
263 perout = &priv->ptp.perout[req->index]; in ravb_ptp_perout()
277 static int ravb_ptp_enable(struct ptp_clock_info *ptp, in ravb_ptp_enable() argument
282 return ravb_ptp_extts(ptp, &req->extts, on); in ravb_ptp_enable()
284 return ravb_ptp_perout(ptp, &req->perout, on); in ravb_ptp_enable()
316 ptp_clock_event(priv->ptp.clock, &event); in ravb_ptp_interrupt()
319 struct ravb_ptp_perout *perout = priv->ptp.perout; in ravb_ptp_interrupt()
335 priv->ptp.info = ravb_ptp_info; in ravb_ptp_init()
337 priv->ptp.default_addend = ravb_read(ndev, GTI); in ravb_ptp_init()
338 priv->ptp.current_addend = priv->ptp.default_addend; in ravb_ptp_init()
345 priv->ptp.clock = ptp_clock_register(&priv->ptp.info, &pdev->dev); in ravb_ptp_init()
355 ptp_clock_unregister(priv->ptp.clock); in ravb_ptp_stop()