summaryrefslogtreecommitdiffstats
path: root/drivers/ptp
diff options
context:
space:
mode:
authorVincent Cheng <vincent.cheng.xh@renesas.com>2020-05-02 05:35:36 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-03 01:31:44 +0200
commit184ecc9eb260d5a3bcdddc5bebd18f285ac004e9 (patch)
treee935fd5cc9a21917182107a4872895bf7ee63e7b /drivers/ptp
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next (diff)
downloadlinux-184ecc9eb260d5a3bcdddc5bebd18f285ac004e9.tar.xz
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')
-rw-r--r--drivers/ptp/ptp_clock.c3
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;