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

Commit c77e1c54 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

mmc: core: fix the clock scaling handling



Devfreq's simple ondemand governor isn't calling ->target() callback with
frequency value instead it seems to be passing 0 when it wants the client
to scale down to lowest frequency in the frequency table and passes
UINT_MAX when it wants client to scale up to maximum frequency. Fix the
->target() handler to take this into consideration.

Change-Id: I68b1c527afe398ba3ae1ed02f62a85c58f6d4244
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 13ce0881
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -474,6 +474,11 @@ static int mmc_devfreq_set_target(struct device *dev,
	if (!clk_scaling->enable)
		goto out;

	if (*freq == UINT_MAX)
		*freq = clk_scaling->freq_table[1];
	else
		*freq = clk_scaling->freq_table[0];

	pr_debug("%s: target freq = %lu (%s)\n", mmc_hostname(host),
		*freq, current->comm);