From 8adf9877e4249d3c5dc7654d89f8365c756db3d4 Mon Sep 17 00:00:00 2001 From: Weiguang Ruan Date: Thu, 31 Aug 2017 16:01:09 +0800 Subject: [PATCH] wifi: add pci reinit [5/7] PD# 148564 bcm pci wifi needs to remove pci device and the bus it is on. so we call pci_remove_reinit, a function realize in wifi_dt.c Change-Id: I54de64d81301e9b004da1a9f55556ee161f88f99 --- bcmdhd.1.363.59.144.x.cn/dhd_gpio.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bcmdhd.1.363.59.144.x.cn/dhd_gpio.c b/bcmdhd.1.363.59.144.x.cn/dhd_gpio.c index b371ca8..db3b45d 100644 --- a/bcmdhd.1.363.59.144.x.cn/dhd_gpio.c +++ b/bcmdhd.1.363.59.144.x.cn/dhd_gpio.c @@ -22,6 +22,7 @@ extern int wifi_irq_trigger_level(void); #ifdef CUSTOMER_HW_AMLOGIC extern void sdio_reinit(void); extern void extern_wifi_set_enable(int is_on); +extern void pci_remove_reinit(unsigned int vid, unsigned int pid, int delBus); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) extern int wifi_irq_num(void); #endif @@ -55,12 +56,14 @@ dhd_wlan_set_power(bool on } } #ifdef CUSTOMER_HW_AMLOGIC +#ifdef BCMSDIO extern_wifi_set_enable(0); mdelay(200); extern_wifi_set_enable(1); mdelay(200); // sdio_reinit(); #endif +#endif #if defined(BUS_POWER_RESTORE) #if defined(BCMSDIO) if (adapter->sdio_func && adapter->sdio_func->card && adapter->sdio_func->card->host) { @@ -138,8 +141,6 @@ static int dhd_wlan_set_carddetect(bool present) #ifdef CUSTOMER_HW_AMLOGIC sdio_reinit(); #endif -#elif defined(BCMPCIE) - printf("======== Card detection to detect PCIE card! ========\n"); #endif } else { #if defined(BCMSDIO) @@ -153,6 +154,8 @@ static int dhd_wlan_set_carddetect(bool present) #endif #elif defined(BCMPCIE) printf("======== Card detection to remove PCIE card! ========\n"); + extern_wifi_set_enable(0); + mdelay(200); #endif } #endif /* BUS_POWER_RESTORE */ @@ -286,6 +289,10 @@ int dhd_wlan_init_gpio(void) gpio_wl_host_wake = -1; #endif +#if defined(BCMPCIE) + printf("======== Card detection to detect PCIE card! ========\n"); + pci_remove_reinit(0x14e4, 0x43ec, 1); +#endif printf("%s: GPIO(WL_REG_ON) = %d\n", __FUNCTION__, gpio_wl_reg_on); if (gpio_wl_reg_on >= 0) { err = gpio_request(gpio_wl_reg_on, "WL_REG_ON"); -- 2.20.1