2020-03-06 10:41:11

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH 00/10] Raspberry Pi vmmc regulator support

The series snowballed into adding a new quirk, as I reliased
sdhci-iproc's behaviour is not that uncommon.

Based on Phil Elwell's work in the downstream Raspberry Pi kernel.

---

Nicolas Saenz Julienne (10):
mmc: sdhci: Add quirk SDHCI_QUIRK2_SET_BUS_VOLTAGE
mmc: sdhci: milbeaut: Use quirk instead of custom set_power()
mmc: sdhci: arsan: Use quirk instead of custom set_power()
mmc: sdhci: at-91: Use quirk instead of custom set_power()
mmc: sdhci: pxav3: Use quirk instead of custom set_power()
mmc: sdhci: xenon: Use quirk instead of custom set_power()
mmc: sdhci: am654: Use quirk instead of custom set_power()
mmc: sdhci: Unexport sdhci_set_power_noreg()
mmc: sdhci: iproc: Use SDHCI_QUIRK2_SET_BUS_VOLTAGE on bcm2711
ARM: dts: bcm2711: Add sd_vcc regulator to emmc2

arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 11 +++++++++
drivers/mmc/host/sdhci-iproc.c | 1 +
drivers/mmc/host/sdhci-milbeaut.c | 15 ++----------
drivers/mmc/host/sdhci-of-arasan.c | 22 +++++------------
drivers/mmc/host/sdhci-of-at91.c | 18 +-------------
drivers/mmc/host/sdhci-pxav3.c | 20 +---------------
drivers/mmc/host/sdhci-xenon.c | 20 +---------------
drivers/mmc/host/sdhci.c | 34 +++++++++++++++------------
drivers/mmc/host/sdhci.h | 4 ++--
drivers/mmc/host/sdhci_am654.c | 23 +++++-------------
10 files changed, 50 insertions(+), 118 deletions(-)

--
2.25.1


2020-03-06 10:41:15

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH 05/10] mmc: sdhci: pxav3: Use quirk instead of custom set_power()

With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need
to use a custom set_power() implementation as the quirk takes care of
configuring the bus voltage register even when powering trough a
regulator.

Signed-off-by: Nicolas Saenz Julienne <[email protected]>
---
drivers/mmc/host/sdhci-pxav3.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index e55037ceda73..dc4a1e69e6f6 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -297,27 +297,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
__func__, uhs, ctrl_2);
}

-static void pxav3_set_power(struct sdhci_host *host, unsigned char mode,
- unsigned short vdd)
-{
- struct mmc_host *mmc = host->mmc;
- u8 pwr = host->pwr;
-
- sdhci_set_power_noreg(host, mode, vdd);
-
- if (host->pwr == pwr)
- return;
-
- if (host->pwr == 0)
- vdd = 0;
-
- if (!IS_ERR(mmc->supply.vmmc))
- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
-}
-
static const struct sdhci_ops pxav3_sdhci_ops = {
.set_clock = sdhci_set_clock,
- .set_power = pxav3_set_power,
.platform_send_init_74_clocks = pxav3_gen_init_74_clocks,
.get_max_clock = sdhci_pltfm_clk_get_max_clock,
.set_bus_width = sdhci_set_bus_width,
@@ -330,6 +311,7 @@ static const struct sdhci_pltfm_data sdhci_pxav3_pdata = {
| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
| SDHCI_QUIRK_32BIT_ADMA_SIZE
| SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+ .quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE,
.ops = &pxav3_sdhci_ops,
};

--
2.25.1

2020-03-06 10:41:50

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH 04/10] mmc: sdhci: at-91: Use quirk instead of custom set_power()

With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need
to use a custom set_power() implementation as the quirk takes care of
configuring the bus voltage register even when powering trough a
regulator.

Signed-off-by: Nicolas Saenz Julienne <[email protected]>
---
drivers/mmc/host/sdhci-of-at91.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index ab2bd314a390..395fe93b78d3 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -101,22 +101,6 @@ static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock)
sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
}

-/*
- * In this specific implementation of the SDHCI controller, the power register
- * needs to have a valid voltage set even when the power supply is managed by
- * an external regulator.
- */
-static void sdhci_at91_set_power(struct sdhci_host *host, unsigned char mode,
- unsigned short vdd)
-{
- if (!IS_ERR(host->mmc->supply.vmmc)) {
- struct mmc_host *mmc = host->mmc;
-
- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
- }
- sdhci_set_power_noreg(host, mode, vdd);
-}
-
static void sdhci_at91_set_uhs_signaling(struct sdhci_host *host,
unsigned int timing)
{
@@ -145,11 +129,11 @@ static const struct sdhci_ops sdhci_at91_sama5d2_ops = {
.set_bus_width = sdhci_set_bus_width,
.reset = sdhci_at91_reset,
.set_uhs_signaling = sdhci_at91_set_uhs_signaling,
- .set_power = sdhci_at91_set_power,
};

static const struct sdhci_pltfm_data sdhci_sama5d2_pdata = {
.ops = &sdhci_at91_sama5d2_ops,
+ .quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE,
};

static const struct sdhci_at91_soc_data soc_data_sama5d2 = {
--
2.25.1

2020-03-06 10:48:00

by Phil Elwell

[permalink] [raw]
Subject: Re: [PATCH 00/10] Raspberry Pi vmmc regulator support

Hi Nicolas,

On 06/03/2020 10:38, Nicolas Saenz Julienne wrote:
> The series snowballed into adding a new quirk, as I reliased
> sdhci-iproc's behaviour is not that uncommon.
>
> Based on Phil Elwell's work in the downstream Raspberry Pi kernel.

There are a few typos in the commit messages ("reliased" -> "realised",
"trough" -> "through"), but otherwise:

Reviewed-by: Phil Elwell <[email protected]>

Phil

2020-03-06 10:53:00

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH 00/10] Raspberry Pi vmmc regulator support

On Fri, 2020-03-06 at 10:46 +0000, Phil Elwell wrote:
> Hi Nicolas,
>
> On 06/03/2020 10:38, Nicolas Saenz Julienne wrote:
> > The series snowballed into adding a new quirk, as I reliased
> > sdhci-iproc's behaviour is not that uncommon.
> >
> > Based on Phil Elwell's work in the downstream Raspberry Pi kernel.
>
> There are a few typos in the commit messages ("reliased" -> "realised",
> "trough" -> "through"), but otherwise:

Noted, I'll do an typo sweep for v2.

> Reviewed-by: Phil Elwell <[email protected]>

Thanks!

Regards,
Nicolas


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part