Lines Matching refs:ratio
1662 static int ptp_clock_mcux_rate_adjust(const struct device *dev, double ratio) in ptp_clock_mcux_rate_adjust() argument
1672 if ((ratio > 1.0 && ratio - 1.0 < 0.00000001) || in ptp_clock_mcux_rate_adjust()
1673 (ratio < 1.0 && 1.0 - ratio < 0.00000001)) { in ptp_clock_mcux_rate_adjust()
1677 ratio *= context->clk_ratio; in ptp_clock_mcux_rate_adjust()
1680 if ((ratio > 1.0 + 1.0/(2 * hw_inc)) || in ptp_clock_mcux_rate_adjust()
1681 (ratio < 1.0 - 1.0/(2 * hw_inc))) { in ptp_clock_mcux_rate_adjust()
1686 context->clk_ratio = ratio; in ptp_clock_mcux_rate_adjust()
1688 if (ratio < 1.0) { in ptp_clock_mcux_rate_adjust()
1690 val = 1.0 / (hw_inc * (1.0 - ratio)); in ptp_clock_mcux_rate_adjust()
1691 } else if (ratio > 1.0) { in ptp_clock_mcux_rate_adjust()
1693 val = 1.0 / (hw_inc * (ratio - 1.0)); in ptp_clock_mcux_rate_adjust()