diff options
author | Vincent Cheng <vincent.cheng.xh@renesas.com> | 2020-05-01 23:35:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-02 16:31:44 -0700 |
commit | 184ecc9eb260d5a3bcdddc5bebd18f285ac004e9 (patch) | |
tree | e935fd5cc9a21917182107a4872895bf7ee63e7b /drivers/ptp/ptp_clock.c | |
parent | 115506fea499f1cd9a80290b31eca4352e0559e9 (diff) | |
download | linux-184ecc9eb260d5a3bcdddc5bebd18f285ac004e9.tar.gz linux-184ecc9eb260d5a3bcdddc5bebd18f285ac004e9.tar.bz2 linux-184ecc9eb260d5a3bcdddc5bebd18f285ac004e9.zip |
ptp: Add adjphase function to support phase offset control.
Adds adjust phase function to take advantage of a PHC
clock's hardware filtering capability that uses phase offset
control word instead of frequency offset control word.
Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
Reviewed-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp/ptp_clock.c')
-rw-r--r-- | drivers/ptp/ptp_clock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index acabbe72e55e..fc984a8828fb 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c @@ -146,6 +146,9 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx) else err = ops->adjfreq(ops, ppb); ptp->dialed_frequency = tx->freq; + } else if (tx->modes & ADJ_OFFSET) { + if (ops->adjphase) + err = ops->adjphase(ops, tx->offset); } else if (tx->modes == 0) { tx->freq = ptp->dialed_frequency; err = 0; |