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

Commit e3b17cf0 authored by Guoping Yu's avatar Guoping Yu Committed by Xiaonian Wang
Browse files

mmc: sdhci: add support nonhotplug



With some devices, SD card could not support hotplug as there is
no cd-gpio, and also could not use polling way due to power
comsumption. So add nonhotplug to meet such requirement and when
SD card lost or removed manually, device will not crash until
next reboot process to detect SD card.

Change-Id: Ie8ea8ec57015f36689a119249003eeaa48391393
Signed-off-by: default avatarGuoping Yu <guopingy@codeaurora.org>
[subhashj@codeaurora.org: fixed minor merge conflict]
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fix trivial merge conflict]
Signed-off-by: default avatarXiaonian Wang <xiaonian@codeaurora.org>
parent 890bdeed
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3700,7 +3700,8 @@ int sdhci_setup_host(struct sdhci_host *host)

	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
	    mmc_card_is_removable(mmc) &&
	    mmc_gpio_get_cd(host->mmc) < 0)
	    mmc_gpio_get_cd(host->mmc) < 0 &&
	    !(mmc->caps2 & MMC_CAP2_NONHOTPLUG))
		mmc->caps |= MMC_CAP_NEEDS_POLL;

	/* If vqmmc regulator and no 1.8V signalling, then there's no UHS */
+1 −0
Original line number Diff line number Diff line
@@ -330,6 +330,7 @@ struct mmc_host {
#define MMC_CAP2_PACKED_WR_CONTROL (1 << 23)	/* Allow write packing control */
#define MMC_CAP2_CLK_SCALE	(1 << 24)	/* Allow dynamic clk scaling */
#define MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE (1 << 25)	/* Allows Asynchronous SDIO irq while card is in 4-bit mode */
#define MMC_CAP2_NONHOTPLUG	(1 << 26)	/*Don't support hotplug*/

	mmc_pm_flag_t		pm_caps;	/* supported pm features */