Lines Matching refs:nsec
114 static u64 mlxsw_sp1_ptp_ns2cycles(const struct timecounter *tc, u64 nsec) in mlxsw_sp1_ptp_ns2cycles() argument
116 u64 cycles = (u64) nsec; in mlxsw_sp1_ptp_ns2cycles()
125 mlxsw_sp1_ptp_phc_settime(struct mlxsw_sp_ptp_clock *clock, u64 nsec) in mlxsw_sp1_ptp_phc_settime() argument
133 next_sec = div_u64(nsec, NSEC_PER_SEC) + 1; in mlxsw_sp1_ptp_phc_settime()
184 u64 nsec; in mlxsw_sp1_ptp_adjtime() local
188 nsec = timecounter_read(&clock->tc); in mlxsw_sp1_ptp_adjtime()
191 return mlxsw_sp1_ptp_phc_settime(clock, nsec); in mlxsw_sp1_ptp_adjtime()
200 u64 cycles, nsec; in mlxsw_sp1_ptp_gettimex() local
204 nsec = timecounter_cyc2time(&clock->tc, cycles); in mlxsw_sp1_ptp_gettimex()
207 *ts = ns_to_timespec64(nsec); in mlxsw_sp1_ptp_gettimex()
217 u64 nsec = timespec64_to_ns(ts); in mlxsw_sp1_ptp_settime() local
220 timecounter_init(&clock->tc, &clock->cycles, nsec); in mlxsw_sp1_ptp_settime()
221 nsec = timecounter_read(&clock->tc); in mlxsw_sp1_ptp_settime()
224 return mlxsw_sp1_ptp_phc_settime(clock, nsec); in mlxsw_sp1_ptp_settime()
253 u64 overflow_cycles, nsec, frac = 0; in mlxsw_sp1_ptp_clock_init() local
283 nsec = cyclecounter_cyc2ns(&clock->cycles, overflow_cycles, 0, &frac); in mlxsw_sp1_ptp_clock_init()
284 clock->overflow_period = nsecs_to_jiffies(nsec); in mlxsw_sp1_ptp_clock_init()
442 u64 nsec; in mlxsw_sp1_packet_timestamp() local
445 nsec = timecounter_cyc2time(&mlxsw_sp->clock->tc, timestamp); in mlxsw_sp1_packet_timestamp()
448 hwtstamps.hwtstamp = ns_to_ktime(nsec); in mlxsw_sp1_packet_timestamp()