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

Commit d12dc781 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents b20f6a99 9c866bb6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -258,6 +258,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
@@ -494,6 +494,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;