* [PATCH] mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch
@ 2020-05-22 16:28 ` Marek Vasut
2020-05-27 6:19 ` Jaehoon Chung
0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2020-05-22 16:28 UTC (permalink / raw)
To: u-boot
Unsupported voltage on voltage switch is not an error, do not
print error message in such a case. This happens e.g. if the
eMMC is already in 1V8 mode or when testing 1V2 mode operation
on systems which only do 3V3/1V8 switching.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
drivers/mmc/fsl_esdhc_imx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index f3101a061a..f42e018434 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -791,7 +791,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
switch (mmc->signal_voltage) {
case MMC_SIGNAL_VOLTAGE_330:
if (priv->vs18_enable)
- return -EIO;
+ return -ENOTSUPP;
#if CONFIG_IS_ENABLED(DM_REGULATOR)
if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
ret = regulator_set_value(priv->vqmmc_dev, 3300000);
@@ -972,7 +972,8 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
if (priv->signal_voltage != mmc->signal_voltage) {
ret = esdhc_set_voltage(mmc);
if (ret) {
- printf("esdhc_set_voltage error %d\n", ret);
+ if (ret != -ENOTSUPP)
+ printf("esdhc_set_voltage error %d\n", ret);
return ret;
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch
2020-05-22 16:28 ` [PATCH] mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch Marek Vasut
@ 2020-05-27 6:19 ` Jaehoon Chung
0 siblings, 0 replies; 2+ messages in thread
From: Jaehoon Chung @ 2020-05-27 6:19 UTC (permalink / raw)
To: u-boot
On 5/23/20 1:28 AM, Marek Vasut wrote:
> Unsupported voltage on voltage switch is not an error, do not
> print error message in such a case. This happens e.g. if the
> eMMC is already in 1V8 mode or when testing 1V2 mode operation
> on systems which only do 3V3/1V8 switching.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/mmc/fsl_esdhc_imx.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
> index f3101a061a..f42e018434 100644
> --- a/drivers/mmc/fsl_esdhc_imx.c
> +++ b/drivers/mmc/fsl_esdhc_imx.c
> @@ -791,7 +791,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
> switch (mmc->signal_voltage) {
> case MMC_SIGNAL_VOLTAGE_330:
> if (priv->vs18_enable)
> - return -EIO;
> + return -ENOTSUPP;
> #if CONFIG_IS_ENABLED(DM_REGULATOR)
> if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
> ret = regulator_set_value(priv->vqmmc_dev, 3300000);
> @@ -972,7 +972,8 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
> if (priv->signal_voltage != mmc->signal_voltage) {
> ret = esdhc_set_voltage(mmc);
> if (ret) {
> - printf("esdhc_set_voltage error %d\n", ret);
> + if (ret != -ENOTSUPP)
> + printf("esdhc_set_voltage error %d\n", ret);
> return ret;
> }
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-27 6:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20200522162843epcas1p29714450fb34259b967e4a43c214aa9cd@epcas1p2.samsung.com>
2020-05-22 16:28 ` [PATCH] mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch Marek Vasut
2020-05-27 6:19 ` Jaehoon Chung
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.