mac80211: brcmfmac: backport remaining changes from 4.16
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 316-v4.16-0002-brcmfmac-add-comment-block-in-brcmf_sdio_buscore_rea.patch
1 From 32adbcaa5df49f1977441f7a4bf180a0bcfe9966 Mon Sep 17 00:00:00 2001
2 From: Arend Van Spriel <arend.vanspriel@broadcom.com>
3 Date: Tue, 9 Jan 2018 13:22:53 +0100
4 Subject: [PATCH] brcmfmac: add comment block in brcmf_sdio_buscore_read()
5
6 In brcmf_sdio_buscore_read() there is some special handling upon
7 register access to chipid register of the chipcommon core. Add
8 comment explaining why it is done here.
9
10 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
11 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
12 ---
13 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++++++
14 1 file changed, 7 insertions(+)
15
16 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
17 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
18 @@ -3772,6 +3772,13 @@ static u32 brcmf_sdio_buscore_read32(voi
19
20 val = brcmf_sdiod_readl(sdiodev, addr, NULL);
21
22 + /*
23 + * this is a bit of special handling if reading the chipcommon chipid
24 + * register. The 4339 is a next-gen of the 4335. It uses the same
25 + * SDIO device id as 4335 and the chipid register returns 4335 as well.
26 + * It can be identified as 4339 by looking at the chip revision. It
27 + * is corrected here so the chip.c module has the right info.
28 + */
29 if (addr == CORE_CC_REG(SI_ENUM_BASE, chipid) &&
30 (sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4339 ||
31 sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) {