Skip to content

Commit 739f04f

Browse files
shawn1221storulf
authored andcommitted
mmc: dw_mmc-rockchip: Fix wrong internal phase calculate
ciu clock is 2 times of io clock, but the sample clk used is derived from io clock provided to the card. So we should use io clock to calculate the phase. Fixes: 5990344 ("mmc: dw_mmc-rockchip: Add internal phase support") Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 9e80562 commit 739f04f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mmc/host/dw_mmc-rockchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct dw_mci_rockchip_priv_data {
4242
*/
4343
static int rockchip_mmc_get_internal_phase(struct dw_mci *host, bool sample)
4444
{
45-
unsigned long rate = clk_get_rate(host->ciu_clk);
45+
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
4646
u32 raw_value;
4747
u16 degrees;
4848
u32 delay_num = 0;
@@ -85,7 +85,7 @@ static int rockchip_mmc_get_phase(struct dw_mci *host, bool sample)
8585

8686
static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees)
8787
{
88-
unsigned long rate = clk_get_rate(host->ciu_clk);
88+
unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
8989
u8 nineties, remainder;
9090
u8 delay_num;
9191
u32 raw_value;

0 commit comments

Comments
 (0)