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

Commit 8546510f authored by Sarthak Garg's avatar Sarthak Garg Committed by Gerrit - the friendly Code Review server
Browse files

mmc: sdhci-msm: Reset SDIO cards during probe by toggling wlan_en pin



Wlan cards are powered by external supply so mmc_power_cycle won't
reset the card.
The only way to reset the wlan cards is by toggling wlan_en pin.
Moreover pinctrl sleep configuration don't get applied during reboot
by default leading to wlan cards in some unknown state post reboot.

Toggle wlan_en pin during probe to reset the card to proper state.

Change-Id: I3065a9d3bf6cddd9f34adb51dd20932df4125f86
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
parent e1807351
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/reset.h>
#include <linux/pinctrl/consumer.h>

#include "sdhci-pltfm.h"
#include "cqhci.h"
@@ -4379,6 +4380,13 @@ static int sdhci_msm_probe(struct platform_device *pdev)
		}
	}

	/* Toggle wlan_en pin to reset SDIO card to correct state */
	if (host->mmc->pm_caps & MMC_PM_KEEP_POWER) {
		pinctrl_pm_select_sleep_state(&pdev->dev);
		mdelay(1);
		pinctrl_pm_select_default_state(&pdev->dev);
	}

	/* Reset the vendor spec register to power on reset state */
	writel_relaxed(CORE_VENDOR_SPEC_POR_VAL,
			host->ioaddr + msm_offset->core_vendor_spec);