Lines Matching refs:ts

265 				      const struct timespec64 *ts)  in mlx5_ptp_settime_real_time()  argument
272 if (ts->tv_sec < 0 || ts->tv_sec > U32_MAX || in mlx5_ptp_settime_real_time()
273 ts->tv_nsec < 0 || ts->tv_nsec > NSEC_PER_SEC) in mlx5_ptp_settime_real_time()
277 MLX5_SET(mtutc_reg, in, utc_sec, ts->tv_sec); in mlx5_ptp_settime_real_time()
278 MLX5_SET(mtutc_reg, in, utc_nsec, ts->tv_nsec); in mlx5_ptp_settime_real_time()
283 static int mlx5_ptp_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) in mlx5_ptp_settime() argument
292 err = mlx5_ptp_settime_real_time(mdev, ts); in mlx5_ptp_settime()
297 timecounter_init(&timer->tc, &timer->cycles, timespec64_to_ns(ts)); in mlx5_ptp_settime()
308 struct timespec64 ts; in mlx5_ptp_gettimex_real_time() local
312 ts = ns_to_timespec64(time); in mlx5_ptp_gettimex_real_time()
313 return ts; in mlx5_ptp_gettimex_real_time()
316 static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts, in mlx5_ptp_gettimex() argument
327 *ts = mlx5_ptp_gettimex_real_time(mdev, sts); in mlx5_ptp_gettimex()
335 *ts = ns_to_timespec64(ns); in mlx5_ptp_gettimex()
349 struct timespec64 ts; in mlx5_ptp_adjtime_real_time() local
352 ts = mlx5_ptp_gettimex_real_time(mdev, NULL); in mlx5_ptp_adjtime_real_time()
353 ns = timespec64_to_ns(&ts) + delta; in mlx5_ptp_adjtime_real_time()
354 ts = ns_to_timespec64(ns); in mlx5_ptp_adjtime_real_time()
355 return mlx5_ptp_settime_real_time(mdev, &ts); in mlx5_ptp_adjtime_real_time()
527 struct timespec64 ts = {}; in perout_conf_internal_timer() local
530 ts.tv_sec = sec; in perout_conf_internal_timer()
531 target_ns = timespec64_to_ns(&ts); in perout_conf_internal_timer()
544 struct timespec64 ts; in perout_conf_1pps() local
547 ts.tv_nsec = rq->perout.period.nsec; in perout_conf_1pps()
548 ts.tv_sec = rq->perout.period.sec; in perout_conf_1pps()
549 ns = timespec64_to_ns(&ts); in perout_conf_1pps()
567 struct timespec64 ts; in mlx5_perout_conf_out_pulse_duration() local
570 ts.tv_sec = rq->perout.on.sec; in mlx5_perout_conf_out_pulse_duration()
571 ts.tv_nsec = rq->perout.on.nsec; in mlx5_perout_conf_out_pulse_duration()
572 out_pulse_duration = (u32)timespec64_to_ns(&ts); in mlx5_perout_conf_out_pulse_duration()
577 ts.tv_sec = rq->perout.period.sec; in mlx5_perout_conf_out_pulse_duration()
578 ts.tv_nsec = rq->perout.period.nsec; in mlx5_perout_conf_out_pulse_duration()
579 out_pulse_duration = (u32)timespec64_to_ns(&ts) >> 1; in mlx5_perout_conf_out_pulse_duration()
600 struct timespec64 ts; in perout_conf_npps_real_time() local
602 ts.tv_sec = rq->perout.period.sec; in perout_conf_npps_real_time()
603 ts.tv_nsec = rq->perout.period.nsec; in perout_conf_npps_real_time()
604 if (timespec64_to_ns(&ts) < pps_info->min_npps_period) { in perout_conf_npps_real_time()
866 static void ts_next_sec(struct timespec64 *ts) in ts_next_sec() argument
868 ts->tv_sec += 1; in ts_next_sec()
869 ts->tv_nsec = 0; in ts_next_sec()
875 struct timespec64 ts; in perout_conf_next_event_timer() local
878 mlx5_ptp_gettimex(&clock->ptp_info, &ts, NULL); in perout_conf_next_event_timer()
879 ts_next_sec(&ts); in perout_conf_next_event_timer()
880 target_ns = timespec64_to_ns(&ts); in perout_conf_next_event_timer()
1017 struct timespec64 ts; in mlx5_init_timer_clock() local
1019 ktime_get_real_ts64(&ts); in mlx5_init_timer_clock()
1020 mlx5_ptp_settime(&clock->ptp_info, &ts); in mlx5_init_timer_clock()