Ejemplo n.º 1
0
/*
 * This will be called at init time of WLAN driver
 */
static int origen_wifi_set_detect(bool val)
{
	if (!wifi_status_cb) {
		printk(KERN_WARNING "WLAN: Nobody to notify\n");
		return -EAGAIN;
	}
	if (true == val) {
		origen_wlan_setup_power(true);
		wifi_status_cb(&s3c_device_hsmmc3, 1);
	} else {
		origen_wlan_setup_power(false);
		wifi_status_cb(&s3c_device_hsmmc3, 0);
	}

	return 0;
}
static int dalmore_wifi_set_carddetect(int val)
{
	pr_debug("%s: %d\n", __func__, val);
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warning("%s: Nobody to notify\n", __func__);
	return 0;
}
int shinano_wifi_set_carddetect(int val)
{
	shinano_wifi_cd = val;
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		printk(KERN_WARNING "%s: Nobody to notify\n", __func__);
	return 0;
}
int latona_wifi_set_carddetect(int val)
{
	pr_info("%s: %d\n", __func__, val);
	latona_wifi_cd = val;
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_info("%s: Nobody to notify\n", __func__);
	return 0;
}
Ejemplo n.º 5
0
//static int enterprise_wifi_set_carddetect(int val)
int enterprise_wifi_set_carddetect(int val)
{
    printk("%s: %d\n", __func__, val);
    enterprise_wifi_cd = val;
    if (wifi_status_cb)
        wifi_status_cb(val, wifi_status_cb_devid);
    else
        pr_warning("%s: Nobody to notify\n", __func__);
    return 0;
}
Ejemplo n.º 6
0
int chacha_wifi_set_carddetect(int val)
{
    printk(KERN_INFO "%s: %d\n", __func__, val);
    chacha_wifi_cd = val;
    if (wifi_status_cb)
        wifi_status_cb(val, wifi_status_cb_devid);
    else
        printk(KERN_WARNING "%s: Nobody to notify\n", __func__);
    return 0;
}
Ejemplo n.º 7
0
int mahimahi_wifi_set_carddetect(int val)
{
	pr_info("%s: %d\n", __func__, val);
	mahimahi_wifi_cd = val;
	if (wifi_status_cb) {
		wifi_status_cb(val, wifi_status_cb_devid);
	} else
		pr_warning("%s: Nobody to notify\n", __func__);
	return 0;
}
Ejemplo n.º 8
0
int mapphone_wifi_set_carddetect(int val)
{
	printk("%s: %d\n", __func__, val);
	mapphone_wifi_cd = val;
	if (wifi_status_cb) {
		wifi_status_cb(val, wifi_status_cb_devid);
	} else
		printk(KERN_WARNING "%s: Nobody to notify\n", __func__);
	return 0;
}
Ejemplo n.º 9
0
static int vcm30_t124_wifi_set_carddetect(int val)
{

	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warn("%s: Nobody to notify\n", __func__);

	return 0;
}
Ejemplo n.º 10
0
static int tuna_wifi_set_carddetect(int val)
{
	pr_debug("%s: %d\n", __func__, val);
	tuna_wifi_cd = val;
	if (wifi_status_cb) {
		wifi_status_cb(val, wifi_status_cb_devid);
	} else
		pr_warning("%s: Nobody to notify\n", __func__);
	return 0;
}
static int p3_wifi_set_carddetect(int val)
{
	printk(KERN_INFO "%s: start\n", __func__);
	pr_debug("%s: %d\n", __func__, val);
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warning("%s: Nobody to notify\n", __func__);
	return 0;
}
static int msm7x30_wifi_set_carddetect(int val)
{
	pr_debug("%s: %d\n", __func__, val);
	msm7x30_wifi_cd = val;
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warning("%s: nobody to notify\n", __func__);

	return 0;
}
Ejemplo n.º 13
0
int rk29sdk_wifi_set_carddetect(int val)
{
    pr_info("%s:%d\n", __func__, val);
    rk29sdk_wifi_cd = val;
    if (wifi_status_cb){
            wifi_status_cb(val, wifi_status_cb_devid);
    }else {
            pr_warning("%s,in mmc1 nobody to notify\n", __func__);
    }
    return 0; 
}
Ejemplo n.º 14
0
int bcm4329_wifi_set_carddetect(int val)
{
	printk("%s: %d\n", __func__, val);
	wifi_on=val;
	bcm4329_wifi_cd = val;
	if (wifi_status_cb) {
		wifi_status_cb(wifi_status_cb_devid, val);
	} else
		printk("%s: Nobody to notify\n", __func__);
	return 0;
}
int amlogic_wifi_set_carddetect(int val)
{
	amlogic_wifi_cd = val;

	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		printk("%s: Nobody to notify\n", __func__);

	return 0;
}
Ejemplo n.º 16
0
 int mot_wifi_set_carddetect(int val)
 {
	pr_debug("%s: %d\n", __func__, val);
	mot_wifi_cd = val;
	sdhci_tegra_wlan_detect();
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warning("%s: Nobody to notify\n", __func__);
	return 0;
 }
Ejemplo n.º 17
0
/* Used to set the virtual CD of wifi adapter */
int shuttle_wifi_set_cd(int val)
{
	pr_debug("%s: %d\n", __func__, val);
	
	/* Let the SDIO infrastructure know about the change */
	if (wifi_status_cb) {
		wifi_status_cb(val, wifi_status_cb_devid);
	} else
		pr_info("%s: Nobody to notify\n", __func__);

	return 0;
}
Ejemplo n.º 18
0
static int brcm_wlan_set_carddetect(int val)
{
	pr_debug("%s: wifi_status_cb : %p, devid : %p, val : %d\n",
		__func__, wifi_status_cb, wifi_status_cb_devid, val);
	brcm_wifi_cd = val;
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warning("%s: Nobody to notify\n", __func__);

	/* msleep(200); wait for carddetect */
	return 0;
}
int wlan_device_set_carddetect(int val)
{
	pr_info("%s: %d\n", __func__, val);
#if 0
	wlan_device_cd = val;
	if (wifi_status_cb) {
		wifi_status_cb(val, wifi_status_cb_devid);
	} else
		pr_warning("%s: Nobody to notify\n", __func__);
#endif

#ifdef CONFIG_WLAN_SDIO
	sdhci_bus_scan();
#endif
	return 0;
}
static int rhea_wifi_set_carddetect(int val)
{
	pr_debug("%s: %d\n", __func__, val);
	printk(KERN_ERR " %s INSIDE rhea_wifi_set_carddetect\n",__FUNCTION__);	
	rhea_wifi_cd = val;
	if (wifi_status_cb) {
		printk(KERN_ERR " %s CALLBACK NOT NULL\n",__FUNCTION__);	
		wifi_status_cb(val, wifi_status_cb_devid);
		printk(KERN_ERR " %s CALLBACK COMPLETE\n",__FUNCTION__);	
	} else
		pr_warning("%s: Nobody to notify\n", __func__);

//	if (val == 0)
//		bcm_sdiowl_term();
	return 0;
}
int wlan_device_set_carddetect(int val)
{
	pr_info("%s: %d\n", __func__, val);
	mdelay(100);
#if 0
	wlan_device_cd = val;
	if (wifi_status_cb) {
		wifi_status_cb(val, wifi_status_cb_devid);
	} else
		pr_warning("%s: Nobody to notify\n", __func__);
#endif

#ifdef CONFIG_WLAN_SDIO
//	sdhci_bus_scan();
       if(wlan_mmc) {
		mmc_detect_change(wlan_mmc, 0);
       } else {
		pr_info("%s  wlan_mmc is null,carddetect failed \n ",__func__);
       }
#endif
	return 0;
}
Ejemplo n.º 22
0
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) {
		/*
		if (gpio_request(GPIO_WL_REG_ON, "WL_REG_ON"))
		{
			printk("Failed to request for WL_REG_ON\n");
		}
		*/
#if defined(CONFIG_SEC_H_PROJECT) || defined(CONFIG_SEC_MONTBLANC_PROJECT)\
	|| defined(CONFIG_SEC_VIENNA_PROJECT) || defined(CONFIG_MACH_KS01SKT)\
	|| defined(CONFIG_TIZEN_R_PROJECT) || defined(CONFIG_MACH_B3)
		printk(KERN_INFO"WL_REG_ON on-step : [%d]\n" , gpio_get_value(GPIO_WL_REG_ON));
		if (gpio_direction_output(GPIO_WL_REG_ON, 1)) {
			printk(KERN_ERR "%s: check WL_REG_ON pin for H\n", __func__);
#else
		if (ice_gpiox_set(FPGA_GPIO_WLAN_EN, 1)) {		// yhcha-patch
#endif /* defined CONFIG_SEC_H_PROJECT */
			printk(KERN_ERR "%s: WL_REG_ON  failed to pull up\n",
				__func__);
			return -EIO;
		}

#if defined(CONFIG_SEC_H_PROJECT) || defined(CONFIG_SEC_MONTBLANC_PROJECT)\
	|| defined(CONFIG_SEC_VIENNA_PROJECT) || defined(CONFIG_MACH_KS01SKT)\
	|| defined(CONFIG_TIZEN_R_PROJECT) || defined(CONFIG_MACH_B3)
		if(gpio_get_value(GPIO_WL_REG_ON)){
			printk(KERN_INFO"WL_REG_ON on-step-2 : [%d]\n" , gpio_get_value(GPIO_WL_REG_ON));
			printk("[%s] gpio ok!!!\n",__func__);
		}
		else
		{
			printk("[%s] gpio value is 0. We need reinit.\n",__func__);
			if (gpio_tlmm_config(config_gpio_wl_reg_on[0], GPIO_CFG_ENABLE))
				printk(KERN_ERR "%s: Failed to configure GPIO"
						" - WL_REG_ON\n", __func__);

			if (gpio_direction_output(GPIO_WL_REG_ON, 1))
				printk(KERN_ERR "%s: WL_REG_ON  "
						"failed to pull down\n", __func__);
		}
#endif /* defined CONFIG_SEC_H_PROJECT */

#if defined(CONFIG_BCM4339) || defined(CONFIG_BCM4335) || defined(CONFIG_BCM4354) || defined(CONFIG_BCM4334)
	/* Power on/off SDIO host */
	sdio_ctrl_power((struct mmc_host *)wifi_mmc_host, onoff);
#endif /* CONFIG_BCM4339 || CONFIG_BCM4335  || CONFIG_BCM4354 */
	} else {
#if defined(CONFIG_BCM4339) || defined(CONFIG_BCM4335) || defined(CONFIG_BCM4354) || defined(CONFIG_BCM4334)
	/* Power on/off SDIO host */
	sdio_ctrl_power((struct mmc_host *)wifi_mmc_host, onoff);
#endif /* CONFIG_BCM4339 || CONFIG_BCM4335  || CONFIG_BCM4354 */
		/*
		if (gpio_request(GPIO_WL_REG_ON, "WL_REG_ON"))
		{
			printk("Failed to request for WL_REG_ON\n");
		}
		*/
#if defined(CONFIG_SEC_H_PROJECT) || defined(CONFIG_SEC_MONTBLANC_PROJECT)\
	|| defined(CONFIG_SEC_VIENNA_PROJECT) || defined(CONFIG_MACH_KS01SKT)\
	|| defined(CONFIG_TIZEN_R_PROJECT) || defined(CONFIG_MACH_B3)
		if (gpio_direction_output(GPIO_WL_REG_ON, 0)) {
#else
		if (ice_gpiox_set(FPGA_GPIO_WLAN_EN, 0)) {		// yhcha-patch
#endif /* defined CONFIG_SEC_H_PROJECT */
			printk(KERN_ERR "%s: WL_REG_ON  failed to pull down\n",
				__func__);
			return -EIO;
		}
	}
	return 0;
}

static int brcm_wlan_reset(int onoff)
{
  /*
	gpio_set_value(GPIO_WLAN_ENABLE,
			onoff ? GPIO_LEVEL_HIGH : GPIO_LEVEL_LOW);
  */
	return 0;
}

int brcm_wifi_status_register(
	void (*callback)(int card_present, void *dev_id),
	void *dev_id, void *mmc_host)
{
	if (wifi_status_cb)
		return -EAGAIN;
	wifi_status_cb = callback;
	wifi_status_cb_devid = dev_id;
	wifi_mmc_host = mmc_host;
	printk(KERN_ERR "%s: callback is %p, devid is %p\n",
		__func__, wifi_status_cb, dev_id);
	return 0;
}

unsigned int brcm_wifi_status(struct device *dev)
{
	printk("%s:%d status %d\n",__func__,__LINE__,brcm_wifi_cd);
	return brcm_wifi_cd;
}

static int brcm_wlan_set_carddetect(int val)
{
	pr_warning("%s: wifi_status_cb : %p, devid : %p, val : %d\n",
		__func__, wifi_status_cb, wifi_status_cb_devid, val);
	brcm_wifi_cd = val;
	if (wifi_status_cb)
		wifi_status_cb(val, wifi_status_cb_devid);
	else
		pr_warning("%s: Nobody to notify\n", __func__);

	/* msleep(200); wait for carddetect */

	return 0;
}