sdio: optimize 1bit mode cfg [1/1]

PD#SWPL-3719

Problem:
optimize sdio 1bit cfg fail for dts.

Solution:
move MMC_PM_KEEP_POWER setting from
amlsd_get_host_caps(). so modify dts to
set 1bit mode.

Verify:
p212

Change-Id: I268f25a9550058e7bbf3562eec53c8cd92b58b1b
Signed-off-by: Nan Li <nan.li@amlogic.com>
This commit is contained in:
Nan Li
2018-12-28 18:07:27 +08:00
committed by Dongjin Kim
parent 6c5a7c4c5f
commit 890db4524d
3 changed files with 21 additions and 3 deletions

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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;