summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2015-04-09 16:16:09 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:20:42 +0300
commit1f42190a109ad1cd2377b4cc93d70009d23797eb (patch)
treefdc208d3775b83cda2941db382639ef69d4ac492
parentf0a4da547b9fc7fc97e77fffc5bd92869f518e3d (diff)
MLK-10629-2 mmc: sdhci-esdhc-imx: implement wifi_card_detect function
WiFi driver could call wifi_card_detect function to re-detect card, this is required by some special WiFi cards like broadcom WiFi. To use this function, a new property is introduced to indicate a wifi host. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit 74e71dd0aebb9e931f02aefa3dd1990cbe642ae4) Signed-off-by: Haibo Chen <haibo.chen@freescale.com> Conflicts: Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
-rw-r--r--Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt2
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 3e29050ec769..04667b961c75 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -35,6 +35,8 @@ Optional properties:
This property allows user to change the tuning step to more than one delay
cells which is useful for some special boards or cards when the default
tuning step can't find the proper delay window within limited tuning retries.
+- wifi-host : assigned as a wifi host.
+ This is required for some WiFi cards to do card detect
Examples:
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 4380b68cc25f..a773d04e1198 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -144,6 +144,14 @@
/* A higher clock ferquency than this rate requires strobell dll control */
#define ESDHC_STROBE_DLL_CLK_FREQ 100000000
+static struct mmc_host *wifi_mmc_host;
+void wifi_card_detect(void)
+{
+ WARN_ON(!wifi_mmc_host);
+ mmc_detect_change(wifi_mmc_host, 0);
+}
+EXPORT_SYMBOL(wifi_card_detect);
+
struct esdhc_soc_data {
u32 flags;
};
@@ -1113,6 +1121,11 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
if (mmc_gpio_get_cd(host->mmc) >= 0)
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ if (of_get_property(np, "wifi-host", NULL)) {
+ wifi_mmc_host = host->mmc;
+ dev_info(mmc_dev(host->mmc), "assigned as wifi host\n");
+ }
+
return 0;
}
#else