X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmmc%2Fpic32_sdhci.c;h=212e22ee0215c6ff617ede8a024f78ebcf1e1fc1;hb=9f881a590fc6a22be26502cf893626feb31ad1fc;hp=fd2f5e3d5a85ef4ce5d44d0861129c02d8733bb3;hpb=6f88a3a5d9488bc0aed5a62ca5f2a3cda4deded9;p=oweals%2Fu-boot.git diff --git a/drivers/mmc/pic32_sdhci.c b/drivers/mmc/pic32_sdhci.c index fd2f5e3d5a..212e22ee02 100644 --- a/drivers/mmc/pic32_sdhci.c +++ b/drivers/mmc/pic32_sdhci.c @@ -7,15 +7,15 @@ * SPDX-License-Identifier: GPL-2.0+ */ -#include #include +#include #include #include #include DECLARE_GLOBAL_DATA_PTR; -static int pci32_sdhci_get_cd(struct sdhci_host *host) +static int pic32_sdhci_get_cd(struct sdhci_host *host) { /* PIC32 SDHCI CD errata: * - set CD_TEST and clear CD_TEST_INS bit @@ -26,7 +26,7 @@ static int pci32_sdhci_get_cd(struct sdhci_host *host) } static const struct sdhci_ops pic32_sdhci_ops = { - .get_cd = pci32_sdhci_get_cd, + .get_cd = pic32_sdhci_get_cd, }; static int pic32_sdhci_probe(struct udevice *dev) @@ -38,25 +38,27 @@ static int pic32_sdhci_probe(struct udevice *dev) fdt_size_t size; int ret; - addr = fdtdec_get_addr_size(fdt, dev->of_offset, "reg", &size); + addr = fdtdec_get_addr_size(fdt, dev_of_offset(dev), "reg", &size); if (addr == FDT_ADDR_T_NONE) return -EINVAL; host->ioaddr = ioremap(addr, size); host->name = dev->name; host->quirks = SDHCI_QUIRK_NO_HISPD_BIT; - host->bus_width = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + host->bus_width = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width", 4); host->ops = &pic32_sdhci_ops; - ret = fdtdec_get_int_array(gd->fdt_blob, dev->of_offset, + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev), "clock-freq-min-max", f_min_max, 2); if (ret) { printf("sdhci: clock-freq-min-max not found\n"); return ret; } - ret = add_sdhci(host, f_min_max[1], f_min_max[0]); + host->max_clk = f_min_max[1]; + + ret = add_sdhci(host, 0, f_min_max[0]); if (ret) return ret; host->mmc->dev = dev;