Skip to content

Commit 568ba38

Browse files
jwrdegoedelinvjw
authored andcommitted
brcmfmac: Fix OOB interrupt not working for BCM43362
It has taken me a long long time to get the OOB interrupt working on the AP6210 sdio wifi/bt module found on various Allwinner A20 boards. In the end I found these magic register pokes in the cubietruck kernel tree: https://github.com/cubieboard2/linux-sunxi/commit/7f08ba395617d17e7a711507503d89a50406fe7a This is also done for the bcm43362 in broadcom's internal/proprietary driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> [arend@broadcom.com: rebased changing BCM43362 chip id to fix compilation] Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent cf9ae8f commit 568ba38

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • drivers/net/wireless/brcm80211/brcmfmac

‎drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#include <brcm_hw_ids.h>
3939
#include <brcmu_utils.h>
4040
#include <brcmu_wifi.h>
41+
#include <chipcommon.h>
4142
#include <soc.h>
43+
#include "chip.h"
4244
#include "dhd_bus.h"
4345
#include "dhd_dbg.h"
4446
#include "sdio_host.h"
@@ -118,6 +120,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
118120
{
119121
int ret = 0;
120122
u8 data;
123+
u32 addr, gpiocontrol;
121124
unsigned long flags;
122125

123126
if ((sdiodev->pdata) && (sdiodev->pdata->oob_irq_supported)) {
@@ -147,6 +150,19 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
147150

148151
sdio_claim_host(sdiodev->func[1]);
149152

153+
if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) {
154+
/* assign GPIO to SDIO core */
155+
addr = CORE_CC_REG(SI_ENUM_BASE, gpiocontrol);
156+
gpiocontrol = brcmf_sdiod_regrl(sdiodev, addr, &ret);
157+
gpiocontrol |= 0x2;
158+
brcmf_sdiod_regwl(sdiodev, addr, gpiocontrol, &ret);
159+
160+
brcmf_sdiod_regwb(sdiodev, SBSDIO_GPIO_SELECT, 0xf,
161+
&ret);
162+
brcmf_sdiod_regwb(sdiodev, SBSDIO_GPIO_OUT, 0, &ret);
163+
brcmf_sdiod_regwb(sdiodev, SBSDIO_GPIO_EN, 0x2, &ret);
164+
}
165+
150166
/* must configure SDIO_CCCR_IENx to enable irq */
151167
data = brcmf_sdiod_regrb(sdiodev, SDIO_CCCR_IENx, &ret);
152168
data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1;

0 commit comments

Comments
 (0)