Ejemplo n.º 1
0
int u8500_wifi_power(int on, int flag)
{
	printk(KERN_INFO "%s: WLAN Power %s, flag %d\n",
		__FUNCTION__, on ? "on" : "down", flag);
	if (flag != 1) {
		gpio_set_value(wifi_gpio_reset, on);
		if (on)
			udelay(200);
		sdi1_card_power_on = (on==0) ? false : true;
		return 0;
	}

	sdi1_card_power_on = (on == 0) ? false : true;

	if (on) {
		gpio_set_value(wifi_gpio_reset, 1);
		mdelay(250);
		u8500_sdio_detect_card();
		udelay(2000);
	} else {
		gpio_set_value(wifi_gpio_reset, 0);
	}
	
	return 0;
}
Ejemplo n.º 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__));
#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;
	}
}