MLK-10629-2 mmc: sdhci-esdhc-imx: implement wifi_card_detect function
authorDong Aisheng <b29396@freescale.com>
Thu, 9 Apr 2015 08:16:09 +0000 (16:16 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:49 +0000 (14:48 -0500)
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

Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
drivers/mmc/host/sdhci-esdhc-imx.c

index 3e29050..04667b9 100644 (file)
@@ -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:
 
index 4380b68..a773d04 100644 (file)
 /* 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