From: Dong Aisheng Date: Thu, 9 Apr 2015 08:16:09 +0000 (+0800) Subject: MLK-10629-2 mmc: sdhci-esdhc-imx: implement wifi_card_detect function X-Git-Tag: C0P2-H0.0--20200415~4199 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=60cf903096b2bd90d27c0e20e0f294c8f96297ab;p=linux.git 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 (cherry picked from commit 74e71dd0aebb9e931f02aefa3dd1990cbe642ae4) Signed-off-by: Haibo Chen Conflicts: Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt --- 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