All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Set load on vmmc and vqmmc
@ 2015-07-01  4:38 ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-07-01  4:38 UTC (permalink / raw)
  To: Ulf Hansson, Mark Brown
  Cc: devicetree, linux-kernel, linux-mmc, linux-arm-msm

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---

This is needed to get our regulators into hpm, to give enough power to our
sdhci cards to run at higher clockrates - e.g. hs200.

 Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
 drivers/mmc/core/core.c                       | 6 ++++++
 drivers/mmc/core/host.c                       | 4 ++++
 include/linux/mmc/host.h                      | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 0384fc3f64e8..05c8b4f59187 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -47,6 +47,8 @@ Optional properties:
 - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
 - dsr: Value the card's (optional) Driver Stage Register (DSR) should be
   programmed with. Valid range: [0 .. 0xffff].
+- vmmc-load: requested load for the vmmc regulator, in mA
+- vqmmc-load: requested load for the vqmmc regulator, in mA
 
 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 9ad73f30f744..0a8f828af59f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1455,12 +1455,18 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
 			mmc->ocr_avail = ret;
 		else
 			dev_warn(dev, "Failed getting OCR mask: %d\n", ret);
+
+		if (mmc->supply.vmmc_load)
+			regulator_set_load(mmc->supply.vmmc, mmc->supply.vmmc_load);
 	}
 
 	if (IS_ERR(mmc->supply.vqmmc)) {
 		if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
 		dev_info(dev, "No vqmmc regulator found\n");
+	} else {
+		if (mmc->supply.vqmmc_load)
+			regulator_set_load(mmc->supply.vqmmc, mmc->supply.vqmmc_load);
 	}
 
 	return 0;
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 99a9c9011c50..136af25bef9d 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -475,6 +475,10 @@ int mmc_of_parse(struct mmc_host *host)
 			host->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
 	}
 
+	/* Parse regulator load requests */
+	of_property_read_u32(np, "vmmc-load", &host->supply.vmmc_load);
+	of_property_read_u32(np, "vqmmc-load", &host->supply.vqmmc_load);
+
 	/* Parse Write Protection */
 	ro_cap_invert = of_property_read_bool(np, "wp-inverted");
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1369e54faeb7..e4e2a26bab41 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -197,6 +197,8 @@ struct mmc_pwrseq;
 struct mmc_supply {
 	struct regulator *vmmc;		/* Card power supply */
 	struct regulator *vqmmc;	/* Optional Vccq supply */
+	u32 vmmc_load;			/* Load request for vmmc */
+	u32 vqmmc_load;			/* Load request for vqmmc */
 };
 
 struct mmc_host {
-- 
1.8.2.2

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

* [PATCH] mmc: core: Set load on vmmc and vqmmc
@ 2015-07-01  4:38 ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-07-01  4:38 UTC (permalink / raw)
  To: Ulf Hansson, Mark Brown
  Cc: devicetree, linux-kernel, linux-mmc, linux-arm-msm

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---

This is needed to get our regulators into hpm, to give enough power to our
sdhci cards to run at higher clockrates - e.g. hs200.

 Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
 drivers/mmc/core/core.c                       | 6 ++++++
 drivers/mmc/core/host.c                       | 4 ++++
 include/linux/mmc/host.h                      | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 0384fc3f64e8..05c8b4f59187 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -47,6 +47,8 @@ Optional properties:
 - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
 - dsr: Value the card's (optional) Driver Stage Register (DSR) should be
   programmed with. Valid range: [0 .. 0xffff].
+- vmmc-load: requested load for the vmmc regulator, in mA
+- vqmmc-load: requested load for the vqmmc regulator, in mA
 
 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 9ad73f30f744..0a8f828af59f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1455,12 +1455,18 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
 			mmc->ocr_avail = ret;
 		else
 			dev_warn(dev, "Failed getting OCR mask: %d\n", ret);
+
+		if (mmc->supply.vmmc_load)
+			regulator_set_load(mmc->supply.vmmc, mmc->supply.vmmc_load);
 	}
 
 	if (IS_ERR(mmc->supply.vqmmc)) {
 		if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
 		dev_info(dev, "No vqmmc regulator found\n");
+	} else {
+		if (mmc->supply.vqmmc_load)
+			regulator_set_load(mmc->supply.vqmmc, mmc->supply.vqmmc_load);
 	}
 
 	return 0;
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 99a9c9011c50..136af25bef9d 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -475,6 +475,10 @@ int mmc_of_parse(struct mmc_host *host)
 			host->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
 	}
 
+	/* Parse regulator load requests */
+	of_property_read_u32(np, "vmmc-load", &host->supply.vmmc_load);
+	of_property_read_u32(np, "vqmmc-load", &host->supply.vqmmc_load);
+
 	/* Parse Write Protection */
 	ro_cap_invert = of_property_read_bool(np, "wp-inverted");
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1369e54faeb7..e4e2a26bab41 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -197,6 +197,8 @@ struct mmc_pwrseq;
 struct mmc_supply {
 	struct regulator *vmmc;		/* Card power supply */
 	struct regulator *vqmmc;	/* Optional Vccq supply */
+	u32 vmmc_load;			/* Load request for vmmc */
+	u32 vqmmc_load;			/* Load request for vqmmc */
 };
 
 struct mmc_host {
-- 
1.8.2.2


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

* Re: [PATCH] mmc: core: Set load on vmmc and vqmmc
  2015-07-01  4:38 ` Bjorn Andersson
  (?)
@ 2015-07-01 10:59 ` Mark Brown
  2015-07-02 18:10   ` Bjorn Andersson
  -1 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2015-07-01 10:59 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ulf Hansson, devicetree, linux-kernel, linux-mmc, linux-arm-msm

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Tue, Jun 30, 2015 at 09:38:45PM -0700, Bjorn Andersson wrote:

> +- vmmc-load: requested load for the vmmc regulator, in mA
> +- vqmmc-load: requested load for the vqmmc regulator, in mA

Isn't this something that should have default values from the spec?  The
binding also ought to say what a "requested load" is.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH] mmc: core: Set load on vmmc and vqmmc
  2015-07-01 10:59 ` Mark Brown
@ 2015-07-02 18:10   ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-07-02 18:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Ulf Hansson, devicetree, linux-kernel, linux-mmc, linux-arm-msm

On Wed 01 Jul 03:59 PDT 2015, Mark Brown wrote:

> On Tue, Jun 30, 2015 at 09:38:45PM -0700, Bjorn Andersson wrote:
> 
> > +- vmmc-load: requested load for the vmmc regulator, in mA
> > +- vqmmc-load: requested load for the vqmmc regulator, in mA
> 
> Isn't this something that should have default values from the spec?  The
> binding also ought to say what a "requested load" is.

It sounds reasonable that these values should simply come from the card
specification; I don't know if there's any sane way for us to list them
though (other than just stating them in dt).

I'll have to do some more investigation on the subject...


And I get your point that it's not "requested load", it's the power
requirements of the card...so it should be rephrased.

Thanks,
Bjorn

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

* [PATCH v2] mmc: core: Allow specifying current consumption
  2015-07-01  4:38 ` Bjorn Andersson
@ 2015-10-13  1:00   ` Bjorn Andersson
  -1 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-10-13  1:00 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Ulf Hansson
  Cc: devicetree, linux-kernel, linux-mmc

This allows us to specify expected current consumption of the vmmc and
vqmmc regulators. This is needed to bring the supplying regulators out
of their low-power-mode while accessing the mmc.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---

The sd specification states that if the host can provide more than 150mA this
should be indicated in the "XPC value in the argument of ACMD41" for SDXC
cards. Should this be tied in with the added property as well?

Changes since v1:
- Property name and description updated to clarify intention

 Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
 drivers/mmc/core/core.c                       | 6 ++++++
 drivers/mmc/core/host.c                       | 4 ++++
 include/linux/mmc/host.h                      | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 0384fc3f64e8..7514083a9f55 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -47,6 +47,8 @@ Optional properties:
 - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
 - dsr: Value the card's (optional) Driver Stage Register (DSR) should be
   programmed with. Valid range: [0 .. 0xffff].
+- vmmc-active-current: current required from the vmmc regulator, in uA
+- vqmmc-active-current: current required from the vqmmc regulator, in uA
 
 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 23fa221ce803..603f40136306 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1469,12 +1469,18 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
 			mmc->ocr_avail = ret;
 		else
 			dev_warn(dev, "Failed getting OCR mask: %d\n", ret);
+
+		if (mmc->supply.vmmc_current)
+			regulator_set_load(mmc->supply.vmmc, mmc->supply.vmmc_current);
 	}
 
 	if (IS_ERR(mmc->supply.vqmmc)) {
 		if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
 		dev_info(dev, "No vqmmc regulator found\n");
+	} else {
+		if (mmc->supply.vqmmc_current)
+			regulator_set_load(mmc->supply.vqmmc, mmc->supply.vqmmc_current);
 	}
 
 	return 0;
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 970e6906930b..ede508d63fb5 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -235,6 +235,10 @@ int mmc_of_parse(struct mmc_host *host)
 			host->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
 	}
 
+	/* Parse regulator load requests */
+	of_property_read_u32(np, "vmmc-active-current", &host->supply.vmmc_current);
+	of_property_read_u32(np, "vqmmc-active-current", &host->supply.vqmmc_current);
+
 	/* Parse Write Protection */
 	ro_cap_invert = of_property_read_bool(np, "wp-inverted");
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8673ffe3d86e..640d8dbb8559 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -197,6 +197,8 @@ struct mmc_pwrseq;
 struct mmc_supply {
 	struct regulator *vmmc;		/* Card power supply */
 	struct regulator *vqmmc;	/* Optional Vccq supply */
+	u32 vmmc_current;		/* Requested current for vmmc */
+	u32 vqmmc_current;		/* Requested current for vqmmc */
 };
 
 struct mmc_host {
-- 
2.4.2


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

* [PATCH v2] mmc: core: Allow specifying current consumption
@ 2015-10-13  1:00   ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-10-13  1:00 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Ulf Hansson
  Cc: devicetree, linux-kernel, linux-mmc

This allows us to specify expected current consumption of the vmmc and
vqmmc regulators. This is needed to bring the supplying regulators out
of their low-power-mode while accessing the mmc.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---

The sd specification states that if the host can provide more than 150mA this
should be indicated in the "XPC value in the argument of ACMD41" for SDXC
cards. Should this be tied in with the added property as well?

Changes since v1:
- Property name and description updated to clarify intention

 Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
 drivers/mmc/core/core.c                       | 6 ++++++
 drivers/mmc/core/host.c                       | 4 ++++
 include/linux/mmc/host.h                      | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 0384fc3f64e8..7514083a9f55 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -47,6 +47,8 @@ Optional properties:
 - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
 - dsr: Value the card's (optional) Driver Stage Register (DSR) should be
   programmed with. Valid range: [0 .. 0xffff].
+- vmmc-active-current: current required from the vmmc regulator, in uA
+- vqmmc-active-current: current required from the vqmmc regulator, in uA
 
 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 23fa221ce803..603f40136306 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1469,12 +1469,18 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
 			mmc->ocr_avail = ret;
 		else
 			dev_warn(dev, "Failed getting OCR mask: %d\n", ret);
+
+		if (mmc->supply.vmmc_current)
+			regulator_set_load(mmc->supply.vmmc, mmc->supply.vmmc_current);
 	}
 
 	if (IS_ERR(mmc->supply.vqmmc)) {
 		if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
 		dev_info(dev, "No vqmmc regulator found\n");
+	} else {
+		if (mmc->supply.vqmmc_current)
+			regulator_set_load(mmc->supply.vqmmc, mmc->supply.vqmmc_current);
 	}
 
 	return 0;
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 970e6906930b..ede508d63fb5 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -235,6 +235,10 @@ int mmc_of_parse(struct mmc_host *host)
 			host->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
 	}
 
+	/* Parse regulator load requests */
+	of_property_read_u32(np, "vmmc-active-current", &host->supply.vmmc_current);
+	of_property_read_u32(np, "vqmmc-active-current", &host->supply.vqmmc_current);
+
 	/* Parse Write Protection */
 	ro_cap_invert = of_property_read_bool(np, "wp-inverted");
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8673ffe3d86e..640d8dbb8559 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -197,6 +197,8 @@ struct mmc_pwrseq;
 struct mmc_supply {
 	struct regulator *vmmc;		/* Card power supply */
 	struct regulator *vqmmc;	/* Optional Vccq supply */
+	u32 vmmc_current;		/* Requested current for vmmc */
+	u32 vqmmc_current;		/* Requested current for vqmmc */
 };
 
 struct mmc_host {
-- 
2.4.2


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

* Re: [PATCH v2] mmc: core: Allow specifying current consumption
  2015-10-13  1:00   ` Bjorn Andersson
  (?)
@ 2015-10-16 12:55   ` Ulf Hansson
  2015-10-17 17:09       ` Bjorn Andersson
  -1 siblings, 1 reply; 9+ messages in thread
From: Ulf Hansson @ 2015-10-16 12:55 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree, linux-kernel, linux-mmc

On 13 October 2015 at 03:00, Bjorn Andersson
<bjorn.andersson@sonymobile.com> wrote:
> This allows us to specify expected current consumption of the vmmc and
> vqmmc regulators. This is needed to bring the supplying regulators out
> of their low-power-mode while accessing the mmc.

This indeed makes sense, still I need to think a bit more on this.

For example, can we allow these regulators to enter low power again at
some times? If so, when and what should that current value be.

Moreover, wouldn't vmmc|vqmmc-active-current be depending what eMMC/SD
card that is attached?

>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> ---
>
> The sd specification states that if the host can provide more than 150mA this
> should be indicated in the "XPC value in the argument of ACMD41" for SDXC
> cards. Should this be tied in with the added property as well?
>
> Changes since v1:
> - Property name and description updated to clarify intention
>
>  Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
>  drivers/mmc/core/core.c                       | 6 ++++++
>  drivers/mmc/core/host.c                       | 4 ++++
>  include/linux/mmc/host.h                      | 2 ++
>  4 files changed, 14 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
> index 0384fc3f64e8..7514083a9f55 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
> @@ -47,6 +47,8 @@ Optional properties:
>  - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
>  - dsr: Value the card's (optional) Driver Stage Register (DSR) should be
>    programmed with. Valid range: [0 .. 0xffff].
> +- vmmc-active-current: current required from the vmmc regulator, in uA
> +- vqmmc-active-current: current required from the vqmmc regulator, in uA
>
>  *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
>  polarity properties, we have to fix the meaning of the "normal" and "inverted"
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 23fa221ce803..603f40136306 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1469,12 +1469,18 @@ int mmc_regulator_get_supply(struct mmc_host *mmc)
>                         mmc->ocr_avail = ret;
>                 else
>                         dev_warn(dev, "Failed getting OCR mask: %d\n", ret);
> +
> +               if (mmc->supply.vmmc_current)
> +                       regulator_set_load(mmc->supply.vmmc, mmc->supply.vmmc_current);
>         }
>
>         if (IS_ERR(mmc->supply.vqmmc)) {
>                 if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
>                         return -EPROBE_DEFER;
>                 dev_info(dev, "No vqmmc regulator found\n");
> +       } else {
> +               if (mmc->supply.vqmmc_current)
> +                       regulator_set_load(mmc->supply.vqmmc, mmc->supply.vqmmc_current);
>         }
>
>         return 0;
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 970e6906930b..ede508d63fb5 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -235,6 +235,10 @@ int mmc_of_parse(struct mmc_host *host)
>                         host->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
>         }
>
> +       /* Parse regulator load requests */
> +       of_property_read_u32(np, "vmmc-active-current", &host->supply.vmmc_current);
> +       of_property_read_u32(np, "vqmmc-active-current", &host->supply.vqmmc_current);
> +
>         /* Parse Write Protection */
>         ro_cap_invert = of_property_read_bool(np, "wp-inverted");
>
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 8673ffe3d86e..640d8dbb8559 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -197,6 +197,8 @@ struct mmc_pwrseq;
>  struct mmc_supply {
>         struct regulator *vmmc;         /* Card power supply */
>         struct regulator *vqmmc;        /* Optional Vccq supply */
> +       u32 vmmc_current;               /* Requested current for vmmc */
> +       u32 vqmmc_current;              /* Requested current for vqmmc */
>  };
>
>  struct mmc_host {
> --
> 2.4.2
>

Kind regards
Uffe

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

* Re: [PATCH v2] mmc: core: Allow specifying current consumption
@ 2015-10-17 17:09       ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-10-17 17:09 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree, linux-kernel, linux-mmc

On Fri 16 Oct 05:55 PDT 2015, Ulf Hansson wrote:

> On 13 October 2015 at 03:00, Bjorn Andersson
> <bjorn.andersson@sonymobile.com> wrote:
> > This allows us to specify expected current consumption of the vmmc and
> > vqmmc regulators. This is needed to bring the supplying regulators out
> > of their low-power-mode while accessing the mmc.
> 
> This indeed makes sense, still I need to think a bit more on this.
> 

Thanks.

We can currently work around this by using "regulator-system-load" on
the vmmc regulator, but a proper fix would be nice.

> For example, can we allow these regulators to enter low power again at
> some times? If so, when and what should that current value be.
> 

The regulator framework recalculates the total load on a regulator upon
enable/disable, but currently it doesn't depend on the state of the
regulator.

I talked to Mark about this a while back and he was positive to us
correcting this, so disabled regulators wouldn't count towards the total
load of a regulator. (So that still is on my todo)


The second option would be to do what is done in the Qualcomm codeaurora
kernels, where the regulators are never disabled and there's a smaller
current specified for the suspend case.

This would require bigger changes to the mmc core I presume, but the
naming of the dt properties support such future adaption.

> Moreover, wouldn't vmmc|vqmmc-active-current be depending what eMMC/SD
> card that is attached?
> 

I would say so, I do however not know how to acquire or encode that
information. Any suggestions here are welcome.

Regards,
Bjorn

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

* Re: [PATCH v2] mmc: core: Allow specifying current consumption
@ 2015-10-17 17:09       ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-10-17 17:09 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mmc

On Fri 16 Oct 05:55 PDT 2015, Ulf Hansson wrote:

> On 13 October 2015 at 03:00, Bjorn Andersson
> <bjorn.andersson-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org> wrote:
> > This allows us to specify expected current consumption of the vmmc and
> > vqmmc regulators. This is needed to bring the supplying regulators out
> > of their low-power-mode while accessing the mmc.
> 
> This indeed makes sense, still I need to think a bit more on this.
> 

Thanks.

We can currently work around this by using "regulator-system-load" on
the vmmc regulator, but a proper fix would be nice.

> For example, can we allow these regulators to enter low power again at
> some times? If so, when and what should that current value be.
> 

The regulator framework recalculates the total load on a regulator upon
enable/disable, but currently it doesn't depend on the state of the
regulator.

I talked to Mark about this a while back and he was positive to us
correcting this, so disabled regulators wouldn't count towards the total
load of a regulator. (So that still is on my todo)


The second option would be to do what is done in the Qualcomm codeaurora
kernels, where the regulators are never disabled and there's a smaller
current specified for the suspend case.

This would require bigger changes to the mmc core I presume, but the
naming of the dt properties support such future adaption.

> Moreover, wouldn't vmmc|vqmmc-active-current be depending what eMMC/SD
> card that is attached?
> 

I would say so, I do however not know how to acquire or encode that
information. Any suggestions here are welcome.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-10-17 17:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01  4:38 [PATCH] mmc: core: Set load on vmmc and vqmmc Bjorn Andersson
2015-07-01  4:38 ` Bjorn Andersson
2015-07-01 10:59 ` Mark Brown
2015-07-02 18:10   ` Bjorn Andersson
2015-10-13  1:00 ` [PATCH v2] mmc: core: Allow specifying current consumption Bjorn Andersson
2015-10-13  1:00   ` Bjorn Andersson
2015-10-16 12:55   ` Ulf Hansson
2015-10-17 17:09     ` Bjorn Andersson
2015-10-17 17:09       ` Bjorn Andersson

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.