Skip to contentSkip to conversation

mmc: core: add post-mmc_attach_sd hook

RFC PATCH In review Ben Chuang 1 participant 1 message Jul 10, 2020 MMC, SD and SDIO

lore
Share & tools
lore

Ben Chuang

author
#0 lore raw

RFC PATCH v3 19/21 mmc: core: add post-mmc_attach_sd hook

From: AKASHI Takahiro <[email protected]>

This "post" hook for mmc_attach_sd() will be required to enable UHS-II support, at least, on GL9755.

---
 drivers/mmc/core/sd.c    | 6 ++++++
 include/linux/mmc/host.h | 1 +
 2 files changed, 7 insertions(+)
drivers/mmc/core/sd.c +6 -0
index c5b071bd98b3..fd4cae4ed747 100644
@@ -1381,6 +1381,12 @@ int mmc_attach_sd(struct mmc_host *host)
 		goto remove_card;
 
 	mmc_claim_host(host);
+
+	/* TODO: Is this the right place? */
+	if ((host->flags & MMC_UHS2_INITIALIZED) &&
+	    host->ops->uhs2_post_attach_sd)
+		host->ops->uhs2_post_attach_sd(host);
+
 	return 0;
 
 remove_card:
include/linux/mmc/host.h +1 -0
index 56bdb153ef16..e61e0ae62cff 100644
@@ -180,6 +180,7 @@ struct mmc_host_ops {
 	int	(*uhs2_set_reg)(struct mmc_host *host, enum uhs2_act act);
 	void    (*uhs2_disable_clk)(struct mmc_host *host);
 	void    (*uhs2_enable_clk)(struct mmc_host *host);
+	void    (*uhs2_post_attach_sd)(struct mmc_host *host);
 };
 
 struct mmc_cqe_ops {
Signature · 1 line
2.27.0