Commit d3f1cbd2 authored by Vincent Cheng's avatar Vincent Cheng Committed by David S. Miller

ptp: Add adjust_phase to ptp_clock_caps capability.

Add adjust_phase to ptp_clock_caps capability to allow
user to query if a PHC driver supports adjust phase with
ioctl PTP_CLOCK_GETCAPS command.
Signed-off-by: default avatarVincent Cheng <vincent.cheng.xh@renesas.com>
Reviewed-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 184ecc9e
...@@ -136,6 +136,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) ...@@ -136,6 +136,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
caps.pps = ptp->info->pps; caps.pps = ptp->info->pps;
caps.n_pins = ptp->info->n_pins; caps.n_pins = ptp->info->n_pins;
caps.cross_timestamping = ptp->info->getcrosststamp != NULL; caps.cross_timestamping = ptp->info->getcrosststamp != NULL;
caps.adjust_phase = ptp->info->adjphase != NULL;
if (copy_to_user((void __user *)arg, &caps, sizeof(caps))) if (copy_to_user((void __user *)arg, &caps, sizeof(caps)))
err = -EFAULT; err = -EFAULT;
break; break;
......
...@@ -89,7 +89,9 @@ struct ptp_clock_caps { ...@@ -89,7 +89,9 @@ struct ptp_clock_caps {
int n_pins; /* Number of input/output pins. */ int n_pins; /* Number of input/output pins. */
/* Whether the clock supports precise system-device cross timestamps */ /* Whether the clock supports precise system-device cross timestamps */
int cross_timestamping; int cross_timestamping;
int rsv[13]; /* Reserved for future use. */ /* Whether the clock supports adjust phase */
int adjust_phase;
int rsv[12]; /* Reserved for future use. */
}; };
struct ptp_extts_request { struct ptp_extts_request {
......
...@@ -269,14 +269,16 @@ int main(int argc, char *argv[]) ...@@ -269,14 +269,16 @@ int main(int argc, char *argv[])
" %d programmable periodic signals\n" " %d programmable periodic signals\n"
" %d pulse per second\n" " %d pulse per second\n"
" %d programmable pins\n" " %d programmable pins\n"
" %d cross timestamping\n", " %d cross timestamping\n"
" %d adjust_phase\n",
caps.max_adj, caps.max_adj,
caps.n_alarm, caps.n_alarm,
caps.n_ext_ts, caps.n_ext_ts,
caps.n_per_out, caps.n_per_out,
caps.pps, caps.pps,
caps.n_pins, caps.n_pins,
caps.cross_timestamping); caps.cross_timestamping,
caps.adjust_phase);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment