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


Groups > linux.kernel > #1659521 > unrolled thread

[PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators

Started byKishon Vijay Abraham I <kishon@ti.com>
First post2017-06-07 10:40 +0200
Last post2017-06-12 10:00 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators Kishon Vijay Abraham I <kishon@ti.com> - 2017-06-07 10:40 +0200
    [PATCH 2/3] mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators Kishon Vijay Abraham I <kishon@ti.com> - 2017-06-07 10:40 +0200
      Re: [PATCH 2/3] mmc: host: omap_hsmmc: use mmc_regulator_get_supply()  to get regulators Ulf Hansson <ulf.hansson@linaro.org> - 2017-06-08 09:20 +0200
    Re: [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators Ulf Hansson <ulf.hansson@linaro.org> - 2017-06-08 09:20 +0200
      Re: [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get  regulators Kishon Vijay Abraham I <kishon@ti.com> - 2017-06-09 10:00 +0200
        Re: [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators Ulf Hansson <ulf.hansson@linaro.org> - 2017-06-12 10:00 +0200

#1659521 — [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators

FromKishon Vijay Abraham I <kishon@ti.com>
Date2017-06-07 10:40 +0200
Subject[PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators
Message-ID<tPEFs-4bF-7@gated-at.bofh.it>
This series deprecates "vmmc_aux" supply property and uses the generic
"vqmmc" property.

Not sure how exactly to handle omap3-overo-base.dtsi which already has
both vqmmc-supply and vmmc_aux-supply without breaking old dt
compatibility. (vqmmc-supply seems to have been added there by mistake
from 3.15).

In the dt series that will follow, will replace all vmmc_aux-supply
with vqmmc-supply (In omap3-overo-base.dtsi remove the existing
vqmmc-supply and then replace vmmc_aux-supply with vqmmc-supply).

Kishon Vijay Abraham I (3):
  mmc: host: omap_hsmmc: Do not initialize MMC regulators to NULL on
    error
  mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get
    regulators
  Documentation: dt-bindings: Document deprecation of "vmmc_aux" and
    using "vqmmc"

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |  2 +-
 drivers/mmc/host/omap_hsmmc.c                      | 55 +++++++++-------------
 2 files changed, 24 insertions(+), 33 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1659522 — [PATCH 2/3] mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators

FromKishon Vijay Abraham I <kishon@ti.com>
Date2017-06-07 10:40 +0200
Subject[PATCH 2/3] mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators
Message-ID<tPEFs-4bF-23@gated-at.bofh.it>
In reply to#1659521
In preparation for using the generic mmc binding for io regulator
("vqmmc"), use mmc_regulator_get_supply() to get vmmc and vqmmc regulators.
Only if "vqmmc" regulator isn't found, fallback to use "vmmc_aux"
regulator.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index de82ac0a87e2..f6da8bc0d64f 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -466,34 +466,27 @@ static int omap_hsmmc_disable_boot_regulators(struct omap_hsmmc_host *host)
 
 static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
 {
-	int ocr_value = 0;
 	int ret;
 	struct mmc_host *mmc = host->mmc;
 
 	if (mmc_pdata(host)->set_power)
 		return 0;
 
-	mmc->supply.vmmc = devm_regulator_get_optional(host->dev, "vmmc");
-	if (IS_ERR(mmc->supply.vmmc)) {
-		ret = PTR_ERR(mmc->supply.vmmc);
-		if ((ret != -ENODEV) && host->dev->of_node)
-			return ret;
-		dev_dbg(host->dev, "unable to get vmmc regulator %ld\n",
-			PTR_ERR(mmc->supply.vmmc));
-	} else {
-		ocr_value = mmc_regulator_get_ocrmask(mmc->supply.vmmc);
-		if (ocr_value > 0)
-			mmc_pdata(host)->ocr_mask = ocr_value;
-	}
+	ret = mmc_regulator_get_supply(mmc);
+	if (ret == -EPROBE_DEFER)
+		return ret;
 
 	/* Allow an aux regulator */
-	mmc->supply.vqmmc = devm_regulator_get_optional(host->dev, "vmmc_aux");
 	if (IS_ERR(mmc->supply.vqmmc)) {
-		ret = PTR_ERR(mmc->supply.vqmmc);
-		if ((ret != -ENODEV) && host->dev->of_node)
-			return ret;
-		dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n",
-			PTR_ERR(mmc->supply.vqmmc));
+		mmc->supply.vqmmc = devm_regulator_get_optional(host->dev,
+								"vmmc_aux");
+		if (IS_ERR(mmc->supply.vqmmc)) {
+			ret = PTR_ERR(mmc->supply.vqmmc);
+			if ((ret != -ENODEV) && host->dev->of_node)
+				return ret;
+			dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n",
+				PTR_ERR(mmc->supply.vqmmc));
+		}
 	}
 
 	host->pbias = devm_regulator_get_optional(host->dev, "pbias");
@@ -2143,7 +2136,8 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_irq;
 
-	mmc->ocr_avail = mmc_pdata(host)->ocr_mask;
+	if (mmc_pdata(host)->ocr_mask)
+		mmc->ocr_avail = mmc_pdata(host)->ocr_mask;
 
 	omap_hsmmc_disable_irq(host);
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1660826 — Re: [PATCH 2/3] mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-06-08 09:20 +0200
SubjectRe: [PATCH 2/3] mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators
Message-ID<tPZTB-1ak-33@gated-at.bofh.it>
In reply to#1659522
>         host->pbias = devm_regulator_get_optional(host->dev, "pbias");
> @@ -2143,7 +2136,8 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>         if (ret)
>                 goto err_irq;
>
> -       mmc->ocr_avail = mmc_pdata(host)->ocr_mask;
> +       if (mmc_pdata(host)->ocr_mask)
> +               mmc->ocr_avail = mmc_pdata(host)->ocr_mask;

This should rather be:

if (!mmc->ocr_avail)
     mmc->ocr_avail = mmc_pdata(host)->ocr_mask

In other words, fall back to the platform ocr mask.

>
>         omap_hsmmc_disable_irq(host);
>
> --
> 2.11.0
>

Kind regards
Uffe

[toc] | [prev] | [next] | [standalone]


#1660818

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-06-08 09:20 +0200
Message-ID<tPZTA-1ak-17@gated-at.bofh.it>
In reply to#1659521
On 7 June 2017 at 10:36, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> This series deprecates "vmmc_aux" supply property and uses the generic
> "vqmmc" property.
>
> Not sure how exactly to handle omap3-overo-base.dtsi which already has
> both vqmmc-supply and vmmc_aux-supply without breaking old dt
> compatibility. (vqmmc-supply seems to have been added there by mistake
> from 3.15).
>
> In the dt series that will follow, will replace all vmmc_aux-supply
> with vqmmc-supply (In omap3-overo-base.dtsi remove the existing
> vqmmc-supply and then replace vmmc_aux-supply with vqmmc-supply).
>
> Kishon Vijay Abraham I (3):
>   mmc: host: omap_hsmmc: Do not initialize MMC regulators to NULL on
>     error
>   mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get
>     regulators
>   Documentation: dt-bindings: Document deprecation of "vmmc_aux" and
>     using "vqmmc"
>
>  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |  2 +-
>  drivers/mmc/host/omap_hsmmc.c                      | 55 +++++++++-------------
>  2 files changed, 24 insertions(+), 33 deletions(-)
>
> --
> 2.11.0
>

Besides the minor comment for patch2 this looks good to me.

In case there are no other comments, and that you agree with my
suggested change, you don't need to re-spin.

Kind regards
Uffe

[toc] | [prev] | [next] | [standalone]


#1662056 — Re: [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators

FromKishon Vijay Abraham I <kishon@ti.com>
Date2017-06-09 10:00 +0200
SubjectRe: [PATCH 0/3] omap_hsmmc: use mmc_regulator_get_supply() to get regulators
Message-ID<tQmZP-7c4-5@gated-at.bofh.it>
In reply to#1660818
Hi Uffe,

On Thursday 08 June 2017 12:45 PM, Ulf Hansson wrote:
> On 7 June 2017 at 10:36, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>> This series deprecates "vmmc_aux" supply property and uses the generic
>> "vqmmc" property.
>>
>> Not sure how exactly to handle omap3-overo-base.dtsi which already has
>> both vqmmc-supply and vmmc_aux-supply without breaking old dt
>> compatibility. (vqmmc-supply seems to have been added there by mistake
>> from 3.15).
>>
>> In the dt series that will follow, will replace all vmmc_aux-supply
>> with vqmmc-supply (In omap3-overo-base.dtsi remove the existing
>> vqmmc-supply and then replace vmmc_aux-supply with vqmmc-supply).
>>
>> Kishon Vijay Abraham I (3):
>>   mmc: host: omap_hsmmc: Do not initialize MMC regulators to NULL on
>>     error
>>   mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get
>>     regulators
>>   Documentation: dt-bindings: Document deprecation of "vmmc_aux" and
>>     using "vqmmc"
>>
>>  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |  2 +-
>>  drivers/mmc/host/omap_hsmmc.c                      | 55 +++++++++-------------
>>  2 files changed, 24 insertions(+), 33 deletions(-)
>>
>> --
>> 2.11.0
>>
> 
> Besides the minor comment for patch2 this looks good to me.
> 
> In case there are no other comments, and that you agree with my
> suggested change, you don't need to re-spin.

Your suggested change looks good.

Thanks
Kishon

[toc] | [prev] | [next] | [standalone]


#1663299

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-06-12 10:00 +0200
Message-ID<tRsqu-7Lf-13@gated-at.bofh.it>
In reply to#1662056
On 9 June 2017 at 09:51, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> Hi Uffe,
>
> On Thursday 08 June 2017 12:45 PM, Ulf Hansson wrote:
>> On 7 June 2017 at 10:36, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>>> This series deprecates "vmmc_aux" supply property and uses the generic
>>> "vqmmc" property.
>>>
>>> Not sure how exactly to handle omap3-overo-base.dtsi which already has
>>> both vqmmc-supply and vmmc_aux-supply without breaking old dt
>>> compatibility. (vqmmc-supply seems to have been added there by mistake
>>> from 3.15).
>>>
>>> In the dt series that will follow, will replace all vmmc_aux-supply
>>> with vqmmc-supply (In omap3-overo-base.dtsi remove the existing
>>> vqmmc-supply and then replace vmmc_aux-supply with vqmmc-supply).
>>>
>>> Kishon Vijay Abraham I (3):
>>>   mmc: host: omap_hsmmc: Do not initialize MMC regulators to NULL on
>>>     error
>>>   mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get
>>>     regulators
>>>   Documentation: dt-bindings: Document deprecation of "vmmc_aux" and
>>>     using "vqmmc"
>>>
>>>  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |  2 +-
>>>  drivers/mmc/host/omap_hsmmc.c                      | 55 +++++++++-------------
>>>  2 files changed, 24 insertions(+), 33 deletions(-)
>>>
>>> --
>>> 2.11.0
>>>
>>
>> Besides the minor comment for patch2 this looks good to me.
>>
>> In case there are no other comments, and that you agree with my
>> suggested change, you don't need to re-spin.
>
> Your suggested change looks good.

Great! I amended the change and I have applied this series for next!

Kind regards
Uffe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web