summaryrefslogtreecommitdiff
path: root/drivers/ptp
diff options
context:
space:
mode:
authorVincent Cheng <vincent.cheng.xh@renesas.com>2020-05-02 06:35:36 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-03 02:31:44 +0300
commit184ecc9eb260d5a3bcdddc5bebd18f285ac004e9 (patch)
treee935fd5cc9a21917182107a4872895bf7ee63e7b /drivers/ptp
parent115506fea499f1cd9a80290b31eca4352e0559e9 (diff)
downloadlinux-184ecc9eb260d5a3bcdddc5bebd18f285ac004e9.tar.xz
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;