diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-07-29 08:23:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-07-29 10:32:57 -0400 |
commit | 568ba389be505f505b7fbeedb9ab4ece27603fc9 (patch) | |
tree | 0144b1c11a9a4e22dd7ff2582ce03a384b6f3f4e | |
parent | cf9ae8fa0110546c928836957bc54d42fea7828b (diff) |
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>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c index dc2db47a1c73..8dbd5dbb78fd 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | |||
@@ -38,7 +38,9 @@ | |||
38 | #include <brcm_hw_ids.h> | 38 | #include <brcm_hw_ids.h> |
39 | #include <brcmu_utils.h> | 39 | #include <brcmu_utils.h> |
40 | #include <brcmu_wifi.h> | 40 | #include <brcmu_wifi.h> |
41 | #include <chipcommon.h> | ||
41 | #include <soc.h> | 42 | #include <soc.h> |
43 | #include "chip.h" | ||
42 | #include "dhd_bus.h" | 44 | #include "dhd_bus.h" |
43 | #include "dhd_dbg.h" | 45 | #include "dhd_dbg.h" |
44 | #include "sdio_host.h" | 46 | #include "sdio_host.h" |
@@ -118,6 +120,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) | |||
118 | { | 120 | { |
119 | int ret = 0; | 121 | int ret = 0; |
120 | u8 data; | 122 | u8 data; |
123 | u32 addr, gpiocontrol; | ||
121 | unsigned long flags; | 124 | unsigned long flags; |
122 | 125 | ||
123 | if ((sdiodev->pdata) && (sdiodev->pdata->oob_irq_supported)) { | 126 | if ((sdiodev->pdata) && (sdiodev->pdata->oob_irq_supported)) { |
@@ -147,6 +150,19 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) | |||
147 | 150 | ||
148 | sdio_claim_host(sdiodev->func[1]); | 151 | sdio_claim_host(sdiodev->func[1]); |
149 | 152 | ||
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 | |||
150 | /* must configure SDIO_CCCR_IENx to enable irq */ | 166 | /* must configure SDIO_CCCR_IENx to enable irq */ |
151 | data = brcmf_sdiod_regrb(sdiodev, SDIO_CCCR_IENx, &ret); | 167 | data = brcmf_sdiod_regrb(sdiodev, SDIO_CCCR_IENx, &ret); |
152 | data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1; | 168 | data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1; |