Skip to content

Commit ee22fc6

Browse files
xiaoyao888888Caesar-github
authored andcommitted
net: wireless: bcmdhd: fix some issues for driver "1.579.77.41.9 (r)"
1. disable tuning during sdio sleep 2. add get_oob_irq_flags interface for request_irq(flags) Change-Id: Ic77fd82fc3f93a813512ecceaed2c75fe204b750 Signed-off-by: Yao Xiao <[email protected]>
1 parent db153c1 commit ee22fc6

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_gpio.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ int dhd_wlan_init_gpio(void)
241241
#ifdef CUSTOMER_OOB
242242
int host_oob_irq = -1;
243243
uint host_oob_irq_flags = 0;
244+
int irq_flags = -1;
244245
#endif
245246

246247
/* Please check your schematic and fill right GPIO number which connected to
@@ -286,11 +287,14 @@ int dhd_wlan_init_gpio(void)
286287
host_oob_irq = rockchip_wifi_get_oob_irq();
287288

288289
#ifdef HW_OOB
289-
#ifdef HW_OOB_LOW_LEVEL
290-
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_SHAREABLE;
291-
#else
292-
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE;
293-
#endif
290+
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE;
291+
irq_flags = rockchip_wifi_get_oob_irq_flag();
292+
if (irq_flags == 1)
293+
host_oob_irq_flags |= IORESOURCE_IRQ_HIGHLEVEL;
294+
else if (irq_flags == 0)
295+
host_oob_irq_flags |= IORESOURCE_IRQ_LOWLEVEL;
296+
else
297+
pr_warn("%s: unknown oob irqflags !\n", __func__);
294298
#else
295299
host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_SHAREABLE;
296300
#endif

drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_sdio.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
#include <dhd_bt_interface.h>
8080
#endif /* BT_OVER_SDIO */
8181

82+
#include <linux/mmc/sdio_func.h>
83+
#include <linux/mmc/host.h>
84+
#include "bcmsdh_sdmmc.h"
85+
8286
bool dhd_mp_halting(dhd_pub_t *dhdp);
8387
extern void bcmsdh_waitfor_iodrain(void *sdh);
8488
extern void bcmsdh_reject_ioreqs(void *sdh, bool reject);
@@ -1038,6 +1042,12 @@ dhdsdio_clk_kso_enab(dhd_bus_t *bus, bool on)
10381042
uint8 wr_val = 0, rd_val, cmp_val, bmask;
10391043
int err = 0;
10401044
int try_cnt = 0;
1045+
struct mmc_host *host;
1046+
struct sdioh_info *sd = (struct sdioh_info *)(bus->sdh->sdioh);
1047+
struct sdio_func *func = sd->func[SDIO_FUNC_0];
1048+
1049+
host = func->card->host;
1050+
mmc_retune_disable(host);
10411051

10421052
KSO_DBG(("%s> op:%s\n", __FUNCTION__, (on ? "KSO_SET" : "KSO_CLR")));
10431053

@@ -1051,6 +1061,7 @@ dhdsdio_clk_kso_enab(dhd_bus_t *bus, bool on)
10511061
* after clearing KSO bit, to avoid polling of KSO bit.
10521062
*/
10531063
if ((!on) && (bus->sih->chip == BCM43012_CHIP_ID)) {
1064+
mmc_retune_enable(host);
10541065
return err;
10551066
}
10561067

@@ -1091,6 +1102,8 @@ dhdsdio_clk_kso_enab(dhd_bus_t *bus, bool on)
10911102
__FUNCTION__, (on ? "KSO_SET" : "KSO_CLR"), try_cnt, rd_val, err));
10921103
}
10931104

1105+
mmc_retune_enable(host);
1106+
10941107
return err;
10951108
}
10961109

0 commit comments

Comments
 (0)