From a4d77289532a5dd7c0d638dc20f69ea73f98f2cf Mon Sep 17 00:00:00 2001 From: Veerabhadrarao Badiganti Date: Wed, 6 Jun 2018 19:54:17 +0530 Subject: mmc: core: Update SD card removal logic based on cd gpio state Update SD card removal event processing logic. Instead of pinging the card to know the card presence rely on card-detect gpio state. On multi-card tray designs, the same card-tray would be used for SD card and SIM cards. If SD card is placed at the rightmost location in the tray, then SIM card may come in contact with SD card power- supply while removing the tray. It may result in SIM damage. For protecting SIM from this issue, in multi-card tray designs, a h/w fix done such that pmic gets a notification of SD card removal event (through hardwiring) and it turns off the SD card voltage regulators immediately. All this will be done much before SD card driver starts processing card removal event. To support this design, SD card driver shouldn't turn-on the regulator while processing card removal event. But the present mmc driver turns-on regulator (multiple times if the card was in suspend state). To avoid turning on SD card regulator in card removal path, updating the card removal processing logic is based on card detect gpio state. Change-Id: I13708a60c9378519713ebec8071ae3b130012a93 Signed-off-by: Veerabhadrarao Badiganti --- include/linux/mmc/host.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index f564303a28f9..9b1870897b02 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -642,6 +642,7 @@ static inline void *mmc_cmdq_private(struct mmc_host *host) #define mmc_bus_manual_resume(host) ((host)->bus_resume_flags & \ MMC_BUSRESUME_MANUAL_RESUME) +#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) { if (manual) @@ -649,6 +650,11 @@ static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) else host->bus_resume_flags &= ~MMC_BUSRESUME_MANUAL_RESUME; } +#else +static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) +{ +} +#endif extern int mmc_resume_bus(struct mmc_host *host); -- cgit v1.2.3