/openbmc/linux/include/linux/ |
H A D | ptp_clock_kernel.h | 176 int (*adjfine)(struct ptp_clock_info *ptp, long scaled_ppm); 265 static inline bool diff_by_scaled_ppm(u64 base, long scaled_ppm, u64 *diff) in diff_by_scaled_ppm() argument 269 if (scaled_ppm < 0) { in diff_by_scaled_ppm() 271 scaled_ppm = -scaled_ppm; in diff_by_scaled_ppm() 274 *diff = mul_u64_u64_div_u64(base, (u64)scaled_ppm, 1000000ULL << 16); in diff_by_scaled_ppm() 287 static inline u64 adjust_by_scaled_ppm(u64 base, long scaled_ppm) in adjust_by_scaled_ppm() argument 291 if (diff_by_scaled_ppm(base, scaled_ppm, &diff)) in adjust_by_scaled_ppm()
|
/openbmc/linux/drivers/net/ethernet/renesas/ |
H A D | rcar_gen4_ptp.c | 29 static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in rcar_gen4_ptp_adjfine() argument 32 bool neg_adj = scaled_ppm < 0 ? true : false; in rcar_gen4_ptp_adjfine() 37 scaled_ppm = -scaled_ppm; in rcar_gen4_ptp_adjfine() 38 diff = div_s64(addend * scaled_ppm_to_ppb(scaled_ppm), NSEC_PER_SEC); in rcar_gen4_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/engleder/ |
H A D | tsnep_ptp.c | 76 static int tsnep_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in tsnep_ptp_adjfine() argument 83 if (scaled_ppm < 0) { in tsnep_ptp_adjfine() 84 scaled_ppm = -scaled_ppm; in tsnep_ptp_adjfine() 92 rate_offset = scaled_ppm; in tsnep_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/cavium/common/ |
H A D | cavium_ptp.c | 93 static int cavium_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm) in cavium_ptp_adjfine() argument 102 if (scaled_ppm < 0) { in cavium_ptp_adjfine() 104 scaled_ppm = -scaled_ppm; in cavium_ptp_adjfine() 123 adj = comp * scaled_ppm; in cavium_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/marvell/mvpp2/ |
H A D | mvpp2_tai.c | 164 static int mvpp22_tai_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in mvpp22_tai_adjfine() argument 173 neg_adj = scaled_ppm < 0; in mvpp22_tai_adjfine() 175 scaled_ppm = -scaled_ppm; in mvpp22_tai_adjfine() 177 val = mvpp22_calc_frac_ppm(tai, scaled_ppm); in mvpp22_tai_adjfine()
|
/openbmc/linux/drivers/net/ethernet/microchip/sparx5/ |
H A D | sparx5_ptp.c | 391 static int sparx5_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in sparx5_ptp_adjfine() argument 400 if (!scaled_ppm) in sparx5_ptp_adjfine() 403 if (scaled_ppm < 0) { in sparx5_ptp_adjfine() 405 scaled_ppm = -scaled_ppm; in sparx5_ptp_adjfine() 414 ref = sparx5_ptp_get_1ppm(sparx5) * (scaled_ppm >> 16); in sparx5_ptp_adjfine() 415 ref += (sparx5_ptp_get_1ppm(sparx5) * (0xffff & scaled_ppm)) >> 16; in sparx5_ptp_adjfine()
|
/openbmc/linux/drivers/net/dsa/hirschmann/ |
H A D | hellcreek_ptp.c | 127 static int hellcreek_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in hellcreek_ptp_adjfine() argument 134 if (scaled_ppm < 0) { in hellcreek_ptp_adjfine() 136 scaled_ppm = -scaled_ppm; in hellcreek_ptp_adjfine() 151 adj = scaled_ppm; in hellcreek_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/marvell/octeontx2/af/ |
H A D | ptp.c | 311 static int ptp_adjfine(struct ptp *ptp, long scaled_ppm) in ptp_adjfine() argument 318 if (scaled_ppm < 0) { in ptp_adjfine() 320 scaled_ppm = -scaled_ppm; in ptp_adjfine() 338 ppb = 1 + scaled_ppm; in ptp_adjfine() 605 err = ptp_adjfine(rvu->ptp, req->scaled_ppm); in rvu_mbox_handler_ptp_op()
|
/openbmc/linux/drivers/net/ethernet/cadence/ |
H A D | macb_ptp.c | 122 static int gem_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in gem_ptp_adjfine() argument 130 if (scaled_ppm < 0) { in gem_ptp_adjfine() 132 scaled_ppm = -scaled_ppm; in gem_ptp_adjfine() 141 adj = (u64)scaled_ppm * word; in gem_ptp_adjfine()
|
/openbmc/linux/drivers/net/dsa/mv88e6xxx/ |
H A D | ptp.c | 255 static int mv88e6xxx_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in mv88e6xxx_ptp_adjfine() argument 262 if (scaled_ppm < 0) { in mv88e6xxx_ptp_adjfine() 264 scaled_ppm = -scaled_ppm; in mv88e6xxx_ptp_adjfine() 269 adj *= scaled_ppm; in mv88e6xxx_ptp_adjfine()
|
/openbmc/linux/drivers/ptp/ |
H A D | ptp_mock.c | 49 static int mock_phc_adjfine(struct ptp_clock_info *info, long scaled_ppm) in mock_phc_adjfine() argument 54 adj = (s64)scaled_ppm << MOCK_PHC_FADJ_SHIFT; in mock_phc_adjfine()
|
H A D | ptp_qoriq.c | 202 int ptp_qoriq_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ptp_qoriq_adjfine() argument 210 if (scaled_ppm < 0) { in ptp_qoriq_adjfine() 212 scaled_ppm = -scaled_ppm; in ptp_qoriq_adjfine() 223 diff = mul_u64_u64_div_u64(adj, scaled_ppm, 32768000000); in ptp_qoriq_adjfine()
|
H A D | ptp_idt82p33.c | 535 static int _idt82p33_adjfine(struct idt82p33_channel *channel, long scaled_ppm) in _idt82p33_adjfine() argument 556 fcw = scaled_ppm * 762939453125ULL; in _idt82p33_adjfine() 578 s64 scaled_ppm = div_s64(((s64)ddco_ppb << 13), 125); in idt82p33_ddco_scaled_ppm() local 581 current_ppm += scaled_ppm; in idt82p33_ddco_scaled_ppm() 1022 static int idt82p33_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in idt82p33_adjfine() argument 1032 if (scaled_ppm == channel->current_freq) in idt82p33_adjfine() 1036 err = _idt82p33_adjfine(channel, scaled_ppm); in idt82p33_adjfine() 1039 channel->current_freq = scaled_ppm; in idt82p33_adjfine()
|
H A D | ptp_dte.c | 137 static int ptp_dte_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ptp_dte_adjfine() argument 139 s32 ppb = scaled_ppm_to_ppb(scaled_ppm); in ptp_dte_adjfine()
|
H A D | ptp_vclock.c | 43 static int ptp_vclock_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ptp_vclock_adjfine() argument 48 adj = (s64)scaled_ppm << PTP_VCLOCK_FADJ_SHIFT; in ptp_vclock_adjfine()
|
/openbmc/linux/drivers/net/ethernet/amd/xgbe/ |
H A D | xgbe-ptp.c | 137 static int xgbe_adjfine(struct ptp_clock_info *info, long scaled_ppm) in xgbe_adjfine() argument 145 addend = adjust_by_scaled_ppm(pdata->tstamp_addend, scaled_ppm); in xgbe_adjfine()
|
/openbmc/linux/drivers/net/wireless/intel/iwlwifi/mvm/ |
H A D | ptp.c | 238 static int iwl_mvm_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in iwl_mvm_ptp_adjfine() argument 258 data->scaled_freq = SCALE_FACTOR + scaled_ppm; in iwl_mvm_ptp_adjfine() 260 scaled_ppm, (unsigned long long)data->scaled_freq); in iwl_mvm_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/microchip/lan966x/ |
H A D | lan966x_ptp.c | 596 static int lan966x_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in lan966x_ptp_adjfine() argument 605 if (!scaled_ppm) in lan966x_ptp_adjfine() 608 if (scaled_ppm < 0) { in lan966x_ptp_adjfine() 610 scaled_ppm = -scaled_ppm; in lan966x_ptp_adjfine() 619 ref = LAN966X_1PPM_FORMAT * (scaled_ppm >> 16); in lan966x_ptp_adjfine() 620 ref += (LAN966X_1PPM_FORMAT * (0xffff & scaled_ppm)) >> 16; in lan966x_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/mscc/ |
H A D | ocelot_ptp.c | 138 int ocelot_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ocelot_ptp_adjfine() argument 147 if (!scaled_ppm) in ocelot_ptp_adjfine() 150 if (scaled_ppm < 0) { in ocelot_ptp_adjfine() 152 scaled_ppm = -scaled_ppm; in ocelot_ptp_adjfine() 156 do_div(adj, scaled_ppm); in ocelot_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx4/ |
H A D | en_clock.c | 128 static int mlx4_en_phc_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in mlx4_en_phc_adjfine() argument 135 mult = (u32)adjust_by_scaled_ppm(mdev->nominal_c_mult, scaled_ppm); in mlx4_en_phc_adjfine()
|
/openbmc/linux/include/soc/mscc/ |
H A D | ocelot_ptp.h | 52 int ocelot_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm);
|
/openbmc/linux/drivers/net/phy/ |
H A D | bcm-phy-ptp.c | 344 static int bcm_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm) in bcm_ptp_adjfine() argument 352 if (scaled_ppm < 0) { in bcm_ptp_adjfine() 354 scaled_ppm = -scaled_ppm; in bcm_ptp_adjfine() 357 adj = scaled_ppm << 9; in bcm_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/xscale/ |
H A D | ptp_ixp46x.c | 123 static int ptp_ixp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in ptp_ixp_adjfine() argument 129 addend = adjust_by_scaled_ppm(DEFAULT_ADDEND, scaled_ppm); in ptp_ixp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/marvell/octeontx2/nic/ |
H A D | otx2_ptp.c | 142 static int otx2_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm) in otx2_ptp_adjfine() argument 156 req->scaled_ppm = scaled_ppm; in otx2_ptp_adjfine()
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx5/core/lib/ |
H A D | clock.c | 395 static int mlx5_ptp_freq_adj_real_time(struct mlx5_core_dev *mdev, long scaled_ppm) in mlx5_ptp_freq_adj_real_time() argument 407 MLX5_SET(mtutc_reg, in, freq_adjustment, scaled_ppm); in mlx5_ptp_freq_adj_real_time() 410 MLX5_SET(mtutc_reg, in, freq_adjustment, scaled_ppm_to_ppb(scaled_ppm)); in mlx5_ptp_freq_adj_real_time() 416 static int mlx5_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) in mlx5_ptp_adjfine() argument 427 err = mlx5_ptp_freq_adj_real_time(mdev, scaled_ppm); in mlx5_ptp_adjfine() 431 mult = (u32)adjust_by_scaled_ppm(timer->nominal_c_mult, scaled_ppm); in mlx5_ptp_adjfine()
|