mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()

The clock is enabled in the tmio_mmc_host_probe().  It also prevents
drivers from performing platform-specific settings before mmc_add_host()
because the register access generally requires a clock.

Enable/disable the clock in drivers' probe/remove.  Also, I passed
tmio_mmc_data to tmio_mmc_host_alloc() because renesas_sdhi_clk_enable()
needs it to get the private data from tmio_mmc_host.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
此提交包含在:
Masahiro Yamada
2018-01-18 01:28:02 +09:00
提交者 Ulf Hansson
父節點 8d09a13386
當前提交 b21fc29438
共有 4 個檔案被更改,包括 30 行新增27 行删除

查看文件

@@ -92,7 +92,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
host = tmio_mmc_host_alloc(pdev);
host = tmio_mmc_host_alloc(pdev, pdata);
if (IS_ERR(host)) {
ret = PTR_ERR(host);
goto cell_disable;
@@ -101,7 +101,10 @@ static int tmio_mmc_probe(struct platform_device *pdev)
/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
host->bus_shift = resource_size(res) >> 10;
ret = tmio_mmc_host_probe(host, pdata, NULL);
host->mmc->f_max = pdata->hclk;
host->mmc->f_min = pdata->hclk / 512;
ret = tmio_mmc_host_probe(host, NULL);
if (ret)
goto host_free;