All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
@ 2016-03-03 10:19 ` Nicolas Boichat
  0 siblings, 0 replies; 16+ messages in thread
From: Nicolas Boichat @ 2016-03-03 10:19 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Matthias Brugger, Chaotian Jing, Nicolas Boichat,
	Geert Uytterhoeven, linux-mmc, linux-arm-kernel, linux-mediatek,
	linux-kernel, dianders

In commit ceae98f20e36 ("mmc: core: Try other signal levels
during power up") we can see that there are times when it's
valid to try several signal voltages.  Don't print an ugly
error in the logs when that happens.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---

Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
mmc: dw_mmc: Change signal voltage error to dev_dbg()

 drivers/mmc/host/mtk-sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index f01972e..07809f4 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1038,7 +1038,7 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 		if (ret) {
-			dev_err(host->dev,
+			dev_dbg(host->dev,
 					"Regulator set error %d: %d - %d\n",
 					ret, min_uv, max_uv);
 		} else {
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
@ 2016-03-03 10:19 ` Nicolas Boichat
  0 siblings, 0 replies; 16+ messages in thread
From: Nicolas Boichat @ 2016-03-03 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

In commit ceae98f20e36 ("mmc: core: Try other signal levels
during power up") we can see that there are times when it's
valid to try several signal voltages.  Don't print an ugly
error in the logs when that happens.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---

Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
mmc: dw_mmc: Change signal voltage error to dev_dbg()

 drivers/mmc/host/mtk-sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index f01972e..07809f4 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1038,7 +1038,7 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 		if (ret) {
-			dev_err(host->dev,
+			dev_dbg(host->dev,
 					"Regulator set error %d: %d - %d\n",
 					ret, min_uv, max_uv);
 		} else {
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
  2016-03-03 10:19 ` Nicolas Boichat
@ 2016-03-03 10:19   ` Nicolas Boichat
  -1 siblings, 0 replies; 16+ messages in thread
From: Nicolas Boichat @ 2016-03-03 10:19 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Matthias Brugger, Chaotian Jing, Nicolas Boichat,
	Geert Uytterhoeven, linux-mmc, linux-arm-kernel, linux-mediatek,
	linux-kernel, dianders

We've introduced a new helper in the MMC core:
mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
helper has some advantages:

    1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
       VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
       compatibility.

    2. We get rid of a few more warnings when probing unsupported
       voltages.

    3. We get rid of some non-mediatek specific code in mtk-sd.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---

Similar to e0848f5d294c703917260a6228cc08b8be46c527
mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
where I copied the commit message from.

 drivers/mmc/host/mtk-sd.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 07809f4..b17f30d 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1021,26 +1021,19 @@ static void msdc_set_buswidth(struct msdc_host *host, u32 width)
 static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
 {
 	struct msdc_host *host = mmc_priv(mmc);
-	int min_uv, max_uv;
 	int ret = 0;
 
 	if (!IS_ERR(mmc->supply.vqmmc)) {
-		if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
-			min_uv = 3300000;
-			max_uv = 3300000;
-		} else if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
-			min_uv = 1800000;
-			max_uv = 1800000;
-		} else {
+		if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 &&
+		    ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
 			dev_err(host->dev, "Unsupported signal voltage!\n");
 			return -EINVAL;
 		}
 
-		ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
+		ret = mmc_regulator_set_vqmmc(mmc, ios);
 		if (ret) {
-			dev_dbg(host->dev,
-					"Regulator set error %d: %d - %d\n",
-					ret, min_uv, max_uv);
+			dev_dbg(host->dev, "Regulator set error %d (%d)\n",
+				ret, ios->signal_voltage);
 		} else {
 			/* Apply different pinctrl settings for different signal voltage */
 			if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
@ 2016-03-03 10:19   ` Nicolas Boichat
  0 siblings, 0 replies; 16+ messages in thread
From: Nicolas Boichat @ 2016-03-03 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

We've introduced a new helper in the MMC core:
mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
helper has some advantages:

    1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
       VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
       compatibility.

    2. We get rid of a few more warnings when probing unsupported
       voltages.

    3. We get rid of some non-mediatek specific code in mtk-sd.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---

Similar to e0848f5d294c703917260a6228cc08b8be46c527
mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
where I copied the commit message from.

 drivers/mmc/host/mtk-sd.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 07809f4..b17f30d 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1021,26 +1021,19 @@ static void msdc_set_buswidth(struct msdc_host *host, u32 width)
 static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
 {
 	struct msdc_host *host = mmc_priv(mmc);
-	int min_uv, max_uv;
 	int ret = 0;
 
 	if (!IS_ERR(mmc->supply.vqmmc)) {
-		if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
-			min_uv = 3300000;
-			max_uv = 3300000;
-		} else if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
-			min_uv = 1800000;
-			max_uv = 1800000;
-		} else {
+		if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 &&
+		    ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
 			dev_err(host->dev, "Unsupported signal voltage!\n");
 			return -EINVAL;
 		}
 
-		ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
+		ret = mmc_regulator_set_vqmmc(mmc, ios);
 		if (ret) {
-			dev_dbg(host->dev,
-					"Regulator set error %d: %d - %d\n",
-					ret, min_uv, max_uv);
+			dev_dbg(host->dev, "Regulator set error %d (%d)\n",
+				ret, ios->signal_voltage);
 		} else {
 			/* Apply different pinctrl settings for different signal voltage */
 			if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
  2016-03-03 10:19   ` Nicolas Boichat
  (?)
@ 2016-03-03 17:57     ` Doug Anderson
  -1 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2016-03-03 17:57 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Ulf Hansson, Matthias Brugger, Chaotian Jing, Geert Uytterhoeven,
	linux-mmc, linux-arm-kernel,
	moderated list:ARM/Mediatek SoC support, linux-kernel

Nicolas,

On Thu, Mar 3, 2016 at 2:19 AM, Nicolas Boichat <drinkcat@chromium.org> wrote:
> We've introduced a new helper in the MMC core:
> mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
> helper has some advantages:
>
>     1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
>        VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
>        compatibility.
>
>     2. We get rid of a few more warnings when probing unsupported
>        voltages.
>
>     3. We get rid of some non-mediatek specific code in mtk-sd.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
>
> Similar to e0848f5d294c703917260a6228cc08b8be46c527
> mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
> where I copied the commit message from.
>
>  drivers/mmc/host/mtk-sd.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
@ 2016-03-03 17:57     ` Doug Anderson
  0 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2016-03-03 17:57 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Ulf Hansson, Matthias Brugger, Chaotian Jing, Geert Uytterhoeven,
	linux-mmc, linux-arm-kernel,
	moderated list:ARM/Mediatek SoC support, linux-kernel

Nicolas,

On Thu, Mar 3, 2016 at 2:19 AM, Nicolas Boichat <drinkcat@chromium.org> wrote:
> We've introduced a new helper in the MMC core:
> mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
> helper has some advantages:
>
>     1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
>        VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
>        compatibility.
>
>     2. We get rid of a few more warnings when probing unsupported
>        voltages.
>
>     3. We get rid of some non-mediatek specific code in mtk-sd.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
>
> Similar to e0848f5d294c703917260a6228cc08b8be46c527
> mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
> where I copied the commit message from.
>
>  drivers/mmc/host/mtk-sd.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
@ 2016-03-03 17:57     ` Doug Anderson
  0 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2016-03-03 17:57 UTC (permalink / raw)
  To: linux-arm-kernel

Nicolas,

On Thu, Mar 3, 2016 at 2:19 AM, Nicolas Boichat <drinkcat@chromium.org> wrote:
> We've introduced a new helper in the MMC core:
> mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
> helper has some advantages:
>
>     1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
>        VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
>        compatibility.
>
>     2. We get rid of a few more warnings when probing unsupported
>        voltages.
>
>     3. We get rid of some non-mediatek specific code in mtk-sd.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
>
> Similar to e0848f5d294c703917260a6228cc08b8be46c527
> mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
> where I copied the commit message from.
>
>  drivers/mmc/host/mtk-sd.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
  2016-03-03 10:19 ` Nicolas Boichat
  (?)
@ 2016-03-03 17:57   ` Doug Anderson
  -1 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2016-03-03 17:57 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Ulf Hansson, Matthias Brugger, Chaotian Jing, Geert Uytterhoeven,
	linux-mmc, linux-arm-kernel,
	moderated list:ARM/Mediatek SoC support, linux-kernel

Nicolas,

On Thu, Mar 3, 2016 at 2:19 AM, Nicolas Boichat <drinkcat@chromium.org> wrote:
> In commit ceae98f20e36 ("mmc: core: Try other signal levels
> during power up") we can see that there are times when it's
> valid to try several signal voltages.  Don't print an ugly
> error in the logs when that happens.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
>
> Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
> mmc: dw_mmc: Change signal voltage error to dev_dbg()
>
>  drivers/mmc/host/mtk-sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
@ 2016-03-03 17:57   ` Doug Anderson
  0 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2016-03-03 17:57 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Ulf Hansson, Matthias Brugger, Chaotian Jing, Geert Uytterhoeven,
	linux-mmc, linux-arm-kernel,
	moderated list:ARM/Mediatek SoC support, linux-kernel

Nicolas,

On Thu, Mar 3, 2016 at 2:19 AM, Nicolas Boichat <drinkcat@chromium.org> wrote:
> In commit ceae98f20e36 ("mmc: core: Try other signal levels
> during power up") we can see that there are times when it's
> valid to try several signal voltages.  Don't print an ugly
> error in the logs when that happens.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
>
> Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
> mmc: dw_mmc: Change signal voltage error to dev_dbg()
>
>  drivers/mmc/host/mtk-sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
@ 2016-03-03 17:57   ` Doug Anderson
  0 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2016-03-03 17:57 UTC (permalink / raw)
  To: linux-arm-kernel

Nicolas,

On Thu, Mar 3, 2016 at 2:19 AM, Nicolas Boichat <drinkcat@chromium.org> wrote:
> In commit ceae98f20e36 ("mmc: core: Try other signal levels
> during power up") we can see that there are times when it's
> valid to try several signal voltages.  Don't print an ugly
> error in the logs when that happens.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
>
> Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
> mmc: dw_mmc: Change signal voltage error to dev_dbg()
>
>  drivers/mmc/host/mtk-sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
  2016-03-03 10:19 ` Nicolas Boichat
  (?)
@ 2016-03-04  9:41   ` Ulf Hansson
  -1 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-03-04  9:41 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Matthias Brugger, Chaotian Jing, Geert Uytterhoeven, linux-mmc,
	linux-arm-kernel, linux-mediatek, linux-kernel, Doug Anderson

On 3 March 2016 at 11:19, Nicolas Boichat <drinkcat@chromium.org> wrote:
> In commit ceae98f20e36 ("mmc: core: Try other signal levels
> during power up") we can see that there are times when it's
> valid to try several signal voltages.  Don't print an ugly
> error in the logs when that happens.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
> mmc: dw_mmc: Change signal voltage error to dev_dbg()
>
>  drivers/mmc/host/mtk-sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index f01972e..07809f4 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1038,7 +1038,7 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>
>                 ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
>                 if (ret) {
> -                       dev_err(host->dev,
> +                       dev_dbg(host->dev,
>                                         "Regulator set error %d: %d - %d\n",
>                                         ret, min_uv, max_uv);
>                 } else {
> --
> 2.7.0.rc3.207.g0ac5344
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
@ 2016-03-04  9:41   ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-03-04  9:41 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Matthias Brugger, Chaotian Jing, Geert Uytterhoeven, linux-mmc,
	linux-arm-kernel, linux-mediatek, linux-kernel, Doug Anderson

On 3 March 2016 at 11:19, Nicolas Boichat <drinkcat@chromium.org> wrote:
> In commit ceae98f20e36 ("mmc: core: Try other signal levels
> during power up") we can see that there are times when it's
> valid to try several signal voltages.  Don't print an ugly
> error in the logs when that happens.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
> mmc: dw_mmc: Change signal voltage error to dev_dbg()
>
>  drivers/mmc/host/mtk-sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index f01972e..07809f4 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1038,7 +1038,7 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>
>                 ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
>                 if (ret) {
> -                       dev_err(host->dev,
> +                       dev_dbg(host->dev,
>                                         "Regulator set error %d: %d - %d\n",
>                                         ret, min_uv, max_uv);
>                 } else {
> --
> 2.7.0.rc3.207.g0ac5344
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg()
@ 2016-03-04  9:41   ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-03-04  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 3 March 2016 at 11:19, Nicolas Boichat <drinkcat@chromium.org> wrote:
> In commit ceae98f20e36 ("mmc: core: Try other signal levels
> during power up") we can see that there are times when it's
> valid to try several signal voltages.  Don't print an ugly
> error in the logs when that happens.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Similar to b19caf379c82e99737c29bc15d7b7fd7d24279f9
> mmc: dw_mmc: Change signal voltage error to dev_dbg()
>
>  drivers/mmc/host/mtk-sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index f01972e..07809f4 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1038,7 +1038,7 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>
>                 ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
>                 if (ret) {
> -                       dev_err(host->dev,
> +                       dev_dbg(host->dev,
>                                         "Regulator set error %d: %d - %d\n",
>                                         ret, min_uv, max_uv);
>                 } else {
> --
> 2.7.0.rc3.207.g0ac5344
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
  2016-03-03 10:19   ` Nicolas Boichat
  (?)
@ 2016-03-04  9:41     ` Ulf Hansson
  -1 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-03-04  9:41 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Matthias Brugger, Chaotian Jing, Geert Uytterhoeven, linux-mmc,
	linux-arm-kernel, linux-mediatek, linux-kernel, Doug Anderson

On 3 March 2016 at 11:19, Nicolas Boichat <drinkcat@chromium.org> wrote:
> We've introduced a new helper in the MMC core:
> mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
> helper has some advantages:
>
>     1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
>        VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
>        compatibility.
>
>     2. We get rid of a few more warnings when probing unsupported
>        voltages.
>
>     3. We get rid of some non-mediatek specific code in mtk-sd.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Similar to e0848f5d294c703917260a6228cc08b8be46c527
> mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
> where I copied the commit message from.
>
>  drivers/mmc/host/mtk-sd.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 07809f4..b17f30d 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1021,26 +1021,19 @@ static void msdc_set_buswidth(struct msdc_host *host, u32 width)
>  static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>  {
>         struct msdc_host *host = mmc_priv(mmc);
> -       int min_uv, max_uv;
>         int ret = 0;
>
>         if (!IS_ERR(mmc->supply.vqmmc)) {
> -               if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
> -                       min_uv = 3300000;
> -                       max_uv = 3300000;
> -               } else if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
> -                       min_uv = 1800000;
> -                       max_uv = 1800000;
> -               } else {
> +               if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 &&
> +                   ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
>                         dev_err(host->dev, "Unsupported signal voltage!\n");
>                         return -EINVAL;
>                 }
>
> -               ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
> +               ret = mmc_regulator_set_vqmmc(mmc, ios);
>                 if (ret) {
> -                       dev_dbg(host->dev,
> -                                       "Regulator set error %d: %d - %d\n",
> -                                       ret, min_uv, max_uv);
> +                       dev_dbg(host->dev, "Regulator set error %d (%d)\n",
> +                               ret, ios->signal_voltage);
>                 } else {
>                         /* Apply different pinctrl settings for different signal voltage */
>                         if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
> --
> 2.7.0.rc3.207.g0ac5344
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
@ 2016-03-04  9:41     ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-03-04  9:41 UTC (permalink / raw)
  To: Nicolas Boichat
  Cc: Matthias Brugger, Chaotian Jing, Geert Uytterhoeven, linux-mmc,
	linux-arm-kernel, linux-mediatek, linux-kernel, Doug Anderson

On 3 March 2016 at 11:19, Nicolas Boichat <drinkcat@chromium.org> wrote:
> We've introduced a new helper in the MMC core:
> mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
> helper has some advantages:
>
>     1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
>        VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
>        compatibility.
>
>     2. We get rid of a few more warnings when probing unsupported
>        voltages.
>
>     3. We get rid of some non-mediatek specific code in mtk-sd.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Similar to e0848f5d294c703917260a6228cc08b8be46c527
> mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
> where I copied the commit message from.
>
>  drivers/mmc/host/mtk-sd.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 07809f4..b17f30d 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1021,26 +1021,19 @@ static void msdc_set_buswidth(struct msdc_host *host, u32 width)
>  static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>  {
>         struct msdc_host *host = mmc_priv(mmc);
> -       int min_uv, max_uv;
>         int ret = 0;
>
>         if (!IS_ERR(mmc->supply.vqmmc)) {
> -               if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
> -                       min_uv = 3300000;
> -                       max_uv = 3300000;
> -               } else if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
> -                       min_uv = 1800000;
> -                       max_uv = 1800000;
> -               } else {
> +               if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 &&
> +                   ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
>                         dev_err(host->dev, "Unsupported signal voltage!\n");
>                         return -EINVAL;
>                 }
>
> -               ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
> +               ret = mmc_regulator_set_vqmmc(mmc, ios);
>                 if (ret) {
> -                       dev_dbg(host->dev,
> -                                       "Regulator set error %d: %d - %d\n",
> -                                       ret, min_uv, max_uv);
> +                       dev_dbg(host->dev, "Regulator set error %d (%d)\n",
> +                               ret, ios->signal_voltage);
>                 } else {
>                         /* Apply different pinctrl settings for different signal voltage */
>                         if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
> --
> 2.7.0.rc3.207.g0ac5344
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
@ 2016-03-04  9:41     ` Ulf Hansson
  0 siblings, 0 replies; 16+ messages in thread
From: Ulf Hansson @ 2016-03-04  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 3 March 2016 at 11:19, Nicolas Boichat <drinkcat@chromium.org> wrote:
> We've introduced a new helper in the MMC core:
> mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
> helper has some advantages:
>
>     1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
>        VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
>        compatibility.
>
>     2. We get rid of a few more warnings when probing unsupported
>        voltages.
>
>     3. We get rid of some non-mediatek specific code in mtk-sd.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Similar to e0848f5d294c703917260a6228cc08b8be46c527
> mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch ,
> where I copied the commit message from.
>
>  drivers/mmc/host/mtk-sd.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 07809f4..b17f30d 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1021,26 +1021,19 @@ static void msdc_set_buswidth(struct msdc_host *host, u32 width)
>  static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>  {
>         struct msdc_host *host = mmc_priv(mmc);
> -       int min_uv, max_uv;
>         int ret = 0;
>
>         if (!IS_ERR(mmc->supply.vqmmc)) {
> -               if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
> -                       min_uv = 3300000;
> -                       max_uv = 3300000;
> -               } else if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
> -                       min_uv = 1800000;
> -                       max_uv = 1800000;
> -               } else {
> +               if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 &&
> +                   ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
>                         dev_err(host->dev, "Unsupported signal voltage!\n");
>                         return -EINVAL;
>                 }
>
> -               ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
> +               ret = mmc_regulator_set_vqmmc(mmc, ios);
>                 if (ret) {
> -                       dev_dbg(host->dev,
> -                                       "Regulator set error %d: %d - %d\n",
> -                                       ret, min_uv, max_uv);
> +                       dev_dbg(host->dev, "Regulator set error %d (%d)\n",
> +                               ret, ios->signal_voltage);
>                 } else {
>                         /* Apply different pinctrl settings for different signal voltage */
>                         if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
> --
> 2.7.0.rc3.207.g0ac5344
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-03-04  9:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-03 10:19 [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg() Nicolas Boichat
2016-03-03 10:19 ` Nicolas Boichat
2016-03-03 10:19 ` [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch Nicolas Boichat
2016-03-03 10:19   ` Nicolas Boichat
2016-03-03 17:57   ` Doug Anderson
2016-03-03 17:57     ` Doug Anderson
2016-03-03 17:57     ` Doug Anderson
2016-03-04  9:41   ` Ulf Hansson
2016-03-04  9:41     ` Ulf Hansson
2016-03-04  9:41     ` Ulf Hansson
2016-03-03 17:57 ` [PATCH 1/2] mmc: mediatek: Change signal voltage error to dev_dbg() Doug Anderson
2016-03-03 17:57   ` Doug Anderson
2016-03-03 17:57   ` Doug Anderson
2016-03-04  9:41 ` Ulf Hansson
2016-03-04  9:41   ` Ulf Hansson
2016-03-04  9:41   ` Ulf Hansson

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.