Lines Matching refs:ptp_data

59 		container_of((d), struct sja1105_private, ptp_data)
67 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_change_rxtstamping() local
76 ptp_cancel_worker_sync(ptp_data->clock); in sja1105_change_rxtstamping()
77 skb_queue_purge(&ptp_data->skb_txtstamp_queue); in sja1105_change_rxtstamping()
78 skb_queue_purge(&ptp_data->skb_rxtstamp_queue); in sja1105_change_rxtstamping()
156 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_get_ts_info() local
159 if (!ptp_data->clock) in sja1105_get_ts_info()
169 info->phc_index = ptp_clock_index(ptp_data->clock); in sja1105_get_ts_info()
353 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_extts_poll() local
365 if (ptpsyncts && ptp_data->ptpsyncts != ptpsyncts) { in sja1105_extts_poll()
369 ptp_clock_event(ptp_data->clock, &event); in sja1105_extts_poll()
371 ptp_data->ptpsyncts = ptpsyncts; in sja1105_extts_poll()
377 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_rxtstamp_work() local
378 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_rxtstamp_work()
382 mutex_lock(&ptp_data->lock); in sja1105_rxtstamp_work()
384 while ((skb = skb_dequeue(&ptp_data->skb_rxtstamp_queue)) != NULL) { in sja1105_rxtstamp_work()
405 if (ptp_data->extts_enabled) in sja1105_rxtstamp_work()
408 mutex_unlock(&ptp_data->lock); in sja1105_rxtstamp_work()
418 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_rxtstamp() local
426 skb_queue_tail(&ptp_data->skb_rxtstamp_queue, skb); in sja1105_rxtstamp()
427 ptp_schedule_worker(ptp_data->clock, 0); in sja1105_rxtstamp()
457 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1110_process_meta_tstamp() local
465 spin_lock(&ptp_data->skb_txtstamp_queue.lock); in sja1110_process_meta_tstamp()
467 skb_queue_walk_safe(&ptp_data->skb_txtstamp_queue, skb, skb_tmp) { in sja1110_process_meta_tstamp()
471 __skb_unlink(skb, &ptp_data->skb_txtstamp_queue); in sja1110_process_meta_tstamp()
477 spin_unlock(&ptp_data->skb_txtstamp_queue.lock); in sja1110_process_meta_tstamp()
494 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1110_txtstamp() local
509 skb_queue_tail(&ptp_data->skb_txtstamp_queue, clone); in sja1110_txtstamp()
537 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_ptp_reset() local
538 struct sja1105_ptp_cmd cmd = ptp_data->cmd; in sja1105_ptp_reset()
541 mutex_lock(&ptp_data->lock); in sja1105_ptp_reset()
550 mutex_unlock(&ptp_data->lock); in sja1105_ptp_reset()
578 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_ptp_gettimex() local
579 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_ptp_gettimex()
583 mutex_lock(&ptp_data->lock); in sja1105_ptp_gettimex()
588 mutex_unlock(&ptp_data->lock); in sja1105_ptp_gettimex()
597 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_ptp_mode_set() local
599 if (ptp_data->cmd.ptpclkadd == mode) in sja1105_ptp_mode_set()
602 ptp_data->cmd.ptpclkadd = mode; in sja1105_ptp_mode_set()
604 return sja1105_ptp_commit(priv->ds, &ptp_data->cmd, SPI_WRITE); in sja1105_ptp_mode_set()
631 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_ptp_settime() local
632 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_ptp_settime()
636 mutex_lock(&ptp_data->lock); in sja1105_ptp_settime()
640 mutex_unlock(&ptp_data->lock); in sja1105_ptp_settime()
647 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_ptp_adjfine() local
648 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_ptp_adjfine()
662 mutex_lock(&ptp_data->lock); in sja1105_ptp_adjfine()
669 mutex_unlock(&ptp_data->lock); in sja1105_ptp_adjfine()
696 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_ptp_adjtime() local
697 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_ptp_adjtime()
700 mutex_lock(&ptp_data->lock); in sja1105_ptp_adjtime()
704 mutex_unlock(&ptp_data->lock); in sja1105_ptp_adjtime()
709 static void sja1105_ptp_extts_setup_timer(struct sja1105_ptp_data *ptp_data) in sja1105_ptp_extts_setup_timer() argument
714 mod_timer(&ptp_data->extts_timer, expires); in sja1105_ptp_extts_setup_timer()
719 struct sja1105_ptp_data *ptp_data = extts_to_data(t); in sja1105_ptp_extts_timer() local
721 ptp_schedule_worker(ptp_data->clock, 0); in sja1105_ptp_extts_timer()
723 sja1105_ptp_extts_setup_timer(ptp_data); in sja1105_ptp_extts_timer()
761 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_per_out_enable() local
763 struct sja1105_ptp_cmd cmd = ptp_data->cmd; in sja1105_per_out_enable()
774 mutex_lock(&ptp_data->lock); in sja1105_per_out_enable()
838 mutex_unlock(&ptp_data->lock); in sja1105_per_out_enable()
870 priv->ptp_data.extts_enabled = on; in sja1105_extts_enable()
873 sja1105_ptp_extts_setup_timer(&priv->ptp_data); in sja1105_extts_enable()
875 del_timer_sync(&priv->ptp_data.extts_timer); in sja1105_extts_enable()
883 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_ptp_enable() local
884 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_ptp_enable()
898 struct sja1105_ptp_data *ptp_data = ptp_caps_to_data(ptp); in sja1105_ptp_verify_pin() local
899 struct sja1105_private *priv = ptp_data_to_sja1105(ptp_data); in sja1105_ptp_verify_pin()
928 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_ptp_clock_register() local
930 ptp_data->caps = (struct ptp_clock_info) { in sja1105_ptp_clock_register()
948 skb_queue_head_init(&ptp_data->skb_rxtstamp_queue); in sja1105_ptp_clock_register()
950 skb_queue_head_init(&ptp_data->skb_txtstamp_queue); in sja1105_ptp_clock_register()
952 ptp_data->clock = ptp_clock_register(&ptp_data->caps, ds->dev); in sja1105_ptp_clock_register()
953 if (IS_ERR_OR_NULL(ptp_data->clock)) in sja1105_ptp_clock_register()
954 return PTR_ERR(ptp_data->clock); in sja1105_ptp_clock_register()
956 ptp_data->cmd.corrclk4ts = true; in sja1105_ptp_clock_register()
957 ptp_data->cmd.ptpclkadd = PTP_SET_MODE; in sja1105_ptp_clock_register()
959 timer_setup(&ptp_data->extts_timer, sja1105_ptp_extts_timer, 0); in sja1105_ptp_clock_register()
967 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_ptp_clock_unregister() local
969 if (IS_ERR_OR_NULL(ptp_data->clock)) in sja1105_ptp_clock_unregister()
972 del_timer_sync(&ptp_data->extts_timer); in sja1105_ptp_clock_unregister()
973 ptp_cancel_worker_sync(ptp_data->clock); in sja1105_ptp_clock_unregister()
974 skb_queue_purge(&ptp_data->skb_txtstamp_queue); in sja1105_ptp_clock_unregister()
975 skb_queue_purge(&ptp_data->skb_rxtstamp_queue); in sja1105_ptp_clock_unregister()
976 ptp_clock_unregister(ptp_data->clock); in sja1105_ptp_clock_unregister()
977 ptp_data->clock = NULL; in sja1105_ptp_clock_unregister()
984 struct sja1105_ptp_data *ptp_data = &priv->ptp_data; in sja1105_ptp_txtstamp_skb() local
991 mutex_lock(&ptp_data->lock); in sja1105_ptp_txtstamp_skb()
1013 mutex_unlock(&ptp_data->lock); in sja1105_ptp_txtstamp_skb()