提交 b8f9f0e9 编写于 作者: J Juha Yrjola 提交者: Pierre Ossman

MMC: OMAP: Fix timeout calculation for MMC multislot support

Fix the data timeout calculation for MMC multislot support.
Signed-off-by: NJuha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: NJarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: NCarlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
上级 a914ded2
......@@ -861,13 +861,12 @@ static inline void set_cmd_timeout(struct mmc_omap_host *host, struct mmc_reques
static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req)
{
int timeout;
unsigned int timeout, cycle_ns;
u16 reg;
/* Convert ns to clock cycles by assuming 20MHz frequency
* 1 cycle at 20MHz = 500 ns
*/
timeout = req->data->timeout_clks + req->data->timeout_ns / 500;
cycle_ns = 1000000000 / host->current_slot->fclk_freq;
timeout = req->data->timeout_ns / cycle_ns;
timeout += req->data->timeout_clks;
/* Check if we need to use timeout multiplier register */
reg = OMAP_MMC_READ(host, SDIO);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册