Skip to content

Commit

Permalink
odroid-c2:"disableuhs" boot option enable.
Browse files Browse the repository at this point in the history
Change-Id: Ife959950fe37765b4b104863350f1bf813832c70
  • Loading branch information
ckkim committed Jan 2, 2017
1 parent 4c2dfe8 commit dcd0aed
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions drivers/amlogic/mmc/amlsd_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,33 @@ static const struct sd_caps host_caps[] = {
SD_CAPS(MMC_PM_KEEP_POWER, "MMC_PM_KEEP_POWER"),
};

#if defined(CONFIG_ARCH_MESON64_ODROIDC2)
int disable_uhs = 0;
static int __init setup_disableuhs(char *s)
{
disable_uhs = 0;
if (!strcmp(s, "true"))
disable_uhs = 1;
return 0;
}
__setup("disableuhs=", setup_disableuhs);

/* Force to set "MMC_CAP_NONREMOVABLE" to prevent MMC card detection
* by MicroSD card socket.
*/
int mmc_removable = 0;
static int __init setup_mmc_removable(char *s)
{
mmc_removable = 0;
if (!strcmp(s, "true"))
mmc_removable = 1;

return 0;
}
__setup("mmc_removable=", setup_mmc_removable);

#endif

static int amlsd_get_host_caps(struct device_node *of_node,
struct amlsd_platform *pdata)
{
Expand All @@ -75,6 +102,19 @@ static int amlsd_get_host_caps(struct device_node *of_node,
if (caps & MMC_CAP_8_BIT_DATA)
caps |= MMC_CAP_4_BIT_DATA;

#if defined(CONFIG_ARCH_MESON64_ODROIDC2)
if (disable_uhs) {
caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
MMC_CAP_UHS_DDR50);
}

if (mmc_removable)
caps &= ~MMC_CAP_NONREMOVABLE;
else
caps |= MMC_CAP_NONREMOVABLE;
#endif

pdata->caps = caps;
pr_info("pdata->caps %x\n", pdata->caps);
return 0;
Expand Down Expand Up @@ -240,8 +280,12 @@ int amlsd_get_platform_data(struct platform_device *pdev,
pdata->xfer_post = of_amlsd_xfer_post;
/* pdata->cd = of_amlsd_detect; */
pdata->irq_init = of_amlsd_irq_init;
pdata->ro = of_amlsd_ro;
pdata->ro = of_amlsd_ro;

#if defined(CONFIG_ARCH_MESON64_ODROIDC2)
if (disable_uhs)
pdata->f_max = 40000000;
#endif
}
return 0;
}

0 comments on commit dcd0aed

Please sign in to comment.