From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org, Sascha Hauer <s.hauer@pengutronix.de>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH 4/5] mci: sdhci: add set_uhs_signaling callback
Date: Mon, 15 Dec 2025 15:21:26 +0100 [thread overview]
Message-ID: <20251215-v2025-11-0-topic-socfpga-agilex5-sdhci-v1-4-11eea1b2ef41@pengutronix.de> (raw)
In-Reply-To: <20251215-v2025-11-0-topic-socfpga-agilex5-sdhci-v1-0-11eea1b2ef41@pengutronix.de>
Allow adding a set_uhs_signaling callback in a host driver.
If the callback is not provided, just call the generic
sdhci_set_uhs_signaling function as before.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
drivers/mci/sdhci.c | 7 +++++--
drivers/mci/sdhci.h | 1 +
include/mci.h | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index cfdfdbba8d..e24575d541 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -473,7 +473,7 @@ void sdhci_set_bus_width(struct sdhci *host, int width)
sdhci_write8(host, SDHCI_HOST_CONTROL, ctrl);
}
-static void sdhci_set_uhs_signaling(struct sdhci *host, unsigned timing)
+void sdhci_set_uhs_signaling(struct sdhci *host, unsigned timing)
{
u16 ctrl_2;
@@ -999,7 +999,10 @@ void sdhci_set_clock(struct sdhci *host, unsigned int clock, unsigned int input_
host->mci->ios.clock = 0;
- sdhci_set_uhs_signaling(host, host->mci->ios.timing);
+ if (host->mci->ops.set_uhs_signaling)
+ host->mci->ops.set_uhs_signaling(host->mci, host->mci->ios.timing);
+ else
+ sdhci_set_uhs_signaling(host, host->mci->ios.timing);
sdhci_wait_idle_data(host, NULL);
diff --git a/drivers/mci/sdhci.h b/drivers/mci/sdhci.h
index 6b3849e5f7..9c70eae111 100644
--- a/drivers/mci/sdhci.h
+++ b/drivers/mci/sdhci.h
@@ -344,6 +344,7 @@ static inline void sdhci_write8(struct sdhci *host, int reg, u32 val)
}
#define SDHCI_NO_DMA DMA_ERROR_CODE
+void sdhci_set_uhs_signaling(struct sdhci *host, unsigned timing);
int sdhci_execute_tuning(struct sdhci *sdhci, u32 opcode);
int sdhci_wait_idle_data(struct sdhci *host, struct mci_cmd *cmd);
int sdhci_wait_idle(struct sdhci *host, struct mci_cmd *cmd, struct mci_data *data);
diff --git a/include/mci.h b/include/mci.h
index e54f6eba8d..c4faf11054 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -583,6 +583,7 @@ struct mci_ops {
int (*card_write_protected)(struct mci_host *);
/* The tuning command opcode value is different for SD and eMMC cards */
int (*execute_tuning)(struct mci_host *, u32);
+ void (*set_uhs_signaling)(struct mci_host *, unsigned int);
};
/** host information */
--
2.51.0
next prev parent reply other threads:[~2025-12-15 14:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 14:21 [PATCH 0/5] mci: cadence: add v6 support Steffen Trumtrar
2025-12-15 14:21 ` [PATCH 1/5] mci: cadence: fix typo and actually build Steffen Trumtrar
2025-12-15 14:26 ` Ahmad Fatoum
2025-12-15 14:21 ` [PATCH 2/5] dts: include: reset: rst-mgr-s10: add SOFTPYH_RESET Steffen Trumtrar
2025-12-15 14:25 ` Ahmad Fatoum
2025-12-16 6:46 ` Steffen Trumtrar
2025-12-15 14:21 ` [PATCH 3/5] mci: sdhci: add sdhci_send_cmd Steffen Trumtrar
2025-12-16 7:27 ` Sascha Hauer
2025-12-15 14:21 ` Steffen Trumtrar [this message]
2025-12-15 14:21 ` [PATCH 5/5] mci: cadence: add support for version 6 Steffen Trumtrar
2025-12-16 7:38 ` 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=20251215-v2025-11-0-topic-socfpga-agilex5-sdhci-v1-4-11eea1b2ef41@pengutronix.de \
--to=s.trumtrar@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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