Commit 5e4b7e82 authored by Stephen Boyd's avatar Stephen Boyd Committed by Stephen Boyd

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: 06391edd ("clk: qcom: Add Global Clock controller (GCC) driver for SDM845")
Reported-by: default avatarDouglas Anderson <dianders@chromium.org>
Cc: Taniya Das <tdas@codeaurora.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lkml.kernel.org/r/20190830195142.103564-1-swboyd@chromium.orgReviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 75e0a1e3
...@@ -685,7 +685,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { ...@@ -685,7 +685,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
.name = "gcc_sdcc2_apps_clk_src", .name = "gcc_sdcc2_apps_clk_src",
.parent_names = gcc_parent_names_10, .parent_names = gcc_parent_names_10,
.num_parents = 5, .num_parents = 5,
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_floor_ops,
}, },
}; };
...@@ -709,7 +709,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = { ...@@ -709,7 +709,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
.name = "gcc_sdcc4_apps_clk_src", .name = "gcc_sdcc4_apps_clk_src",
.parent_names = gcc_parent_names_0, .parent_names = gcc_parent_names_0,
.num_parents = 4, .num_parents = 4,
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_floor_ops,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment