mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2
commit 53dd0a7cd65edc83b0c243d1c08377c8b876b2ee upstream.
SAMA5D2x doesn't drive CMD line if GPIO is used as CD line (at least
SAMA5D27 doesn't). Fix this by forcing card-detect in the module
if module-controlled CD is not used.
Fixed commit addresses the problem only for non-removable cards. This
amends it to also cover gpio-cd case.
Cc: [email protected]
Fixes: 7a1e3f1431 ("mmc: sdhci-of-at91: force card detect value for non removable devices")
Signed-off-by: Michał Mirosław <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Link: https://lore.kernel.org/r/8d10950d9940468577daef4772b82a071b204716.1584290561.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
0c4e0f0d2e
commit
8aafd5a0c6
1 changed files with 6 additions and 2 deletions
|
|
@ -118,7 +118,8 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask)
|
|||
{
|
||||
sdhci_reset(host, mask);
|
||||
|
||||
if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
|
||||
if ((host->mmc->caps & MMC_CAP_NONREMOVABLE)
|
||||
|| mmc_gpio_get_cd(host->mmc) >= 0)
|
||||
sdhci_at91_set_force_card_detect(host);
|
||||
}
|
||||
|
||||
|
|
@ -397,8 +398,11 @@ static int sdhci_at91_probe(struct platform_device *pdev)
|
|||
* detection procedure using the SDMCC_CD signal is bypassed.
|
||||
* This bit is reset when a software reset for all command is performed
|
||||
* so we need to implement our own reset function to set back this bit.
|
||||
*
|
||||
* WA: SAMA5D2 doesn't drive CMD if using CD GPIO line.
|
||||
*/
|
||||
if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
|
||||
if ((host->mmc->caps & MMC_CAP_NONREMOVABLE)
|
||||
|| mmc_gpio_get_cd(host->mmc) >= 0)
|
||||
sdhci_at91_set_force_card_detect(host);
|
||||
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue