diff options
-rw-r--r-- | drivers/mmc/host/meson-gx-mmc.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 08a55c2e96e1..85745ef179e2 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c | |||
@@ -716,6 +716,22 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, | |||
716 | static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) | 716 | static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) |
717 | { | 717 | { |
718 | struct meson_host *host = mmc_priv(mmc); | 718 | struct meson_host *host = mmc_priv(mmc); |
719 | int ret; | ||
720 | |||
721 | /* | ||
722 | * If this is the initial tuning, try to get a sane Rx starting | ||
723 | * phase before doing the actual tuning. | ||
724 | */ | ||
725 | if (!mmc->doing_retune) { | ||
726 | ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); | ||
727 | |||
728 | if (ret) | ||
729 | return ret; | ||
730 | } | ||
731 | |||
732 | ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->tx_clk); | ||
733 | if (ret) | ||
734 | return ret; | ||
719 | 735 | ||
720 | return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); | 736 | return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); |
721 | } | 737 | } |
@@ -746,8 +762,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
746 | if (!IS_ERR(mmc->supply.vmmc)) | 762 | if (!IS_ERR(mmc->supply.vmmc)) |
747 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); | 763 | mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); |
748 | 764 | ||
749 | /* Reset rx phase */ | 765 | /* Reset phases */ |
750 | clk_set_phase(host->rx_clk, 0); | 766 | clk_set_phase(host->rx_clk, 0); |
767 | clk_set_phase(host->tx_clk, 270); | ||
751 | 768 | ||
752 | break; | 769 | break; |
753 | 770 | ||