Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddd38efd authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: qcom: Add support to round the frequency to kHz"

parents 8c8a8279 d8c8c422
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -257,6 +257,9 @@ static bool _is_best_div(unsigned long rate, unsigned long now,
{
	if (flags & CLK_DIVIDER_ROUND_CLOSEST)
		return abs(rate - now) < abs(rate - best);
	else if (flags & CLK_DIVIDER_ROUND_KHZ)
		return (DIV_ROUND_CLOSEST(abs(rate - now), 1000)
			< DIV_ROUND_CLOSEST(abs(rate - best), 1000));

	return now <= rate && now > best;
}
+1 −0
Original line number Diff line number Diff line
@@ -495,6 +495,7 @@ struct clk_divider {
#define CLK_DIVIDER_ROUND_CLOSEST	BIT(4)
#define CLK_DIVIDER_READ_ONLY		BIT(5)
#define CLK_DIVIDER_MAX_AT_ZERO		BIT(6)
#define CLK_DIVIDER_ROUND_KHZ	BIT(7)

extern const struct clk_ops clk_divider_ops;
extern const struct clk_ops clk_divider_ro_ops;