mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 07/30] mci: rename MMC_CAP_MMC_x_yV_DDR to MMC_CAP_x_yV_DDR as in Linux
Date: Wed,  7 May 2025 10:21:46 +0200	[thread overview]
Message-ID: <20250507082209.3289972-8-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250507082209.3289972-1-a.fatoum@pengutronix.de>

Linux names these parameters without listing MMC twice in the macro.
Follow suit in barebox to make porting a tiny bit easier.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/imx-esdhc.c    |  2 +-
 drivers/mci/mci-core.c     | 10 +++++-----
 drivers/mci/stm32_sdmmc2.c |  4 ++--
 include/mci.h              | 10 +++++-----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index ebc7ed539da9..923dae9cf3b0 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -324,7 +324,7 @@ static int fsl_esdhc_probe(struct device *dev)
 		goto err_clk_disable;
 
 	if (esdhc_is_usdhc(host) || esdhc_is_layerscape(host))
-		mci->host_caps |= MMC_CAP_MMC_3_3V_DDR | MMC_CAP_MMC_1_8V_DDR;
+		mci->host_caps |= MMC_CAP_3_3V_DDR | MMC_CAP_1_8V_DDR;
 
 	rate = clk_get_rate(host->clk);
 	host->mci.f_min = rate >> 12;
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 5a3bb9d1ad13..819a059e6468 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -791,7 +791,7 @@ static int mmc_change_freq(struct mci *mci)
 		mci->card_caps |= MMC_CAP_MMC_HIGHSPEED_52MHZ;
 
 		if (cardtype & EXT_CSD_CARD_TYPE_DDR_1_8V)
-			mci->card_caps |= MMC_CAP_MMC_3_3V_DDR | MMC_CAP_MMC_1_8V_DDR;
+			mci->card_caps |= MMC_CAP_3_3V_DDR | MMC_CAP_1_8V_DDR;
 	}
 
 	if (IS_ENABLED(CONFIG_MCI_MMC_BOOT_PARTITIONS) &&
@@ -1563,7 +1563,7 @@ static int mci_mmc_select_hs_ddr(struct mci *mci)
 	 * higher speed modes that require voltage switching like HS200/HS400,
 	 * let's just check for either bit.
 	 */
-	if (!(mci_caps(mci) & (MMC_CAP_MMC_1_8V_DDR | MMC_CAP_MMC_3_3V_DDR)))
+	if (!(mci_caps(mci) & (MMC_CAP_1_8V_DDR | MMC_CAP_3_3V_DDR)))
 		return 0;
 
 	ret = mci_mmc_try_bus_width(mci, host->ios.bus_width, MMC_TIMING_MMC_DDR52);
@@ -2340,9 +2340,9 @@ static void mci_print_caps(unsigned caps)
 		caps & MMC_CAP_SD_HIGHSPEED ? "sd-hs " : "",
 		caps & MMC_CAP_MMC_HIGHSPEED ? "mmc-hs " : "",
 		caps & MMC_CAP_MMC_HIGHSPEED_52MHZ ? "mmc-52MHz " : "",
-		caps & MMC_CAP_MMC_3_3V_DDR ? "ddr-3.3v " : "",
-		caps & MMC_CAP_MMC_1_8V_DDR ? "ddr-1.8v " : "",
-		caps & MMC_CAP_MMC_1_2V_DDR ? "ddr-1.2v " : "");
+		caps & MMC_CAP_3_3V_DDR ? "ddr-3.3v " : "",
+		caps & MMC_CAP_1_8V_DDR ? "ddr-1.8v " : "",
+		caps & MMC_CAP_1_2V_DDR ? "ddr-1.2v " : "");
 }
 
 /*
diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
index b517ab7964e2..8aeda6e988b1 100644
--- a/drivers/mci/stm32_sdmmc2.c
+++ b/drivers/mci/stm32_sdmmc2.c
@@ -637,9 +637,9 @@ static int stm32_sdmmc2_probe(struct amba_device *adev,
 		mci->host_caps |= MMC_CAP_MMC_HIGHSPEED_52MHZ;
 
 	if (of_property_read_bool(np, "mmc-ddr-3_3v"))
-		mci->host_caps |= MMC_CAP_MMC_3_3V_DDR;
+		mci->host_caps |= MMC_CAP_3_3V_DDR;
 	if (of_property_read_bool(np, "mmc-ddr-1_8v"))
-		mci->host_caps |= MMC_CAP_MMC_1_8V_DDR;
+		mci->host_caps |= MMC_CAP_1_8V_DDR;
 
 	return mci_register(&priv->mci);
 
diff --git a/include/mci.h b/include/mci.h
index bb168ca2225f..126d3fe52d37 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -53,11 +53,11 @@
 #define MMC_CAP_SD_HIGHSPEED		(1 << 3)
 #define MMC_CAP_MMC_HIGHSPEED		(1 << 4)
 #define MMC_CAP_MMC_HIGHSPEED_52MHZ	(1 << 5)
-#define MMC_CAP_MMC_3_3V_DDR		(1 << 7)	/* Host supports eMMC DDR 3.3V */
-#define MMC_CAP_MMC_1_8V_DDR		(1 << 8)	/* Host supports eMMC DDR 1.8V */
-#define MMC_CAP_MMC_1_2V_DDR		(1 << 9)	/* Host supports eMMC DDR 1.2V */
-#define MMC_CAP_DDR			(MMC_CAP_MMC_3_3V_DDR | MMC_CAP_MMC_1_8V_DDR | \
-					 MMC_CAP_MMC_1_2V_DDR)
+#define MMC_CAP_3_3V_DDR		(1 << 7)	/* Host supports eMMC DDR 3.3V */
+#define MMC_CAP_1_8V_DDR		(1 << 8)	/* Host supports eMMC DDR 1.8V */
+#define MMC_CAP_1_2V_DDR		(1 << 9)	/* Host supports eMMC DDR 1.2V */
+#define MMC_CAP_DDR			(MMC_CAP_3_3V_DDR | MMC_CAP_1_8V_DDR | \
+					 MMC_CAP_1_2V_DDR)
 #define MMC_CAP_UHS_SDR12	(1 << 16)	/* Host supports UHS SDR12 mode */
 #define MMC_CAP_UHS_SDR25	(1 << 17)	/* Host supports UHS SDR25 mode */
 #define MMC_CAP_UHS_SDR50	(1 << 18)	/* Host supports UHS SDR50 mode */
-- 
2.39.5




  parent reply	other threads:[~2025-05-07  9:19 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07  8:21 [PATCH v2 00/30] mci: imx-esdhc: add HS200 support Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 01/30] mci: sdhci: fix SDHCI_TRNS_AUTO_CMD12 definition Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 02/30] mci: move most recent I/O settings into mci_host::ios Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 03/30] mci: use struct mci_host::ios inside mci_set_ios Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 04/30] mci: tuning: fix fallback to DDR52 Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 05/30] mci: sdhci: unmap DMA buffers on timeout Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 06/30] mci: add MMC_CAP_UHS constants Ahmad Fatoum
2025-05-07  8:21 ` Ahmad Fatoum [this message]
2025-05-07  8:21 ` [PATCH v2 08/30] mci: compare host and card caps for supported speeds Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 09/30] mci: print HS200 capabilities in devinfo Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 10/30] mci: respect no-1-8-v OF property Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 11/30] mci: sdhci: add support for struct mci_data::timeout_ns Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 12/30] mci: imx-esdhc: use unsigned types where appropriate Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 13/30] mci: imx-esdhc: implement esdhc_poll using sdhci_read32_poll_timeout Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 14/30] mci: imx-esdhc: drop one extra read of SDHCI_INT_STATUS Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 15/30] mci: sdhci: add cmd parameter to sdhci_transfer_* Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 16/30] mci: arasan: introduce mmc_op_tuning helper Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 17/30] mci: imx-esdhc: flesh out register description Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 18/30] mci: imx-esdhc: add support for delay/tuning properties in DT Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 19/30] mci: add mci_set_timing helper Ahmad Fatoum
2025-05-07  8:21 ` [PATCH v2 20/30] mci: imx-esdhc: add support for setting drive strength Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 21/30] mci: sdhci: move SDHCI_MAKE_BLKSZ definition to header Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 22/30] mci: imx-esdhc: select different pinctrl state depending on frequency Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 23/30] mci: core: retry MMC_CMD_SET_BLOCKLEN up to 4 times Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 24/30] mci: imx-esdhc: don't reconfigure clock unless required Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 25/30] mci: sdhci: fix sdhci_transfer_data MMC_SEND_TUNING compatibility Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 26/30] mci: core: implement mmc_send_tuning Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 27/30] mci: imx-esdhc: set burst_length_enable Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 28/30] mci: imx-esdhc: fixup quirks in standard SDHCI registers Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 29/30] mci: sdhci: support Linux SDHCI_QUIRK2_BROKEN_HS200 flag Ahmad Fatoum
2025-05-07  8:22 ` [PATCH v2 30/30] mci: imx-esdhc: implement HS200 support Ahmad Fatoum
2025-05-08  7:30 ` [PATCH v2 00/30] mci: imx-esdhc: add " Sascha Hauer

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=20250507082209.3289972-8-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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