mmc: tmio: disable clock before changing it
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 19 Jan 2016 11:32:58 +0000 (12:32 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:03:06 +0000 (11:03 +0100)
Rcar2 & 3 docs state that for going to and coming from the 0xff setting,
the clock must first be disabled before the DIV bits are changed.
Instead of tracking this, let's just do this unconditionally.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_pio.c

index 7f6b5adf12094b9762a2889b33196775d567c368..03f6e74c190691c74e4845bdd94401710baaed5c 100644 (file)
@@ -174,6 +174,8 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host,
        if (host->set_clk_div)
                host->set_clk_div(host->pdev, (clk >> 22) & 1);
 
+       sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN &
+                       sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
        sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & CLK_CTL_DIV_MASK);
        if (!(host->pdata->flags & TMIO_MMC_FAST_CLK_CHG))
                msleep(10);