kernel: update kernel 4.4 to version 4.4.30
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 8048-mmc-sdhci-of-esdhc-add-remove-some-quirks-according-.patch
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
7 commit 6c42cb309fee2e126beed6b96a986dc7d85a033d
8 [context adjustment]
9
10 A previous patch had removed esdhc_of_platform_init() by mistake.
11 static void esdhc_of_platform_init(struct sdhci_host *host)
12 {
13 u32 vvn;
14
15 vvn = in_be32(host->ioaddr + SDHCI_SLOT_INT_STATUS);
16 vvn = (vvn & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
17 if (vvn == VENDOR_V_22)
18 host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
19
20 if (vvn > VENDOR_V_22)
21 host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
22 }
23
24 This patch is used to fix it by add/remove some quirks according to
25 verdor version in probe.
26
27 Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
28 Fixes: f4932cfd22f1 ("mmc: sdhci-of-esdhc: support both BE and LE host controller")
29 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
30 Integrated-by: Zhao Qiang <qiang.zhao@nxp.com>
31 ---
32 drivers/mmc/host/sdhci-of-esdhc.c | 10 ++++++++++
33 1 file changed, 10 insertions(+)
34
35 --- a/drivers/mmc/host/sdhci-of-esdhc.c
36 +++ b/drivers/mmc/host/sdhci-of-esdhc.c
37 @@ -584,6 +584,8 @@ static int sdhci_esdhc_probe(struct plat
38 {
39 struct sdhci_host *host;
40 struct device_node *np;
41 + struct sdhci_pltfm_host *pltfm_host;
42 + struct sdhci_esdhc *esdhc;
43 int ret;
44
45 np = pdev->dev.of_node;
46 @@ -611,6 +613,14 @@ static int sdhci_esdhc_probe(struct plat
47 if (of_device_is_compatible(np, "fsl,ls1021a-esdhc"))
48 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
49
50 + pltfm_host = sdhci_priv(host);
51 + esdhc = pltfm_host->priv;
52 + if (esdhc->vendor_ver == VENDOR_V_22)
53 + host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
54 +
55 + if (esdhc->vendor_ver > VENDOR_V_22)
56 + host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
57 +
58 if (of_device_is_compatible(np, "fsl,p2020-esdhc")) {
59 /*
60 * Freescale messed up with P2020 as it has a non-standard