Skip to content

Commit

Permalink
ptp: remember the adjusted frequency
Browse files Browse the repository at this point in the history
This patch adds a field to the representation of a PTP hardware clock in
order to remember the frequency adjustment value dialed by the user.

Adding this field will let us answer queries in the manner of adjtimex
in a follow on patch.

Signed-off-by: Richard Cochran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
richardcochran authored and davem330 committed Sep 22, 2012
1 parent 717ecc2 commit 39a8cbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/ptp/ptp_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
} else if (tx->modes & ADJ_FREQUENCY) {

err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq));
ptp->dialed_frequency = tx->freq;
}

return err;
Expand Down
1 change: 1 addition & 0 deletions drivers/ptp/ptp_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct ptp_clock {
dev_t devid;
int index; /* index into clocks.map */
struct pps_device *pps_source;
long dialed_frequency; /* remembers the frequency adjustment */
struct timestamp_event_queue tsevq; /* simple fifo for time stamps */
struct mutex tsevq_mux; /* one process at a time reading the fifo */
wait_queue_head_t tsev_wq;
Expand Down

0 comments on commit 39a8cbd

Please sign in to comment.