clk: qcom: gcc-sdm845: Use floor ops for sdcc clks
authorStephen Boyd <swboyd@chromium.org>
Fri, 30 Aug 2019 19:51:42 +0000 (12:51 -0700)
committerStephen Boyd <sboyd@kernel.org>
Mon, 9 Sep 2019 11:38:20 +0000 (04:38 -0700)
commit5e4b7e82d497580bc430576c4c9bce157dd72512
tree60a13e75207dc2b01de9ea10469dbafb9a078358
parent75e0a1e301913b2b5627a69818f2521f48e6be07
clk: qcom: gcc-sdm845: Use floor ops for sdcc clks

Some MMC cards fail to enumerate properly when inserted into an MMC slot
on sdm845 devices. This is because the clk ops for qcom clks round the
frequency up to the nearest rate instead of down to the nearest rate.
For example, the MMC driver requests a frequency of 52MHz from
clk_set_rate() but the qcom implementation for these clks rounds 52MHz
up to the next supported frequency of 100MHz. The MMC driver could be
modified to request clk rate ranges but for now we can fix this in the
clk driver by changing the rounding policy for this clk to be round down
instead of round up.

Fixes: 06391eddb60a ("clk: qcom: Add Global Clock controller (GCC) driver for SDM845")
Reported-by: Douglas Anderson <dianders@chromium.org>
Cc: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lkml.kernel.org/r/20190830195142.103564-1-swboyd@chromium.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/gcc-sdm845.c