Skip to content

Commit 39a8cbd

Browse files
richardcochrandavem330
authored andcommitted
ptp: remember the adjusted frequency
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]>
1 parent 717ecc2 commit 39a8cbd

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

drivers/ptp/ptp_clock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
147147
} else if (tx->modes & ADJ_FREQUENCY) {
148148

149149
err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq));
150+
ptp->dialed_frequency = tx->freq;
150151
}
151152

152153
return err;

drivers/ptp/ptp_private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct ptp_clock {
4545
dev_t devid;
4646
int index; /* index into clocks.map */
4747
struct pps_device *pps_source;
48+
long dialed_frequency; /* remembers the frequency adjustment */
4849
struct timestamp_event_queue tsevq; /* simple fifo for time stamps */
4950
struct mutex tsevq_mux; /* one process at a time reading the fifo */
5051
wait_queue_head_t tsev_wq;

0 commit comments

Comments
 (0)