diff options
Diffstat (limited to 'recipes/linux/linux-gumstix-2.6.15/rmk_pxa_mmc_timeout.patch')
-rw-r--r-- | recipes/linux/linux-gumstix-2.6.15/rmk_pxa_mmc_timeout.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/recipes/linux/linux-gumstix-2.6.15/rmk_pxa_mmc_timeout.patch b/recipes/linux/linux-gumstix-2.6.15/rmk_pxa_mmc_timeout.patch new file mode 100644 index 0000000000..d7d5fda08c --- /dev/null +++ b/recipes/linux/linux-gumstix-2.6.15/rmk_pxa_mmc_timeout.patch @@ -0,0 +1,34 @@ +diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c +--- a/drivers/mmc/pxamci.c ++++ b/drivers/mmc/pxamci.c +@@ -71,11 +71,6 @@ struct pxamci_host { + unsigned int dma_dir; + }; + +-static inline unsigned int ns_to_clocks(unsigned int ns) +-{ +- return (ns * (CLOCKRATE / 1000000) + 999) / 1000; +-} +- + static void pxamci_stop_clock(struct pxamci_host *host) + { + if (readl(host->base + MMC_STAT) & STAT_CLK_EN) { +@@ -119,6 +114,7 @@ static void pxamci_disable_irq(struct px + static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) + { + unsigned int nob = data->blocks; ++ unsigned long long clks; + unsigned int timeout; + u32 dcmd; + int i; +@@ -131,7 +127,9 @@ static void pxamci_setup_data(struct pxa + writel(nob, host->base + MMC_NOB); + writel(1 << data->blksz_bits, host->base + MMC_BLKLEN); + +- timeout = ns_to_clocks(data->timeout_ns) + data->timeout_clks; ++ clks = (unsigned long long)data->timeout_ns * CLOCKRATE; ++ do_div(clks, 1000000000UL); ++ timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt); + writel((timeout + 255) / 256, host->base + MMC_RDTO); + + if (data->flags & MMC_DATA_READ) { |