Merge remote-tracking branches 'regulator/fix/ab3100' and 'regulator/fix/s2mps11...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / mmc / host / tmio_mmc_pio.c
index b94cb16..8d8abf2 100644 (file)
@@ -161,10 +161,8 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 
 static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 {
-       struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
        /* implicit BUG_ON(!res) */
-       if (resource_size(res) > 0x100) {
+       if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
                sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
                msleep(10);
        }
@@ -176,14 +174,12 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 
 static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 {
-       struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
        sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
                sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
        msleep(10);
 
        /* implicit BUG_ON(!res) */
-       if (resource_size(res) > 0x100) {
+       if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
                sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
                msleep(10);
        }
@@ -191,16 +187,14 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 
 static void tmio_mmc_reset(struct tmio_mmc_host *host)
 {
-       struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
        /* FIXME - should we set stop clock reg here */
        sd_ctrl_write16(host, CTL_RESET_SD, 0x0000);
        /* implicit BUG_ON(!res) */
-       if (resource_size(res) > 0x100)
+       if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
                sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
        msleep(10);
        sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
-       if (resource_size(res) > 0x100)
+       if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
                sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
        msleep(10);
 }
@@ -1013,9 +1007,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
        _host->set_pwr = pdata->set_pwr;
        _host->set_clk_div = pdata->set_clk_div;
 
-       /* SD control register space size is 0x200, 0x400 for bus_shift=1 */
-       _host->bus_shift = resource_size(res_ctl) >> 10;
-
        ret = tmio_mmc_init_ocr(_host);
        if (ret < 0)
                goto host_free;