diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2021-02-16 04:16:54 +0300 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2021-02-19 10:11:08 +0300 |
commit | 9d7e6611a0a66d2f922e526859289c9b7f54646f (patch) | |
tree | 0b6156e83d3364661090d06ba10542f587d02dde /drivers/mmc | |
parent | a96ea4d8d53fe724f7a1536c69a303b708d18014 (diff) | |
download | u-boot-9d7e6611a0a66d2f922e526859289c9b7f54646f.tar.xz |
mmc: rockchip_dw_mmc: use mmc_pwrseq instead of rockchip_mmc_pwrseq
Use mmc_pwrseq instead of rockchip_mmc_pwrseq.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/rockchip_dw_mmc.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 1be3c1741f..d7d5361fd5 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -105,7 +105,6 @@ static int rockchip_dwmmc_probe(struct udevice *dev) struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct rockchip_dwmmc_priv *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; - struct udevice *pwr_dev __maybe_unused; int ret; #if CONFIG_IS_ENABLED(OF_PLATDATA) @@ -136,12 +135,11 @@ static int rockchip_dwmmc_probe(struct udevice *dev) host->fifo_mode = priv->fifo_mode; -#ifdef CONFIG_PWRSEQ +#ifdef CONFIG_MMC_PWRSEQ /* Enable power if needed */ - ret = uclass_get_device_by_phandle(UCLASS_PWRSEQ, dev, "mmc-pwrseq", - &pwr_dev); + ret = mmc_pwrseq_get_power(dev, &plat->cfg); if (!ret) { - ret = pwrseq_set_power(pwr_dev, true); + ret = pwrseq_set_power(plat->cfg.pwr_dev, true); if (ret) return ret; } @@ -182,37 +180,3 @@ U_BOOT_DRIVER(rockchip_rk3288_dw_mshc) = { DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3328_dw_mshc) DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3368_dw_mshc) - -#ifdef CONFIG_PWRSEQ -static int rockchip_dwmmc_pwrseq_set_power(struct udevice *dev, bool enable) -{ - struct gpio_desc reset; - int ret; - - ret = gpio_request_by_name(dev, "reset-gpios", 0, &reset, GPIOD_IS_OUT); - if (ret) - return ret; - dm_gpio_set_value(&reset, 1); - udelay(1); - dm_gpio_set_value(&reset, 0); - udelay(200); - - return 0; -} - -static const struct pwrseq_ops rockchip_dwmmc_pwrseq_ops = { - .set_power = rockchip_dwmmc_pwrseq_set_power, -}; - -static const struct udevice_id rockchip_dwmmc_pwrseq_ids[] = { - { .compatible = "mmc-pwrseq-emmc" }, - { } -}; - -U_BOOT_DRIVER(rockchip_dwmmc_pwrseq_drv) = { - .name = "mmc_pwrseq_emmc", - .id = UCLASS_PWRSEQ, - .of_match = rockchip_dwmmc_pwrseq_ids, - .ops = &rockchip_dwmmc_pwrseq_ops, -}; -#endif |