static int brcm_wlan_power(int onoff)
{
	printk(KERN_INFO"------------------------------------------------");
	printk(KERN_INFO"------------------------------------------------\n");
	printk(KERN_INFO"%s Enter: power %s\n", __func__, onoff ? "on" : "off");

	if (onoff) {
		s3c_config_gpio_alive_table
			(ARRAY_SIZE(wlan_on_gpio_table), wlan_on_gpio_table);
		s5p_gpio_set_pd_cfg(GPIO_WLAN_EN, S5P_GPIO_PD_PREV_STATE);
		udelay(200);
		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_HIGH);
		printk(KERN_DEBUG"WLAN: GPIO_WLAN_EN = %d\n",
		gpio_get_value(GPIO_WLAN_EN));
	} else {
		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_LOW);
		s3c_config_gpio_alive_table
			(ARRAY_SIZE(wlan_off_gpio_table), wlan_off_gpio_table);
		s5p_gpio_set_pd_cfg(GPIO_WLAN_EN, S5P_GPIO_PD_OUTPUT0);
		printk(KERN_DEBUG"WLAN: GPIO_WLAN_EN = %d\n",
		gpio_get_value(GPIO_WLAN_EN));
	}

	return 0;
}
Ejemplo n.º 2
0
static int brcm_wlan_set_carddetect(int onoff)
{
	if (onoff)
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_sdio_on_table), wlan_sdio_on_table);
	else
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_sdio_off_table), wlan_sdio_off_table);

	udelay(200);

	mmc_force_presence_change(&s3c_device_hsmmc3);
	/* msleep(500);  wait for carddetect */
	return 0;
}
Ejemplo n.º 3
0
static int __init init_wifi_mem(void)
{
	int i;
	int j;

	//init GPIO
    #ifndef SAMSUNG_GAUDI_WLAN_HSIC
	s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_sdio_off_table), wlan_sdio_off_table);
	#endif
	s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_off_gpio_table), wlan_off_gpio_table);

	for (i = 0; i < 8; i++) {
		wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE);
		if (!wlan_static_skb[i])
			goto err_skb_alloc;
	}

	for (; i < 16; i++) {
		wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE);
		if (!wlan_static_skb[i])
			goto err_skb_alloc;
	}

	wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE);
	if (!wlan_static_skb[i])
		goto err_skb_alloc;

	for (i = 0 ; i < PREALLOC_WLAN_SEC_NUM ; i++) {
		wifi_mem_array[i].mem_ptr =
				kmalloc(wifi_mem_array[i].size, GFP_KERNEL);

		if (!wifi_mem_array[i].mem_ptr)
			goto err_mem_alloc;
	}
	printk("%s: WIFI MEM Allocated\n", __FUNCTION__);
	return 0;

 err_mem_alloc:
	pr_err("Failed to mem_alloc for WLAN\n");
	for (j = 0 ; j < i ; j++)
		kfree(wifi_mem_array[j].mem_ptr);

	i = WLAN_SKB_BUF_NUM;

 err_skb_alloc:
	pr_err("Failed to skb_alloc for WLAN\n");
	for (j = 0 ; j < i ; j++)
		dev_kfree_skb(wlan_static_skb[j]);

	return -ENOMEM;
}
Ejemplo n.º 4
0
void wlan_setup_power(int on, int flag)
{
	printk("------------------------------------------------");
	printk("------------------------------------------------");
	printk("------------------------------------------------");

	printk(/*KERN_INFO*/ "%s %s", __func__, on ? "on" : "down");
	if (flag != 1) {
		printk(/*KERN_DEBUG*/ "(on=%d, flag=%d)\n", on, flag);
#if 1
		if (on)
			gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_HIGH);
		else
			gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_LOW);
#endif
	return;
	}
	printk(/*KERN_INFO*/ " --enter\n");

	if (on) {
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_on_gpio_table), wlan_on_gpio_table);
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_sdio_on_table), wlan_sdio_on_table);

		udelay(200);

		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_HIGH);
		//s3c_gpio_slp_cfgpin(GPIO_WLAN_EN, S3C_GPIO_SLP_OUT1);

		printk(KERN_DEBUG "WLAN: GPIO_WLAN_EN = %d \n", gpio_get_value(GPIO_WLAN_EN));
	}
	else {
		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_LOW);
		//s3c_gpio_slp_cfgpin(GPIO_WLAN_EN, S3C_GPIO_SLP_OUT0);
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_off_gpio_table), wlan_off_gpio_table);

		printk(KERN_DEBUG "WLAN: GPIO_WLAN_EN = %d \n", gpio_get_value(GPIO_WLAN_EN));

		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_sdio_off_table), wlan_sdio_off_table);
	}

	/* mmc_rescan*/
#if defined(CONFIG_MACH_C1_NA_SPR_REV05) || defined(CONFIG_MACH_C1_NA_SPR_EPIC2_REV00) \
	|| defined(CONFIG_MACH_C1_NA_USCC_REV05) || defined(CONFIG_MACH_C1_KDDI_REV00)
	sdhci_s3c_force_presence_change(&s3c_device_hsmmc2);
#else
	sdhci_s3c_force_presence_change(&s3c_device_hsmmc3);
#endif

}
Ejemplo n.º 5
0
static int brcm_wlan_power(int onoff)
{
	printk("%s Enter: power %s\n", __FUNCTION__, onoff ? "on" : "off");

	if (onoff) {
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_on_gpio_table), wlan_on_gpio_table);
		udelay(200);
		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_HIGH);
		printk("WLAN: GPIO_WLAN_EN = %d \n", gpio_get_value(GPIO_WLAN_EN));
	} else {
		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_LOW);
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_off_gpio_table), wlan_off_gpio_table);
		printk("WLAN: GPIO_WLAN_EN = %d \n", gpio_get_value(GPIO_WLAN_EN));
	}

	return 0;
}
Ejemplo n.º 6
0
void wlan_setup_power(int on, int flag)
{
	printk("------------------------------------------------");
	printk("------------------------------------------------");
	printk("------------------------------------------------");

	printk(/*KERN_INFO*/ "%s %s", __func__, on ? "on" : "down");
	if (flag != 1) {
		printk(/*KERN_DEBUG*/ "(on=%d, flag=%d)\n", on, flag);
#if 1
		if (on)
		{
			gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_HIGH);
		}
		else
			gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_LOW);
#endif
	return;
	}
	printk(/*KERN_INFO*/ " --enter\n");

	if (on) {
		usb_host_hsic_power_init();
		udelay(100);
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_on_gpio_table), wlan_on_gpio_table);

		udelay(200);

		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_HIGH);

		printk(KERN_DEBUG "WLAN: GPIO_WLAN_EN = %d \n", gpio_get_value(GPIO_WLAN_EN));
	}
	else {
		usb_host_hsic_power_off();
		gpio_set_value(GPIO_WLAN_EN, GPIO_LEVEL_LOW);
		//s3c_gpio_slp_cfgpin(GPIO_WLAN_EN, S3C_GPIO_SLP_OUT0);
		s3c_config_gpio_alive_table(ARRAY_SIZE(wlan_off_gpio_table), wlan_off_gpio_table);

		printk(KERN_DEBUG "WLAN: GPIO_WLAN_EN = %d \n", gpio_get_value(GPIO_WLAN_EN));
	}

}
static int brcm_wlan_set_carddetect(int onoff)
{
	if (onoff) {
		s3c_config_gpio_alive_table(
ARRAY_SIZE(wlan_sdio_on_table), wlan_sdio_on_table);
	} else {
		s3c_config_gpio_alive_table(
ARRAY_SIZE(wlan_sdio_off_table), wlan_sdio_off_table); }

#if 0
	udelay(200);
#else
	mdelay(10);
#endif

	mmc_force_presence_change(&exynos5_device_dwmci1, onoff);
	msleep(500); /* wait for carddetect */

	return 0;
}