/* Customer function to control hw specific wlan gpios */ void dhd_customer_gpio_wlan_ctrl(int onoff) { switch (onoff) { case WLAN_RESET_OFF: WL_TRACE(("%s: call customer specific GPIO to insert WLAN RESET\n", __FUNCTION__)); #ifdef CONFIG_MACH_SAMSUNG_P3 nvidia_wlan_poweroff (POWER_OFF, 2); #elif defined(SYSLSI_SPECIFIC) wlan_setup_power(POWER_OFF, 2); #endif WL_ERROR(("=========== WLAN placed in RESET ========\n")); break; case WLAN_RESET_ON: WL_TRACE(("%s: callc customer specific GPIO to remove WLAN RESET\n", __FUNCTION__)); #ifdef CONFIG_MACH_SAMSUNG_P3 nvidia_wlan_poweron (POWER_ON,2); #elif defined(SYSLSI_SPECIFIC) wlan_setup_power(POWER_ON, 2); #endif WL_ERROR(("=========== WLAN going back to live ========\n")); break; case WLAN_POWER_OFF: WL_TRACE(("%s: call customer specific GPIO to turn off WL_REG_ON\n", __FUNCTION__)); #ifdef CONFIG_MACH_SAMSUNG_P3 nvidia_wlan_poweroff (POWER_OFF, 1); #elif defined(SYSLSI_SPECIFIC) wlan_setup_power(POWER_OFF, 1); #elif defined(CONFIG_MACH_N1) n1_device_wifi_power (0); #elif defined(CONFIG_MACH_GODIN) godin_wifi_power(0); #endif break; case WLAN_POWER_ON: WL_TRACE(("%s: call customer specific GPIO to turn on WL_REG_ON\n", __FUNCTION__)); #ifdef CONFIG_MACH_SAMSUNG_P3 nvidia_wlan_poweron (POWER_ON, 1); #elif defined(SYSLSI_SPECIFIC) wlan_setup_power(POWER_ON, 1); #elif defined(CONFIG_MACH_N1) n1_device_wifi_power (1); #elif defined(CONFIG_MACH_GODIN) godin_wifi_power(1); OSL_DELAY(150); u8500_sdio_detect_card(); OSL_DELAY(2000); #endif /* Lets customer power to get stable */ /* OSL_DELAY(200); */ break; } }
/* Customer function to control hw specific wlan gpios */ void dhd_customer_gpio_wlan_ctrl(int onoff) { switch (onoff) { case WLAN_RESET_OFF: WL_TRACE(("%s: call customer specific GPIO to insert WLAN RESET\n", __FUNCTION__)); #if defined (CUSTOMER_HW_SAMSUNG) wlan_setup_power(POWER_OFF, 2); #elif defined(CUSTOMER_HW) bcm_wlan_power_off(2); #elif defined(CUSTOMER_HW2) wifi_set_power(0, 0); #endif WL_ERROR(("=========== WLAN placed in RESET ========\n")); break; case WLAN_RESET_ON: WL_TRACE(("%s: callc customer specific GPIO to remove WLAN RESET\n", __FUNCTION__)); #if defined(CUSTOMER_HW_SAMSUNG) wlan_setup_power(POWER_ON, 2); #elif defined(CUSTOMER_HW) bcm_wlan_power_on(2); #elif defined(CUSTOMER_HW2) wifi_set_power(1, 0); #endif WL_ERROR(("=========== WLAN going back to live ========\n")); break; case WLAN_POWER_OFF: WL_TRACE(("%s: call customer specific GPIO to turn off WL_REG_ON\n", __FUNCTION__)); #if defined(CUSTOMER_HW_SAMSUNG) wlan_setup_power(POWER_OFF, 1); #elif defined(CUSTOMER_HW) bcm_wlan_power_off(1); #endif /* CUSTOMER_HW || CUSTOMER_HW_SAMSUNG */ break; case WLAN_POWER_ON: WL_TRACE(("%s: call customer specific GPIO to turn on WL_REG_ON\n", __FUNCTION__)); #if defined(CUSTOMER_HW_SAMSUNG) wlan_setup_power(POWER_ON, 1); #elif defined(CUSTOMER_HW) bcm_wlan_power_on(1); /* Lets customer power to get stable */ OSL_DELAY(50); #endif /* CUSTOMER_HW || CUSTOMER_HW_SAMSUNG */ break; } }
static void ar6000_pwr_down(AR_SOFTC_T *ar) { AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s enter\n", __func__)); if (ar == NULL) { /* shutdown for all cards */ } #ifdef TARGET_EUROPA wlan_setup_power(0,0); #endif }
static int ath6kl_pm_remove(struct platform_device *pdev) { wlan_setup_power(0,1); return 0; }
static int ath6kl_pm_probe(struct platform_device *pdev) { printk("%s()",__func__); wlan_setup_power(1,1); return 0; }
A_STATUS ar6000_enter_exit_cut_power_state(AR_SOFTC_T *ar, A_BOOL exit) { WMI_REPORT_SLEEP_STATE_EVENT wmiSleepEvent ; A_STATUS status = A_OK; HIF_DEVICE_POWER_CHANGE_TYPE config; AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: Cut power %d %d \n", __func__,exit, ar->arWlanPowerState)); #ifdef CONFIG_PM AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("Wlan OFF %d BT OFf %d \n", ar->arWlanOff, ar->arBTOff)); #endif do { if (exit) { /* Not in cut power state.. exit */ if (ar->arWlanPowerState != WLAN_POWER_STATE_CUT_PWR) { break; } #ifdef TARGET_EUROPA wlan_setup_power(1,0); #endif /* Change the state to ON */ ar->arWlanPowerState = WLAN_POWER_STATE_ON; /* Indicate POWER_UP to HIF */ config = HIF_DEVICE_POWER_UP; status = HIFConfigureDevice(ar->arHifDevice, HIF_DEVICE_POWER_STATE_CHANGE, &config, sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); if (status == A_PENDING) { /* Previously, we decided to wait here until the device becomes fully functional since there is a chance that some entity tries to access the device once we return from the resume callback. However, it was observed that the resume process gets delayed too because of this wait. Commenting it out to speed up the process of resuming */ #if 0 /* Wait for WMI ready event */ A_UINT32 timeleft = wait_event_interruptible_timeout(arEvent, (ar->arWmiReady == TRUE), wmitimeout * HZ); if (!timeleft || signal_pending(current)) { AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000 : Failed to get wmi ready \n")); status = A_ERROR; break; } #endif status = A_OK; } else if (status == A_OK) { ar6000_exit_cut_power_state(ar); } } else { /* Already in cut power state.. exit */ if (ar->arWlanPowerState == WLAN_POWER_STATE_CUT_PWR) { break; } wmiSleepEvent.sleepState = WMI_REPORT_SLEEP_STATUS_IS_AWAKE; ar6000_send_event_to_app(ar, WMI_REPORT_SLEEP_STATE_EVENTID, (A_UINT8*)&wmiSleepEvent, sizeof(WMI_REPORT_SLEEP_STATE_EVENTID)); ar6000_stop_endpoint(ar->arNetDev, TRUE, FALSE); config = HIF_DEVICE_POWER_CUT; status = HIFConfigureDevice(ar->arHifDevice, HIF_DEVICE_POWER_STATE_CHANGE, &config, sizeof(HIF_DEVICE_POWER_CHANGE_TYPE)); #ifdef TARGET_EUROPA wlan_setup_power(0,0); #endif ar->arWlanPowerState = WLAN_POWER_STATE_CUT_PWR; } } while (0); return status; }
static int ath6kl_pm_probe(struct platform_device *pdev) { wlan_setup_power(1,1); return 0; }