提交 86beb538 编写于 作者: W Wolfram Sang 提交者: Ulf Hansson

mmc: tmio: make sure SDIO gets reinitialized after resume

To achieve that, we set the registers in the generic HW reset routine
which gets called at both, init and resume. We also make sure to move
SDIO initialization before reset gets called in probe().
Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: NMasaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 c949c907
...@@ -265,6 +265,12 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host) ...@@ -265,6 +265,12 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001); sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
msleep(10); msleep(10);
if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) {
sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask);
sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
}
} }
static void tmio_mmc_reset_work(struct work_struct *work) static void tmio_mmc_reset_work(struct work_struct *work)
...@@ -1280,6 +1286,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, ...@@ -1280,6 +1286,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
if (_host->native_hotplug) if (_host->native_hotplug)
pm_runtime_get_noresume(&pdev->dev); pm_runtime_get_noresume(&pdev->dev);
_host->sdio_irq_enabled = false;
if (pdata->flags & TMIO_MMC_SDIO_IRQ)
_host->sdio_irq_mask = TMIO_SDIO_MASK_ALL;
tmio_mmc_clk_stop(_host); tmio_mmc_clk_stop(_host);
tmio_mmc_reset(_host); tmio_mmc_reset(_host);
...@@ -1296,13 +1306,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, ...@@ -1296,13 +1306,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
_host->sdcard_irq_mask &= ~irq_mask; _host->sdcard_irq_mask &= ~irq_mask;
_host->sdio_irq_enabled = false;
if (pdata->flags & TMIO_MMC_SDIO_IRQ) {
_host->sdio_irq_mask = TMIO_SDIO_MASK_ALL;
sd_ctrl_write16(_host, CTL_SDIO_IRQ_MASK, _host->sdio_irq_mask);
sd_ctrl_write16(_host, CTL_TRANSACTION_CTL, 0x0001);
}
spin_lock_init(&_host->lock); spin_lock_init(&_host->lock);
mutex_init(&_host->ios_lock); mutex_init(&_host->ios_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册