Lines Matching +full:default +full:- +full:sample +full:- +full:phase

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * PTP 1588 clock support - User space test program
35 #define CLOCK_INVALID -1
113 return t->sec * NSEC_PER_SEC + t->nsec; in pctns()
120 " -c query the ptp clock's capabilities\n" in usage()
121 " -d name device to open\n" in usage()
122 " -e val read 'val' external time stamp events\n" in usage()
123 " -f val adjust the ptp clock frequency by 'val' ppb\n" in usage()
124 " -F chan Enable single channel mask and keep device open for debugfs verification.\n" in usage()
125 " -g get the ptp clock time\n" in usage()
126 " -h prints this message\n" in usage()
127 " -i val index for event/trigger\n" in usage()
128 " -k val measure the time offset between system and phc clock\n" in usage()
130 " -l list the current pin configuration\n" in usage()
131 " -L pin,val configure pin index 'pin' with function 'val'\n" in usage()
132 " the channel index is taken from the '-i' option\n" in usage()
134 " 0 - none\n" in usage()
135 " 1 - external time stamp\n" in usage()
136 " 2 - periodic output\n" in usage()
137 " -n val shift the ptp clock time by 'val' nanoseconds\n" in usage()
138 " -o val phase offset (in nanoseconds) to be provided to the PHC servo\n" in usage()
139 " -p val enable output with a period of 'val' nanoseconds\n" in usage()
140 " -H val set output phase to 'val' nanoseconds (requires -p)\n" in usage()
141 " -w val set output pulse width to 'val' nanoseconds (requires -p)\n" in usage()
142 " -P val enable or disable (val=1|0) the system clock PPS\n" in usage()
143 " -s set the ptp clock time from the system time\n" in usage()
144 " -S set the system time from the ptp clock time\n" in usage()
145 " -t val shift the ptp clock time by 'val' seconds\n" in usage()
146 " -T val set the ptp clock time to 'val' seconds\n" in usage()
147 " -x val get an extended ptp clock time with the desired number of samples (up to %d)\n" in usage()
148 " -X get a ptp clock cross timestamp\n" in usage()
149 " -y val pre/post tstamp timebase to use {realtime|monotonic|monotonic-raw}\n" in usage()
150 " -z test combinations of rising/falling external time stamp flags\n", in usage()
188 int pin_index = -1, pin_func; in main()
189 int pps = -1; in main()
192 int channel = -1; in main()
197 int64_t perout_phase = -1; in main()
198 int64_t pulsewidth = -1; in main()
199 int64_t perout = -1; in main()
240 return -1; in main()
277 return -1; in main()
288 else if (!strcasecmp(optarg, "monotonic-raw")) in main()
292 "type needs to be realtime, monotonic or monotonic-raw; was given %s\n", in main()
294 return -1; in main()
305 default: in main()
307 return -1; in main()
314 return -1; in main()
320 return -1; in main()
336 " %d maximum phase adjustment (ns)\n", in main()
366 tx.time.tv_sec -= 1; in main()
385 puts("phase adjustment okay"); in main()
448 for (; extts; extts--) { in main()
488 puts("-w can only be specified together with -p"); in main()
489 return -1; in main()
493 puts("-H can only be specified together with -p"); in main()
494 return -1; in main()
500 return -1; in main()
514 perout_request.phase.sec = perout_phase / NSEC_PER_SEC; in main()
515 perout_request.phase.nsec = perout_phase % NSEC_PER_SEC; in main()
528 if (pps != -1) { in main()
541 return -1; in main()
547 return -1; in main()
549 sysoff->n_samples = n_samples; in main()
556 pct = &sysoff->ts[0]; in main()
557 for (i = 0; i < sysoff->n_samples; i++) { in main()
561 interval = t2 - t1; in main()
562 offset = (t2 + t1) / 2 - tp; in main()
565 (pct+2*i)->sec, (pct+2*i)->nsec); in main()
567 (pct+2*i+1)->sec, (pct+2*i+1)->nsec); in main()
569 (pct+2*i+2)->sec, (pct+2*i+2)->nsec); in main()
582 return -1; in main()
585 soe->n_samples = getextended; in main()
586 soe->clockid = ext_clockid; in main()
597 printf("sample #%2d: real time before: %lld.%09u\n", in main()
598 i, soe->ts[i][0].sec, in main()
599 soe->ts[i][0].nsec); in main()
602 printf("sample #%2d: monotonic time before: %lld.%09u\n", in main()
603 i, soe->ts[i][0].sec, in main()
604 soe->ts[i][0].nsec); in main()
607 printf("sample #%2d: monotonic-raw time before: %lld.%09u\n", in main()
608 i, soe->ts[i][0].sec, in main()
609 soe->ts[i][0].nsec); in main()
611 default: in main()
615 soe->ts[i][1].sec, soe->ts[i][1].nsec); in main()
619 soe->ts[i][2].sec, in main()
620 soe->ts[i][2].nsec); in main()
624 soe->ts[i][2].sec, in main()
625 soe->ts[i][2].nsec); in main()
628 printf(" monotonic-raw time after: %lld.%09u\n", in main()
629 soe->ts[i][2].sec, in main()
630 soe->ts[i][2].nsec); in main()
632 default: in main()
645 return -1; in main()
654 xts->device.sec, xts->device.nsec); in main()
656 xts->sys_realtime.sec, xts->sys_realtime.nsec); in main()
658 xts->sys_monoraw.sec, xts->sys_monoraw.nsec); in main()