Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348951 > unrolled thread

[PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch

Started byNicolas Boichat <drinkcat@chromium.org>
First post2016-03-03 11:30 +0100
Last post2016-03-03 19:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch Nicolas Boichat <drinkcat@chromium.org> - 2016-03-03 11:30 +0100
    Re: [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch Doug Anderson <dianders@chromium.org> - 2016-03-03 19:00 +0100

#1348951 — [PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch

FromNicolas Boichat <drinkcat@chromium.org>
Date2016-03-03 11:30 +0100
Subject[PATCH 2/2] mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
Message-ID<r8yG6-5Ai-13@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1349457

FromDoug Anderson <dianders@chromium.org>
Date2016-03-03 19:00 +0100
Message-ID<r8FHB-2d3-11@gated-at.bofh.it>
In reply to#1348951
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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web