mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 02:32:08 +03:00
ptp: Linux v6.2: Add support for adjfine
In Linux v6.2 func pointer adjfreq is replaced with adjfine. As a part of this, an argument of the function "s32 ppb" is changed to "long scaled_ppm".Added kernel version checks to handle this for Linux v6.2 Bug 3936429 Change-Id: I7a4f0a0e6e17d484c4ffd47e6e9ef78c214253e7 Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862518 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
4630f1b6d9
commit
024d4d5e6f
@@ -125,11 +125,16 @@ static int ether_adjust_time(struct ptp_clock_info *ptp, s64 nsec_delta)
|
||||
*
|
||||
* @param[in] ptp: Pointer to ptp_clock_info structure.
|
||||
* @param[in] ppb: Desired period change in parts per billion.
|
||||
* @param[in] scaled_ppm: Desired period change in parts per million.
|
||||
*
|
||||
* @retval 0 on success
|
||||
* @retval "negative value" on failure.
|
||||
*/
|
||||
static int ether_adjust_freq(struct ptp_clock_info *ptp, s32 ppb)
|
||||
#if KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE
|
||||
static int ether_adjust_clock(struct ptp_clock_info *ptp, s32 ppb)
|
||||
#else
|
||||
static int ether_adjust_clock(struct ptp_clock_info *ptp, long scaled_ppm)
|
||||
#endif
|
||||
{
|
||||
struct ether_priv_data *pdata = container_of(ptp,
|
||||
struct ether_priv_data,
|
||||
@@ -138,6 +143,9 @@ static int ether_adjust_freq(struct ptp_clock_info *ptp, s32 ppb)
|
||||
struct osi_ioctl ioctl_data = {};
|
||||
unsigned long flags;
|
||||
int ret = -1;
|
||||
#if KERNEL_VERSION(6, 2, 0) <= LINUX_VERSION_CODE
|
||||
s32 ppb = scaled_ppm_to_ppb(scaled_ppm);
|
||||
#endif
|
||||
|
||||
raw_spin_lock_irqsave(&pdata->ptp_lock, flags);
|
||||
|
||||
@@ -245,7 +253,11 @@ static struct ptp_clock_info ether_ptp_clock_ops = {
|
||||
.n_ext_ts = 0,
|
||||
.n_per_out = 0,
|
||||
.pps = 0,
|
||||
.adjfreq = ether_adjust_freq,
|
||||
#if KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE
|
||||
.adjfreq = ether_adjust_clock,
|
||||
#else
|
||||
.adjfine = ether_adjust_clock,
|
||||
#endif
|
||||
.adjtime = ether_adjust_time,
|
||||
.gettime64 = ether_get_time,
|
||||
.settime64 = ether_set_time,
|
||||
|
||||
Reference in New Issue
Block a user