Lines Matching full:ratio
364 static int ptp_clock_e1000_rate_adjust(const struct device *dev, double ratio) in ptp_clock_e1000_rate_adjust() argument
374 if (ratio == 1.0) { in ptp_clock_e1000_rate_adjust()
378 ratio *= context->clk_ratio; in ptp_clock_e1000_rate_adjust()
380 /* Limit possible ratio. */ in ptp_clock_e1000_rate_adjust()
381 if ((ratio > 1.0 + 1.0/(2.0 * hw_inc)) || in ptp_clock_e1000_rate_adjust()
382 (ratio < 1.0 - 1.0/(2.0 * hw_inc))) { in ptp_clock_e1000_rate_adjust()
386 /* Save new ratio. */ in ptp_clock_e1000_rate_adjust()
387 context->clk_ratio = ratio; in ptp_clock_e1000_rate_adjust()
389 if (ratio < 1.0) { in ptp_clock_e1000_rate_adjust()
391 val = 1.0 / (hw_inc * (1.0 - ratio)); in ptp_clock_e1000_rate_adjust()
392 } else if (ratio > 1.0) { in ptp_clock_e1000_rate_adjust()
394 val = 1.0 / (hw_inc * (ratio - 1.0)); in ptp_clock_e1000_rate_adjust()