86b269a34866dbe57b6783c689e9126d275a1963
[openwrt/staging/dedeckeh.git] /
1 From 508422f3695bf66f7b85fb4723c22f5166003ec6 Mon Sep 17 00:00:00 2001
2 From: Ian Molton <ian@mnementh.co.uk>
3 Date: Tue, 19 Dec 2017 13:47:10 +0100
4 Subject: [PATCH] brcmfmac: Correctly handle accesses to SDIO func0
5
6 Rather than workaround the restrictions on func0 addressing in the
7 driver, set MMC_QUIRK_LENIENT_FN0
8
9 Signed-off-by: Ian Molton <ian@mnementh.co.uk>
10 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
11 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
12 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
13 ---
14 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 ++++
15 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 4 ++--
16 2 files changed, 6 insertions(+), 2 deletions(-)
17
18 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
19 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
20 @@ -995,6 +995,10 @@ static int brcmf_ops_sdio_probe(struct s
21 brcmf_dbg(SDIO, "Function#: %d\n", func->num);
22
23 dev = &func->dev;
24 +
25 + /* Set MMC_QUIRK_LENIENT_FN0 for this card */
26 + func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
27 +
28 /* prohibit ACPI power management for this device */
29 brcmf_sdiod_acpi_set_power_manageable(dev, 0);
30
31 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
32 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
33 @@ -297,10 +297,10 @@ void brcmf_sdiod_intr_unregister(struct
34 /* SDIO device register access interface */
35 /* Accessors for SDIO Function 0 */
36 #define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
37 - sdio_readb((sdiodev)->func[0], (addr), (r))
38 + sdio_f0_readb((sdiodev)->func[0], (addr), (r))
39
40 #define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \
41 - sdio_writeb((sdiodev)->func[0], (v), (addr), (ret))
42 + sdio_f0_writeb((sdiodev)->func[0], (v), (addr), (ret))
43
44 /* Accessors for SDIO Function 1 */
45 #define brcmf_sdiod_readb(sdiodev, addr, r) \