mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 23:20:32 -04:00
net: stmmac: Only update the auto-discovered PTP clock features
Some DWMAC variants such as dwmac1000 don't support discovering the number of output pps and auxiliary snapshots. Allow these parameters to be defined in default ptp_clock_info, and let them be updated only when the feature discovery yielded a result. Reviewed-by: Daniel Machon <daniel.machon@microchip.com> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20241112170658.2388529-4-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
13e908800c
commit
0bfd0afc74
@@ -303,8 +303,14 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
|
||||
if (priv->plat->has_gmac4 && priv->plat->clk_ptp_rate)
|
||||
priv->plat->cdc_error_adj = (2 * NSEC_PER_SEC) / priv->plat->clk_ptp_rate;
|
||||
|
||||
priv->ptp_clock_ops.n_per_out = priv->dma_cap.pps_out_num;
|
||||
priv->ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n;
|
||||
/* Update the ptp clock parameters based on feature discovery, when
|
||||
* available
|
||||
*/
|
||||
if (priv->dma_cap.pps_out_num)
|
||||
priv->ptp_clock_ops.n_per_out = priv->dma_cap.pps_out_num;
|
||||
|
||||
if (priv->dma_cap.aux_snapshot_n)
|
||||
priv->ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n;
|
||||
|
||||
if (priv->plat->ptp_max_adj)
|
||||
priv->ptp_clock_ops.max_adj = priv->plat->ptp_max_adj;
|
||||
|
||||
Reference in New Issue
Block a user