コード例 #1
0
void platform_wifi_power_off(void)
{
#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
	sunximmc_rescan_card(SDIOID, 0);
#endif // CONFIG_MMC_SUNXI_POWER_CONTROL
}
コード例 #2
0
/* 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__));
			mmc_pm_gpio_ctrl("bcm40181_shdn", 0);
			mmc_pm_gpio_ctrl("bcm40181_vcc_en", 0);
			mmc_pm_gpio_ctrl("bcm40181_vdd_en", 0);
			printk("[bcm40181]: bcm40181_shdn=>0 !!\n");

#ifdef CUSTOMER_HW
			bcm_wlan_power_off(2);
#endif /* CUSTOMER_HW */
#ifdef CUSTOMER_HW2
			wifi_set_power(0, 0);
#endif
			printk("=========== WLAN placed in RESET ========\n");
//			IW8101_wlan_power_off(RESET);
		break;

		case WLAN_RESET_ON:
			WL_TRACE(("%s: callc customer specific GPIO to remove WLAN RESET\n",
				__FUNCTION__));
			mmc_pm_gpio_ctrl("bcm40181_vcc_en", 1);
			udelay(100);
			mmc_pm_gpio_ctrl("bcm40181_shdn", 1);
			udelay(50);
			mmc_pm_gpio_ctrl("bcm40181_vdd_en", 1);
			printk("[bcm40181]: bcm40181_shdn=>1 !!\n");
#ifdef CUSTOMER_HW
			bcm_wlan_power_on(2);
#endif /* CUSTOMER_HW */
#ifdef CUSTOMER_HW2
			wifi_set_power(1, 0);
#endif
			printk("=========== WLAN going back to live  ========\n");
//                     IW8101_wlan_power_on(RESET);
		break;

		case WLAN_POWER_OFF:
			WL_TRACE(("%s: call customer specific GPIO to turn off WL_REG_ON\n", __FUNCTION__));
			mmc_pm_gpio_ctrl("bcm40181_shdn", 0);
			mmc_pm_gpio_ctrl("bcm40181_vcc_en", 0);
			mmc_pm_gpio_ctrl("bcm40181_vdd_en", 0);
			sunximmc_rescan_card(3, 0);
#ifdef CUSTOMER_HW
			bcm_wlan_power_off(1);
#endif /* CUSTOMER_HW */
			printk("=========== WLAN power off  ========\n");
//			IW8101_wlan_power_off(NORMAL);
		break;

		case WLAN_POWER_ON:
			WL_TRACE(("%s: call customer specific GPIO to turn on WL_REG_ON\n", __FUNCTION__));
			mmc_pm_gpio_ctrl("bcm40181_vcc_en", 1);
			udelay(100);
			mmc_pm_gpio_ctrl("bcm40181_shdn", 1);
			udelay(50);
			mmc_pm_gpio_ctrl("bcm40181_vdd_en", 1);			
#ifdef CUSTOMER_HW
			bcm_wlan_power_on(1);
			/* Lets customer power to get stable */
			OSL_DELAY(200);
#endif /* CUSTOMER_HW */
			printk("=========== WLAN power on  ========\n");
//			IW8101_wlan_power_on(NORMAL);
			/* Lets customer power to get stable */
			OSL_DELAY(200);
            sunximmc_rescan_card(3, 1);
		break;
	}
}