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>
This commit is contained in:
parent
115506fea4
commit
184ecc9eb2
@ -146,6 +146,9 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx)
|
|||||||
else
|
else
|
||||||
err = ops->adjfreq(ops, ppb);
|
err = ops->adjfreq(ops, ppb);
|
||||||
ptp->dialed_frequency = tx->freq;
|
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) {
|
} else if (tx->modes == 0) {
|
||||||
tx->freq = ptp->dialed_frequency;
|
tx->freq = ptp->dialed_frequency;
|
||||||
err = 0;
|
err = 0;
|
||||||
|
@ -36,7 +36,7 @@ struct ptp_system_timestamp {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ptp_clock_info - decribes a PTP hardware clock
|
* struct ptp_clock_info - describes a PTP hardware clock
|
||||||
*
|
*
|
||||||
* @owner: The clock driver should set to THIS_MODULE.
|
* @owner: The clock driver should set to THIS_MODULE.
|
||||||
* @name: A short "friendly name" to identify the clock and to
|
* @name: A short "friendly name" to identify the clock and to
|
||||||
@ -65,6 +65,9 @@ struct ptp_system_timestamp {
|
|||||||
* parameter delta: Desired frequency offset from nominal frequency
|
* parameter delta: Desired frequency offset from nominal frequency
|
||||||
* in parts per billion
|
* in parts per billion
|
||||||
*
|
*
|
||||||
|
* @adjphase: Adjusts the phase offset of the hardware clock.
|
||||||
|
* parameter delta: Desired change in nanoseconds.
|
||||||
|
*
|
||||||
* @adjtime: Shifts the time of the hardware clock.
|
* @adjtime: Shifts the time of the hardware clock.
|
||||||
* parameter delta: Desired change in nanoseconds.
|
* parameter delta: Desired change in nanoseconds.
|
||||||
*
|
*
|
||||||
@ -128,6 +131,7 @@ struct ptp_clock_info {
|
|||||||
struct ptp_pin_desc *pin_config;
|
struct ptp_pin_desc *pin_config;
|
||||||
int (*adjfine)(struct ptp_clock_info *ptp, long scaled_ppm);
|
int (*adjfine)(struct ptp_clock_info *ptp, long scaled_ppm);
|
||||||
int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta);
|
int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta);
|
||||||
|
int (*adjphase)(struct ptp_clock_info *ptp, s32 phase);
|
||||||
int (*adjtime)(struct ptp_clock_info *ptp, s64 delta);
|
int (*adjtime)(struct ptp_clock_info *ptp, s64 delta);
|
||||||
int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts);
|
int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts);
|
||||||
int (*gettimex64)(struct ptp_clock_info *ptp, struct timespec64 *ts,
|
int (*gettimex64)(struct ptp_clock_info *ptp, struct timespec64 *ts,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user