diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2018-03-01 18:00:19 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2018-03-01 18:07:09 +0100 |
commit | bb04b7ced7047c93e907134ede6b74b0cf438aa0 (patch) | |
tree | ce279ce861c03edd7f6496402dd3778bc5ae09d4 /package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch | |
parent | e52e8480add7607fe9643111d34ac3efdecad29a (diff) | |
download | mtk-20170518-bb04b7ced7047c93e907134ede6b74b0cf438aa0.zip mtk-20170518-bb04b7ced7047c93e907134ede6b74b0cf438aa0.tar.gz mtk-20170518-bb04b7ced7047c93e907134ede6b74b0cf438aa0.tar.bz2 |
mac80211: brcmfmac: restructuring sdio access functions
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch')
-rw-r--r-- | package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch b/package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch new file mode 100644 index 0000000..1f0488a --- /dev/null +++ b/package/kernel/mac80211/patches/311-v4.16-0004-brcmfmac-Clean-up-brcmf_sdiod_set_sbaddr_window.patch @@ -0,0 +1,62 @@ +From b9b0d290bc0c90a5a262bc89c9d995988ea98669 Mon Sep 17 00:00:00 2001 +From: Ian Molton <ian@mnementh.co.uk> +Date: Mon, 13 Nov 2017 21:35:41 +0100 +Subject: [PATCH] brcmfmac: Clean up brcmf_sdiod_set_sbaddr_window() + +This function sets the address of the IO window used for +SDIO accesses onto the backplane of the chip. + +It currently uses 3 separate masks despite the full mask being +defined in the code already. Remove the separate masks and clean up. + +Signed-off-by: Ian Molton <ian@mnementh.co.uk> +Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 17 +++++------------ + drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 3 --- + 2 files changed, 5 insertions(+), 15 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +@@ -410,23 +410,16 @@ static int + brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address) + { + int err = 0, i; +- u8 addr[3]; ++ u32 addr; + + if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM) + return -ENOMEDIUM; + +- addr[0] = (address >> 8) & SBSDIO_SBADDRLOW_MASK; +- addr[1] = (address >> 16) & SBSDIO_SBADDRMID_MASK; +- addr[2] = (address >> 24) & SBSDIO_SBADDRHIGH_MASK; ++ addr = (address & SBSDIO_SBWINDOW_MASK) >> 8; + +- for (i = 0; i < 3; i++) { +- brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i, addr[i], +- &err); +- if (err) { +- brcmf_err("failed at addr: 0x%0x\n", +- SBSDIO_FUNC1_SBADDRLOW + i); +- } +- } ++ for (i = 0 ; i < 3 && !err ; i++, addr >>= 8) ++ brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_SBADDRLOW + i, ++ addr & 0xff, &err); + + return err; + } +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +@@ -133,9 +133,6 @@ + + /* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */ + +-#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */ +-#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */ +-#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */ + /* Address bits from SBADDR regs */ + #define SBSDIO_SBWINDOW_MASK 0xffff8000 + |