Commit 7d9cfc28 authored by Franky Lin's avatar Franky Lin Committed by John W. Linville
Browse files

brcmfmac: decouple set_sbaddr_window from register write interface



brcmf_sdcard_set_sbaddr_window configures 3 registers on SDIO
function misc bank to change current silicon backplane programming
window. This patch makes it call brcmf_sdioh_request_byte directly
in order to prepare for the write register interface unification.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ce454e88
...@@ -205,19 +205,30 @@ brcmf_sdcard_cfg_write(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr, ...@@ -205,19 +205,30 @@ brcmf_sdcard_cfg_write(struct brcmf_sdio_dev *sdiodev, uint fnc_num, u32 addr,
int int
brcmf_sdcard_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address) brcmf_sdcard_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address)
{ {
int err = 0; int err = 0, i;
brcmf_sdcard_cfg_write(sdiodev, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW, u8 addr[3];
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err); s32 retry;
if (!err)
brcmf_sdcard_cfg_write(sdiodev, SDIO_FUNC_1, addr[0] = (address >> 8) & SBSDIO_SBADDRLOW_MASK;
SBSDIO_FUNC1_SBADDRMID, addr[1] = (address >> 16) & SBSDIO_SBADDRMID_MASK;
(address >> 16) & SBSDIO_SBADDRMID_MASK, addr[2] = (address >> 24) & SBSDIO_SBADDRHIGH_MASK;
&err);
if (!err) for (i = 0; i < 3; i++) {
brcmf_sdcard_cfg_write(sdiodev, SDIO_FUNC_1, retry = 0;
SBSDIO_FUNC1_SBADDRHIGH, do {
(address >> 24) & SBSDIO_SBADDRHIGH_MASK, if (retry)
&err); usleep_range(1000, 2000);
err = brcmf_sdioh_request_byte(sdiodev, SDIOH_WRITE,
SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW + i,
&addr[i]);
} while (err != 0 && retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
if (err) {
brcmf_dbg(ERROR, "failed at addr:0x%0x\n",
SBSDIO_FUNC1_SBADDRLOW + i);
break;
}
}
return err; return err;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment