summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 722a1c4)
raw | patch | inline | side by side (parent: 722a1c4)
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | |
Wed, 15 Feb 2017 14:17:13 +0000 (15:17 +0100) | ||
committer | Jean-Jacques Hiblot <jjhiblot@ti.com> | |
Fri, 17 Feb 2017 14:28:58 +0000 (15:28 +0100) |
commit 3e0e1a652d19d6246e67685951241b497296b971 branch ti-u-boot-2017.01
We need to manage the regulators for proper MMC operations even when DM_MMC
and/or DM_REGULATOR are not used.
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
We need to manage the regulators for proper MMC operations even when DM_MMC
and/or DM_REGULATOR are not used.
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
drivers/mmc/omap_hsmmc.c | patch | blob | history |
index 4231e31af54299834b2eb25f761e6eeea160b1a9..01e9d236a41a643928bd97212769bb5889802f76 100644 (file)
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
struct udevice *vmmc_supply;
struct udevice *vmmc_aux_supply;
ushort last_cmd;
- uint signal_voltage;
#ifdef CONFIG_IODELAY_RECALIBRATION
struct omap_hsmmc_pinctrl_state *default_pinctrl_state;
struct omap_hsmmc_pinctrl_state *hs_pinctrl_state;
struct omap_hsmmc_pinctrl_state *sdr12_pinctrl_state;
#endif
#endif
+ uint signal_voltage;
};
#ifdef CONFIG_DM_MMC
priv->timing = mmc->timing;
}
#endif
+#endif
static void omap_hsmmc_conf_bus_power(struct mmc *mmc, uint signal_voltage)
{
writel(val, &mmc_base->hctl);
}
+#if defined(CONFIG_DM_MMC)
static int omap_hsmmc_card_busy_low(struct mmc *mmc)
{
u32 val;
return ret;
}
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR) && defined(CONFIG_DM_MMC)
static int omap_hsmmc_set_io_regulator(struct mmc *mmc, int uV)
{
int ret;
return 0;
}
#endif
+#endif
static int omap_hsmmc_set_signal_voltage(struct mmc *mmc)
{
writel(val, &mmc_base->ac12);
#if defined(CONFIG_OMAP54XX) && defined(CONFIG_PALMAS_POWER)
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR) && defined(CONFIG_DM_MMC)
return omap_hsmmc_set_io_regulator(mmc, 3000000);
#else
vmmc_pbias_config(LDO_VOLT_3V0);
writel(val, &mmc_base->ac12);
#if defined(CONFIG_OMAP54XX) && defined(CONFIG_PALMAS_POWER)
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR) && defined(CONFIG_DM_MMC)
return omap_hsmmc_set_io_regulator(mmc, 1800000);
#else
vmmc_pbias_config(LDO_VOLT_1V8);
return 0;
}
+#if defined(CONFIG_DM_MMC)
static void omap_hsmmc_set_capabilities(struct mmc *mmc)
{
struct hsmmc *mmc_base;
return ret;
}
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR) && defined(CONFIG_DM_MMC)
static int omap_hsmmc_set_vdd(struct mmc *mmc, int enable)
{
struct omap_hsmmc_data *priv = (struct omap_hsmmc_data *)mmc->priv;
else
omap_hsmmc_start_clock(mmc_base);
-#ifdef CONFIG_DM_MMC
-#ifdef CONFIG_IODELAY_RECALIBRATION
+#if defined(CONFIG_DM_MMC) && defined(CONFIG_IODELAY_RECALIBRATION)
if (priv_data->timing != mmc->timing)
omap_hsmmc_set_timing(mmc);
#endif
if (priv_data->signal_voltage != mmc->signal_voltage)
ret = omap_hsmmc_set_signal_voltage(mmc);
-#endif
return ret;
}
#ifdef CONFIG_DM_MMC
.execute_tuning = omap_hsmmc_execute_tuning,
.card_busy = omap_hsmmc_card_busy,
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR) && defined(CONFIG_DM_MMC)
.set_vdd = omap_hsmmc_set_vdd,
#endif
#endif
omap_hsmmc_platform_fixup(mmc);
-#ifdef CONFIG_DM_REGULATOR
+#if CONFIG_IS_ENABLED(DM_REGULATOR) && defined(CONFIG_DM_MMC)
device_get_supply_regulator(dev, "vmmc-supply", &priv->vmmc_supply);
device_get_supply_regulator(dev, "vmmc_aux-supply",
&priv->vmmc_aux_supply);