Lines Matching full:ptp

2 /* Marvell OcteonTx2 PTP support for ethernet driver
12 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_adjfine() local
17 if (!ptp->nic) in otx2_ptp_adjfine()
20 req = otx2_mbox_alloc_msg_ptp_op(&ptp->nic->mbox); in otx2_ptp_adjfine()
27 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in otx2_ptp_adjfine()
36 struct otx2_ptp *ptp = container_of(cc, struct otx2_ptp, cycle_counter); in ptp_cc_read() local
41 if (!ptp->nic) in ptp_cc_read()
44 req = otx2_mbox_alloc_msg_ptp_op(&ptp->nic->mbox); in ptp_cc_read()
50 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in ptp_cc_read()
54 rsp = (struct ptp_rsp *)otx2_mbox_get_rsp(&ptp->nic->mbox.mbox, 0, in ptp_cc_read()
64 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_adjtime() local
66 struct otx2_nic *pfvf = ptp->nic; in otx2_ptp_adjtime()
69 timecounter_adjtime(&ptp->time_counter, delta); in otx2_ptp_adjtime()
78 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_gettime() local
80 struct otx2_nic *pfvf = ptp->nic; in otx2_ptp_gettime()
84 nsec = timecounter_read(&ptp->time_counter); in otx2_ptp_gettime()
95 struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp, in otx2_ptp_settime() local
97 struct otx2_nic *pfvf = ptp->nic; in otx2_ptp_settime()
103 timecounter_init(&ptp->time_counter, &ptp->cycle_counter, nsec); in otx2_ptp_settime()
123 /* check if PTP block is available */ in otx2_ptp_init()
158 .name = "OcteonTX2 PTP", in otx2_ptp_init()
178 pfvf->ptp = ptp_ptr; in otx2_ptp_init()
186 struct otx2_ptp *ptp = pfvf->ptp; in otx2_ptp_destroy() local
188 if (!ptp) in otx2_ptp_destroy()
191 ptp_clock_unregister(ptp->ptp_clock); in otx2_ptp_destroy()
192 kfree(ptp); in otx2_ptp_destroy()
193 pfvf->ptp = NULL; in otx2_ptp_destroy()
198 if (!pfvf->ptp) in otx2_ptp_clock_index()
201 return ptp_clock_index(pfvf->ptp->ptp_clock); in otx2_ptp_clock_index()
206 if (!pfvf->ptp) in otx2_ptp_tstamp2time()
209 *tsns = timecounter_cyc2time(&pfvf->ptp->time_counter, tstamp); in otx2_ptp_tstamp2time()