]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
2a1fbd5d782fa3fa397edea683b909ff4f9051cc
[thirdparty/kernel/stable-queue.git] /
1 From f6498b922e57aecbe3b7fa30a308d9d586c0c369 Mon Sep 17 00:00:00 2001
2 From: "H. Nikolaus Schaller" <hns@goldelico.com>
3 Date: Thu, 7 Nov 2019 11:30:37 +0100
4 Subject: mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid of pandora_wl1251_init_card
5
6 From: H. Nikolaus Schaller <hns@goldelico.com>
7
8 commit f6498b922e57aecbe3b7fa30a308d9d586c0c369 upstream.
9
10 Pandora_wl1251_init_card was used to do special pdata based
11 setup of the sdio mmc interface. This does no longer work with
12 v4.7 and later. A fix requires a device tree based mmc3 setup.
13
14 Therefore we move the special setup to omap_hsmmc.c instead
15 of calling some pdata supplied init_card function.
16
17 The new code checks for a DT child node compatible to wl1251
18 so it will not affect other MMC3 use cases.
19
20 Generally, this code was and still is a hack and should be
21 moved to mmc core to e.g. read such properties from optional
22 DT child nodes.
23
24 Fixes: 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")
25 Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
26 Cc: <stable@vger.kernel.org> # v4.7+
27 [Ulf: Fixed up some checkpatch complaints]
28 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
29 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30
31 ---
32 drivers/mmc/host/omap_hsmmc.c | 30 ++++++++++++++++++++++++++++++
33 1 file changed, 30 insertions(+)
34
35 --- a/drivers/mmc/host/omap_hsmmc.c
36 +++ b/drivers/mmc/host/omap_hsmmc.c
37 @@ -1700,6 +1700,36 @@ static void omap_hsmmc_init_card(struct
38
39 if (mmc_pdata(host)->init_card)
40 mmc_pdata(host)->init_card(card);
41 + else if (card->type == MMC_TYPE_SDIO ||
42 + card->type == MMC_TYPE_SD_COMBO) {
43 + struct device_node *np = mmc_dev(mmc)->of_node;
44 +
45 + /*
46 + * REVISIT: should be moved to sdio core and made more
47 + * general e.g. by expanding the DT bindings of child nodes
48 + * to provide a mechanism to provide this information:
49 + * Documentation/devicetree/bindings/mmc/mmc-card.txt
50 + */
51 +
52 + np = of_get_compatible_child(np, "ti,wl1251");
53 + if (np) {
54 + /*
55 + * We have TI wl1251 attached to MMC3. Pass this
56 + * information to the SDIO core because it can't be
57 + * probed by normal methods.
58 + */
59 +
60 + dev_info(host->dev, "found wl1251\n");
61 + card->quirks |= MMC_QUIRK_NONSTD_SDIO;
62 + card->cccr.wide_bus = 1;
63 + card->cis.vendor = 0x104c;
64 + card->cis.device = 0x9066;
65 + card->cis.blksize = 512;
66 + card->cis.max_dtr = 24000000;
67 + card->ocr = 0x80;
68 + of_node_put(np);
69 + }
70 + }
71 }
72
73 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)