linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: devicetree@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
	Hu Ziji <huziji@marvell.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com,
	phil@raspberrypi.org,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 06/10] mmc: sdhci: xenon: Use quirk instead of custom set_power()
Date: Fri,  6 Mar 2020 11:38:51 +0100	[thread overview]
Message-ID: <20200306103857.23962-7-nsaenzjulienne@suse.de> (raw)
In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de>

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 <nsaenzjulienne@suse.de>
---
 drivers/mmc/host/sdhci-xenon.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
index 1dea1ba66f7b..5bca5f9e5660 100644
--- a/drivers/mmc/host/sdhci-xenon.c
+++ b/drivers/mmc/host/sdhci-xenon.c
@@ -213,24 +213,6 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
 	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
 }
 
-static void xenon_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 void xenon_voltage_switch(struct sdhci_host *host)
 {
 	/* Wait for 5ms after set 1.8V signal enable bit */
@@ -240,7 +222,6 @@ static void xenon_voltage_switch(struct sdhci_host *host)
 static const struct sdhci_ops sdhci_xenon_ops = {
 	.voltage_switch		= xenon_voltage_switch,
 	.set_clock		= sdhci_set_clock,
-	.set_power		= xenon_set_power,
 	.set_bus_width		= sdhci_set_bus_width,
 	.reset			= xenon_reset,
 	.set_uhs_signaling	= xenon_set_uhs_signaling,
@@ -252,6 +233,7 @@ static const struct sdhci_pltfm_data sdhci_xenon_pdata = {
 	.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
 		  SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+	.quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE,
 };
 
 /*
-- 
2.25.1


  parent reply	other threads:[~2020-03-06 10:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 10:38 [PATCH 00/10] Raspberry Pi vmmc regulator support Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 01/10] mmc: sdhci: Add quirk SDHCI_QUIRK2_SET_BUS_VOLTAGE Nicolas Saenz Julienne
2020-03-06 12:34   ` Adrian Hunter
2020-03-06 12:40     ` Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 02/10] mmc: sdhci: milbeaut: Use quirk instead of custom set_power() Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 03/10] mmc: sdhci: arsan: " Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 04/10] mmc: sdhci: at-91: " Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 05/10] mmc: sdhci: pxav3: " Nicolas Saenz Julienne
2020-03-06 10:38 ` Nicolas Saenz Julienne [this message]
2020-03-06 10:38 ` [PATCH 07/10] mmc: sdhci: am654: " Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 08/10] mmc: sdhci: Unexport sdhci_set_power_noreg() Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 09/10] mmc: sdhci: iproc: Use SDHCI_QUIRK2_SET_BUS_VOLTAGE on bcm2711 Nicolas Saenz Julienne
2020-03-06 10:38 ` [PATCH 10/10] ARM: dts: bcm2711: Add vmmc regulator in emmc2 Nicolas Saenz Julienne
2020-03-06 11:07   ` Stefan Wahren
2020-03-06 11:35     ` Phil Elwell
2020-03-06 11:37       ` Nicolas Saenz Julienne
2020-03-06 10:46 ` [PATCH 00/10] Raspberry Pi vmmc regulator support Phil Elwell
2020-03-06 10:52   ` Nicolas Saenz Julienne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306103857.23962-7-nsaenzjulienne@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=adrian.hunter@intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=huziji@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=phil@raspberrypi.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).