X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmmc%2Ftegra_mmc.c;h=22990fa98b78d1314fa6c654dde5dd8643774481;hb=95ead3d98de4e2ccdd5b36efb9ca3d2a97835d7e;hp=338e42b52833f6fb7e4e8e8e60de9a9cbd3e4e16;hpb=541f538f4ca50082f77f7f34f05950d57804b1cc;p=oweals%2Fu-boot.git diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c index 338e42b528..22990fa98b 100644 --- a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@ -1,22 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 SAMSUNG Electronics * Minkyu Kang * Jaehoon Chung * Portions Copyright 2011-2016 NVIDIA Corporation - * - * SPDX-License-Identifier: GPL-2.0+ */ #include #include #include #include +#include #include #include #include -#include - -DECLARE_GLOBAL_DATA_PTR; struct tegra_mmc_plat { struct mmc_config cfg; @@ -438,7 +435,7 @@ static int tegra_mmc_set_ios(struct udevice *dev) else if (mmc->bus_width == 4) ctrl |= (1 << 1); else - ctrl &= ~(1 << 1); + ctrl &= ~(1 << 1 | 1 << 5); writeb(ctrl, &priv->reg->hostctl); debug("mmc_set_ios: hostctl = %08X\n", ctrl); @@ -599,8 +596,7 @@ static int tegra_mmc_probe(struct udevice *dev) cfg->name = dev->name; - bus_width = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), - "bus-width", 1); + bus_width = dev_read_u32_default(dev, "bus-width", 1); cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; cfg->host_caps = 0; @@ -621,7 +617,7 @@ static int tegra_mmc_probe(struct udevice *dev) cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; - priv->reg = (void *)devfdt_get_addr(dev); + priv->reg = (void *)dev_read_addr(dev); ret = reset_get_by_name(dev, "sdhci", &priv->reset_ctl); if (ret) { @@ -648,12 +644,10 @@ static int tegra_mmc_probe(struct udevice *dev) return ret; /* These GPIOs are optional */ - gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, - GPIOD_IS_IN); - gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, - GPIOD_IS_IN); - gpio_request_by_name(dev, "power-gpios", 0, - &priv->pwr_gpio, GPIOD_IS_OUT); + gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN); + gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN); + gpio_request_by_name(dev, "power-gpios", 0, &priv->pwr_gpio, + GPIOD_IS_OUT); if (dm_gpio_is_valid(&priv->pwr_gpio)) dm_gpio_set_value(&priv->pwr_gpio, 1);