ptp: mlx5: convert to .adjfine and adjust_by_scaled_ppm
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 28 Oct 2022 11:04:16 +0000 (04:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Oct 2022 11:14:16 +0000 (11:14 +0000)
commitd8aad3f3694f1170fb4ea8030e3d8a27324e81d2
tree21f059c1f89a50eff4f552c50565d1ac7291e667
parent6ed795965ede203d762f59b791e3490eb6f74b13
ptp: mlx5: convert to .adjfine and adjust_by_scaled_ppm

The mlx5 implementation of .adjfreq is implemented in terms of a
straight forward "base * ppb / 1 billion" calculation.

Convert this to the .adjfine interface and use adjust_by_scaled_ppm for the
calculation  of the new mult value.

Note that the mlx5_ptp_adjfreq_real_time function expects input in terms of
ppb, so use the scaled_ppm_to_ppb to convert before passing to this
function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Shirly Ohnona <shirlyo@nvidia.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Cc: Gal Pressman <gal@nvidia.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Aya Levin <ayal@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c