diff --git a/drivers/amlogic/mmc/aml_sd_emmc.c b/drivers/amlogic/mmc/aml_sd_emmc.c index a654779542ee..71a5a47a80e1 100644 --- a/drivers/amlogic/mmc/aml_sd_emmc.c +++ b/drivers/amlogic/mmc/aml_sd_emmc.c @@ -3187,9 +3187,6 @@ static int meson_mmc_probe(struct platform_device *pdev) if (pdata->caps & MMC_CAP_NONREMOVABLE) pdata->is_in = 1; - if (pdata->caps & MMC_PM_KEEP_POWER) - mmc->pm_caps |= MMC_PM_KEEP_POWER; - /* data desc buffer */ #ifdef CFG_SDEMMC_PIO pr_err(">>>>>>>>hostbase %p, dmode %s\n", @@ -3250,6 +3247,7 @@ static int meson_mmc_probe(struct platform_device *pdev) mmc->ocr_avail = pdata->ocr_avail; mmc->caps = pdata->caps; mmc->caps2 = pdata->caps2; + mmc->pm_caps = pdata->pm_caps; mmc->f_min = pdata->f_min; mmc->f_max = pdata->f_max; mmc->max_current_180 = 300; /* 300 mA in 1.8V */ diff --git a/drivers/amlogic/mmc/amlsd_of.c b/drivers/amlogic/mmc/amlsd_of.c index 0f943790cf40..fc093edddbb5 100644 --- a/drivers/amlogic/mmc/amlsd_of.c +++ b/drivers/amlogic/mmc/amlsd_of.c @@ -113,11 +113,29 @@ static int amlsd_get_host_caps2(struct device_node *of_node, caps |= host_caps2[i].caps; } }; + pdata->caps2 = caps; pr_debug("%s:pdata->caps2 = %x\n", pdata->pinname, pdata->caps2); return 0; } +static int amlsd_get_host_pm_caps(struct device_node *of_node, + struct amlsd_platform *pdata) +{ + const char *str_caps; + struct property *prop; + u32 caps = 0; + + of_property_for_each_string(of_node, "caps", prop, str_caps) { + if (!strcasecmp("MMC_PM_KEEP_POWER", str_caps)) + caps |= MMC_PM_KEEP_POWER; + }; + + pdata->pm_caps = caps; + pr_debug("%s:pdata->pm_caps = %x\n", pdata->pinname, pdata->pm_caps); + return 0; +} + int amlsd_get_platform_data(struct platform_device *pdev, struct amlsd_platform *pdata, struct mmc_host *mmc, u32 index) @@ -211,6 +229,7 @@ int amlsd_get_platform_data(struct platform_device *pdev, amlsd_get_host_caps(child, pdata); amlsd_get_host_caps2(child, pdata); + amlsd_get_host_pm_caps(child, pdata); pdata->port_init = of_amlsd_init; #ifdef CARD_DETECT_IRQ pdata->irq_init = of_amlsd_irq_init; diff --git a/include/linux/amlogic/sd.h b/include/linux/amlogic/sd.h index 0d4e24ddb05f..9fa73a8a99bf 100644 --- a/include/linux/amlogic/sd.h +++ b/include/linux/amlogic/sd.h @@ -264,6 +264,7 @@ struct amlsd_platform { struct delayed_work cd_detect; unsigned int caps; unsigned int caps2; + unsigned int pm_caps; unsigned int card_capacity; unsigned int tx_phase; unsigned int tx_delay;