]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: 7718/1: mmc: mmci: Set actual clock for debug purpose
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 May 2013 14:40:03 +0000 (15:40 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 15 May 2013 18:27:05 +0000 (19:27 +0100)
Update cclk to the acutal used value and copy it to the actual_clock
variable in the mmc host for debug purpose.

Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/mmc/host/mmci.c

index ab9130ba05b4a2d0e1811586936ac1dd56f49333..cba643fc3103387b1b9188a0124417821417b7e3 100644 (file)
@@ -196,6 +196,9 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
        struct variant_data *variant = host->variant;
        u32 clk = variant->clkreg;
 
+       /* Make sure cclk reflects the current calculated clock */
+       host->cclk = 0;
+
        if (desired) {
                if (desired >= host->mclk) {
                        clk = MCI_CLK_BYPASS;
@@ -230,6 +233,9 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
                /* clk |= MCI_CLK_PWRSAVE; */
        }
 
+       /* Set actual clock for debug */
+       host->mmc->actual_clock = host->cclk;
+
        if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
                clk |= MCI_4BIT_BUS;
        if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)