Lines Matching refs:ptp_ptr
384 struct otx2_ptp *ptp_ptr; in otx2_ptp_init() local
411 ptp_ptr = kzalloc(sizeof(*ptp_ptr), GFP_KERNEL); in otx2_ptp_init()
412 if (!ptp_ptr) { in otx2_ptp_init()
417 ptp_ptr->nic = pfvf; in otx2_ptp_init()
419 snprintf(ptp_ptr->extts_config.name, sizeof(ptp_ptr->extts_config.name), "TSTAMP"); in otx2_ptp_init()
420 ptp_ptr->extts_config.index = 0; in otx2_ptp_init()
421 ptp_ptr->extts_config.func = PTP_PF_NONE; in otx2_ptp_init()
423 ptp_ptr->ptp_info = (struct ptp_clock_info) { in otx2_ptp_init()
431 .pin_config = &ptp_ptr->extts_config, in otx2_ptp_init()
438 if (is_tstmp_atomic_update_supported(ptp_ptr)) { in otx2_ptp_init()
439 ptp_ptr->ptp_info.adjtime = otx2_ptp_hw_adjtime; in otx2_ptp_init()
440 ptp_ptr->ptp_info.gettime64 = otx2_ptp_hw_gettime; in otx2_ptp_init()
441 ptp_ptr->ptp_info.settime64 = otx2_ptp_hw_settime; in otx2_ptp_init()
443 ptp_ptr->ptp_tstamp2nsec = otx2_ptp_hw_tstamp2time; in otx2_ptp_init()
445 ptp_ptr->ptp_info.adjtime = otx2_ptp_tc_adjtime; in otx2_ptp_init()
446 ptp_ptr->ptp_info.gettime64 = otx2_ptp_tc_gettime; in otx2_ptp_init()
447 ptp_ptr->ptp_info.settime64 = otx2_ptp_tc_settime; in otx2_ptp_init()
449 cc = &ptp_ptr->cycle_counter; in otx2_ptp_init()
454 ptp_ptr->ptp_tstamp2nsec = timecounter_cyc2time; in otx2_ptp_init()
456 timecounter_init(&ptp_ptr->time_counter, &ptp_ptr->cycle_counter, in otx2_ptp_init()
460 INIT_DELAYED_WORK(&ptp_ptr->extts_work, otx2_ptp_extts_check); in otx2_ptp_init()
462 ptp_ptr->ptp_clock = ptp_clock_register(&ptp_ptr->ptp_info, pfvf->dev); in otx2_ptp_init()
463 if (IS_ERR_OR_NULL(ptp_ptr->ptp_clock)) { in otx2_ptp_init()
464 err = ptp_ptr->ptp_clock ? in otx2_ptp_init()
465 PTR_ERR(ptp_ptr->ptp_clock) : -ENODEV; in otx2_ptp_init()
466 kfree(ptp_ptr); in otx2_ptp_init()
471 ptp_ptr->convert_rx_ptp_tstmp = &otx2_ptp_convert_rx_timestamp; in otx2_ptp_init()
472 ptp_ptr->convert_tx_ptp_tstmp = &otx2_ptp_convert_tx_timestamp; in otx2_ptp_init()
474 ptp_ptr->convert_rx_ptp_tstmp = &cn10k_ptp_convert_timestamp; in otx2_ptp_init()
475 ptp_ptr->convert_tx_ptp_tstmp = &cn10k_ptp_convert_timestamp; in otx2_ptp_init()
478 INIT_DELAYED_WORK(&ptp_ptr->synctstamp_work, otx2_sync_tstamp); in otx2_ptp_init()
480 pfvf->ptp = ptp_ptr; in otx2_ptp_init()