mmc: sdhci-esdhc-imx: set actual_clock in clock setting
authorDong Aisheng <b29396@freescale.com>
Fri, 13 Sep 2013 11:11:37 +0000 (19:11 +0800)
committerChris Ball <cjb@laptop.org>
Fri, 27 Sep 2013 14:31:48 +0000 (10:31 -0400)
This enables access the actual_clock via sys.
root@imx6qsabreauto:~# cat /sys/kernel/debug/mmc0/ios
clock:          198000000 Hz
actual clock:   198000000 Hz
vdd:            17 (2.9 ~ 3.0 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    6 (sd uhs SDR104)
signal voltage: 0 (1.80 V)

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-of-esdhc.c

index fe48ec3323afad729a57ae77f92d8f6dafe6e70e..b9899e9c684a2c6e2a1c3122382646f67314bdf0 100644 (file)
@@ -524,8 +524,9 @@ static inline void esdhc_pltfm_set_clock(struct sdhci_host *host,
        while (host_clock / pre_div / div > clock && div < 16)
                div++;
 
+       host->mmc->actual_clock = host_clock / pre_div / div;
        dev_dbg(mmc_dev(host->mmc), "desired SD clock: %d, actual: %d\n",
-               clock, host_clock / pre_div / div);
+               clock, host->mmc->actual_clock);
 
        pre_div >>= 1;
        div--;
index b1605a1747c435147d8795ec617ef67b5f33e5c6..0b249970b1197fcc92af6e63184c72cf7c406286 100644 (file)
@@ -227,7 +227,7 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
                div++;
 
        dev_dbg(mmc_dev(host->mmc), "desired SD clock: %d, actual: %d\n",
-               clock, host_clock / pre_div / div);
+               clock, host->max_clk / pre_div / div);
 
        pre_div >>= 1;
        div--;