aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/tifm_sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/tifm_sd.c')
-rw-r--r--drivers/mmc/tifm_sd.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c
index 69b78eb16eff..5817a138a1e4 100644
--- a/drivers/mmc/tifm_sd.c
+++ b/drivers/mmc/tifm_sd.c
@@ -442,22 +442,21 @@ static void tifm_sd_set_data_timeout(struct tifm_sd *host,
442 return; 442 return;
443 443
444 data_timeout += data->timeout_ns / 444 data_timeout += data->timeout_ns /
445 ((1000000000 / host->clk_freq) * host->clk_div); 445 ((1000000000UL / host->clk_freq) * host->clk_div);
446 data_timeout *= 10; // call it fudge factor for now
447 446
448 if (data_timeout < 0xffff) { 447 if (data_timeout < 0xffff) {
449 writel((~TIFM_MMCSD_DPE) &
450 readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG),
451 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG);
452 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO); 448 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO);
449 writel((~TIFM_MMCSD_DPE)
450 & readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG),
451 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG);
453 } else { 452 } else {
454 writel(TIFM_MMCSD_DPE |
455 readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG),
456 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG);
457 data_timeout = (data_timeout >> 10) + 1; 453 data_timeout = (data_timeout >> 10) + 1;
458 if(data_timeout > 0xffff) 454 if(data_timeout > 0xffff)
459 data_timeout = 0; /* set to unlimited */ 455 data_timeout = 0; /* set to unlimited */
460 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO); 456 writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO);
457 writel(TIFM_MMCSD_DPE
458 | readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG),
459 sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG);
461 } 460 }
462} 461}
463 462