S3C: SDHCI: Modify timeout clock calculation.
Subsystems (4)
PATCH 1/1 S3C: SDHCI: Modify timeout clock calculation.
In sdhci_s3c_set_clock function of S3C SDHCI controller driver, when a new clock source is selected, the timeout clock is recalculated. This patch modifies the calculation of the timeout clock based on the SDHCI_TIMEOUT_CLK_UNIT capability which is determined from the SDHCI_CAPABILITIES register.
Signed-off-by Thomas Abraham <[email protected]>
--- drivers/mmc/host/sdhci-s3c.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/mmc/host/sdhci-s3c.c +5 -1
@@ -181,6 +181,7 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)if (ourhost->cur_clk != best_src) {struct clk *clk = ourhost->clk_bus[best_src]; +unsigned int caps;/* turn clock off to card before changing clock source */ writew (0 , host->ioaddr +SDHCI_CLOCK_CONTROL );
@@ -188,7 +189,10 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock) ourhost->cur_clk = best_src; host->max_clk =clk_get_rate (clk); host->timeout_clk =sdhci_s3c_get_timeout_clk (host); - + caps =readl (host->ioaddr +SDHCI_CAPABILITIES ); +if (caps &SDHCI_TIMEOUT_CLK_UNIT ) + host->timeout_clk *=1000 ; + ctrl =readl (host->ioaddr +S3C_SDHCI_CONTROL2 ); ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK ; ctrl |= best_src <<S3C_SDHCI_CTRL2_SELBASECLK_SHIFT ;
Signature · 1 line
1.6.6.rc2
Hi,
This wasn't picked up -- any comments from the list?
Quoted 37 lines · Thomas Abraham
In
sdhci_s3c_set_clockfunction of S3C SDHCI controller driver, when a new clock source is selected, the timeout clock is recalculated. This patch modifies the calculation of the timeout clock based on theSDHCI_TIMEOUT_CLK_UNITcapability which is determined from theSDHCI_CAPABILITIESregister.Signed-off-by Thomas Abraham <[email protected]>--- drivers/mmc/host/sdhci-s3c.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)drivers/mmc/host/sdhci-s3c.c +5
-1@@ -181,6 +181,7 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)if (ourhost->cur_clk != best_src) {struct clk *clk = ourhost->clk_bus[best_src]; +unsigned int caps;/* turn clock off to card before changing clock source */ writew (0 , host->ioaddr +SDHCI_CLOCK_CONTROL );@@ -188,7 +189,10 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock) ourhost->cur_clk = best_src; host->max_clk =clk_get_rate (clk); host->timeout_clk =sdhci_s3c_get_timeout_clk (host); - + caps =readl (host->ioaddr +SDHCI_CAPABILITIES ); +if (caps &SDHCI_TIMEOUT_CLK_UNIT ) + host->timeout_clk *=1000 ; + ctrl =readl (host->ioaddr +S3C_SDHCI_CONTROL2 ); ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK ; ctrl |= best_src <<S3C_SDHCI_CTRL2_SELBASECLK_SHIFT ;Signature · 1 line
1.6.6.rc2
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child