8048-mmc-sdhci-of-esdhc-add-remove-some-quirks-according-.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From dfc4661c2499aeb0a43b8a13b55213d1c190f640 Mon Sep 17 00:00:00 2001
  2. From: yangbo lu <yangbo.lu@freescale.com>
  3. Date: Tue, 19 Apr 2016 09:47:15 +0800
  4. Subject: [PATCH 48/70] mmc: sdhci-of-esdhc: add/remove some quirks according
  5. to vendor version
  6. commit 6c42cb309fee2e126beed6b96a986dc7d85a033d
  7. [context adjustment]
  8. A previous patch had removed esdhc_of_platform_init() by mistake.
  9. static void esdhc_of_platform_init(struct sdhci_host *host)
  10. {
  11. u32 vvn;
  12. vvn = in_be32(host->ioaddr + SDHCI_SLOT_INT_STATUS);
  13. vvn = (vvn & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
  14. if (vvn == VENDOR_V_22)
  15. host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
  16. if (vvn > VENDOR_V_22)
  17. host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
  18. }
  19. This patch is used to fix it by add/remove some quirks according to
  20. verdor version in probe.
  21. Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
  22. Fixes: f4932cfd22f1 ("mmc: sdhci-of-esdhc: support both BE and LE host controller")
  23. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  24. Integrated-by: Zhao Qiang <qiang.zhao@nxp.com>
  25. ---
  26. drivers/mmc/host/sdhci-of-esdhc.c | 10 ++++++++++
  27. 1 file changed, 10 insertions(+)
  28. --- a/drivers/mmc/host/sdhci-of-esdhc.c
  29. +++ b/drivers/mmc/host/sdhci-of-esdhc.c
  30. @@ -640,6 +640,14 @@ static int sdhci_esdhc_probe(struct plat
  31. if (of_device_is_compatible(np, "fsl,ls1021a-esdhc"))
  32. host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
  33. + pltfm_host = sdhci_priv(host);
  34. + esdhc = pltfm_host->priv;
  35. + if (esdhc->vendor_ver == VENDOR_V_22)
  36. + host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
  37. +
  38. + if (esdhc->vendor_ver > VENDOR_V_22)
  39. + host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
  40. +
  41. if (of_device_is_compatible(np, "fsl,p2020-esdhc")) {
  42. /*
  43. * Freescale messed up with P2020 as it has a non-standard