dm: core: Update lists_bind_fdt() to use ofnode
[oweals/u-boot.git] / drivers / mmc / atmel_sdhci.c
index 6654b542788e6eec57da661311b6c7cc91f15598..c19a1f36b69c97ce7447c1cb06a6e223b066e551 100644 (file)
@@ -28,15 +28,16 @@ int atmel_sdhci_init(void *regbase, u32 id)
 
        host->name = "atmel_sdhci";
        host->ioaddr = regbase;
-       host->quirks = 0;
+       host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD;
        max_clk = at91_get_periph_generated_clk(id);
        if (!max_clk) {
                printf("%s: Failed to get the proper clock\n", __func__);
                free(host);
                return -ENODEV;
        }
+       host->max_clk = max_clk;
 
-       add_sdhci(host, max_clk, min_clk);
+       add_sdhci(host, 0, min_clk);
 
        return 0;
 }
@@ -71,10 +72,10 @@ static int atmel_sdhci_probe(struct udevice *dev)
                return ret;
 
        host->name = dev->name;
-       host->ioaddr = (void *)dev_get_addr(dev);
+       host->ioaddr = (void *)devfdt_get_addr(dev);
 
-       host->quirks = 0;
-       host->bus_width = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
+       host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD;
+       host->bus_width = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
                                         "bus-width", 4);
 
        caps = sdhci_readl(host, SDHCI_CAPABILITIES);
@@ -95,7 +96,9 @@ static int atmel_sdhci_probe(struct udevice *dev)
        if (!max_clk)
                return -EINVAL;
 
-       ret = sdhci_setup_cfg(&plat->cfg, host, max_clk, ATMEL_SDHC_MIN_FREQ);
+       host->max_clk = max_clk;
+
+       ret = sdhci_setup_cfg(&plat->cfg, host, 0, ATMEL_SDHC_MIN_FREQ);
        if (ret)
                return ret;