]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mmc: tmio: Use MMC core APIs to control the vqmmc regulator
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Wed, 24 Jul 2024 18:21:18 +0000 (19:21 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 26 Aug 2024 11:01:49 +0000 (13:01 +0200)
Use the mmc_regulator_enable_vqmmc() and mmc_regulator_disable_vqmmc() APIs
to enable/disable the vqmmc regulator.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240724182119.652080-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_core.c

index b359876cc33d7023a3033f6f8f79c1caba54146b..45a474ccab1c9802a67be15d065410c6465f3678 100644 (file)
@@ -895,8 +895,8 @@ static void tmio_mmc_power_on(struct tmio_mmc_host *host, unsigned short vdd)
         * It seems, VccQ should be switched on after Vcc, this is also what the
         * omap_hsmmc.c driver does.
         */
-       if (!IS_ERR(mmc->supply.vqmmc) && !ret) {
-               ret = regulator_enable(mmc->supply.vqmmc);
+       if (!ret) {
+               ret = mmc_regulator_enable_vqmmc(mmc);
                usleep_range(200, 300);
        }
 
@@ -909,8 +909,7 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
 {
        struct mmc_host *mmc = host->mmc;
 
-       if (!IS_ERR(mmc->supply.vqmmc))
-               regulator_disable(mmc->supply.vqmmc);
+       mmc_regulator_disable_vqmmc(mmc);
 
        if (!IS_ERR(mmc->supply.vmmc))
                mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);