diff options
author | Richard Cochran <richardcochran@gmail.com> | 2012-09-22 03:02:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-22 15:42:08 -0400 |
commit | 5c35bad5ffe5accde6b0ef4468b39e1db0806b94 (patch) | |
tree | fee97b7d9660d3bb4c070aefad1bdbd07feae0bd /drivers/ptp | |
parent | 39a8cbd9ca051fb164db70315e7972de5c153c33 (diff) |
ptp: provide the clock's adjusted frequency
If the timex.mode field indicates a query, then we provide the value of
the current frequency adjustment.
[ Get rid of extraneous empty lines -DaveM ]
Signed-off-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c index 67e628ee036..c470ddf1a6f 100644 --- a/drivers/ptp/ptp_clock.c +++ b/drivers/ptp/ptp_clock.c | |||
@@ -143,11 +143,12 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx) | |||
143 | kt = timespec_to_ktime(ts); | 143 | kt = timespec_to_ktime(ts); |
144 | delta = ktime_to_ns(kt); | 144 | delta = ktime_to_ns(kt); |
145 | err = ops->adjtime(ops, delta); | 145 | err = ops->adjtime(ops, delta); |
146 | |||
147 | } else if (tx->modes & ADJ_FREQUENCY) { | 146 | } else if (tx->modes & ADJ_FREQUENCY) { |
148 | |||
149 | err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq)); | 147 | err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq)); |
150 | ptp->dialed_frequency = tx->freq; | 148 | ptp->dialed_frequency = tx->freq; |
149 | } else if (tx->modes == 0) { | ||
150 | tx->freq = ptp->dialed_frequency; | ||
151 | err = 0; | ||
151 | } | 152 | } |
152 | 153 | ||
153 | return err; | 154 | return err; |