Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b35de95c authored by Dov Levenglick's avatar Dov Levenglick
Browse files

mmc: host: add detect vops chain



Add call from sdio to host_ops to sdhci_ops
in order to indicate when a sdio card is detected.
This will be used by hosts that require special
handling for card detection.

Change-Id: I65ec6ee464d658cd938d9254a0a748e6137f9223
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent 62eb03b5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -929,6 +929,9 @@ static void mmc_sdio_detect(struct mmc_host *host)
	 */
	err = _mmc_detect_card_removed(host);

	if (host->ops && host->ops->detect)
		host->ops->detect(host, err);

	mmc_release_host(host);

	/*
+9 −0
Original line number Diff line number Diff line
@@ -2581,6 +2581,14 @@ static void sdhci_card_event(struct mmc_host *mmc)
	spin_unlock_irqrestore(&host->lock, flags);
}

static void sdhci_detect(struct mmc_host *mmc, bool detected)
{
	struct sdhci_host *host = mmc_priv(mmc);

	if (host->ops->detect)
		host->ops->detect(host, detected);
}

static const struct mmc_host_ops sdhci_ops = {
	.pre_req	= sdhci_pre_req,
	.post_req	= sdhci_post_req,
@@ -2599,6 +2607,7 @@ static const struct mmc_host_ops sdhci_ops = {
	.disable	= sdhci_disable,
	.notify_load	= sdhci_notify_load,
	.notify_halt	= sdhci_notify_halt,
	.detect		= sdhci_detect,
};

/*****************************************************************************\
+1 −0
Original line number Diff line number Diff line
@@ -329,6 +329,7 @@ struct sdhci_ops {
	int	(*enable_controller_clock)(struct sdhci_host *host);
	void	(*clear_set_dumpregs)(struct sdhci_host *host, bool set);
	void	(*enhanced_strobe_mask)(struct sdhci_host *host, bool set);
	void	(*detect)(struct sdhci_host *host, bool detected);
};

#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
+1 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ struct mmc_host_ops {
	unsigned long (*get_min_frequency)(struct mmc_host *host);
	int	(*notify_load)(struct mmc_host *, enum mmc_load);
	void	(*notify_halt)(struct mmc_host *mmc, bool halt);
	void	(*detect)(struct mmc_host *host, bool detected);
};

struct mmc_card;