int wifi_deactivate_usb(void) { printk("%s\n",__FUNCTION__); wifi_turn_off_card(); msleep(1000); return 0; }
int wifi_deactivate_usb(void) { usb_switch_usb_host11_for_wifi(0); msleep(1000); wifi_turn_off_card(); msleep(100); return 0; }
int wifi_deactivate_usb(void) { printk("%s\n",__FUNCTION__); #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,25) usb_switch_usb_host11_for_wifi(0); msleep(1000); #endif wifi_turn_off_card(); msleep(100); return 0; }
/* * Change USB mode to be original. */ int wifi_deactivate_usb(void) { if (wifi_change_usb_mode == 1) { usb_force_usb_for_wifi(USB_FORCE_DEVICE); msleep(1000); usb_force_usb_for_wifi(USB_NORMAL); msleep(1000); } wifi_turn_off_card(); usb_wifi_status = 0; return 0; }
int wifi_deactivate_usb(void) { wifi_turn_off_card(); msleep(1000); return 0; }
void rockchip_wifi_shutdown(void) { printk("rockchip_wifi_shutdown....\n"); wifi_turn_off_card(); }
static void rk28_adkeyscan_timer(unsigned long data) { unsigned int ADKEY1,ADKEY2,code = 0,i; /*Enable AD controller to sample */ prockAD_button->timer.expires = jiffies+msecs_to_jiffies(20); add_timer(&prockAD_button->timer); // printk("\n LED_Delay_Counter=%d \n",LED_Delay_Counter); if(timercount) { timercount --; if(!timercount) pca955x_gpio_direction_output(PCA955X_Pin12,GPIO_LOW); } RockAdcScanning(); if (ADSampleTimes < 4) { ADSampleTimes ++; goto scan_io_key; /* scan gpio button event*/ } ADSampleTimes = 0; /*Get button value*/ ADKEY1=get_rock_adc1(); //ADKEY2=get_rock_adc2(); if(ADKEY1<EmptyADValue) printk("\n ADC1 value=%d \n",ADKEY1); //printk("\n ADC2 value=%d \n",ADKEY2); /* if(backligh_back_vallue!=ADKEY2){ backligh_back_vallue=ADKEY2; backligh_just_vallue=ADKEY2/3; if(backligh_just_vallue>255) backligh_just_vallue=255; //printk("\n backligh_just_vallue value=%d \n",backligh_just_vallue); //rk28_bl_update_status_for_Test(255-backligh_just_vallue); } */ #if 1 //ffhh if((ADKEY1>EmptyADValue)&&(ADKEY1<=InvalidADValue)) goto scan_io_key1; #endif valuecount++; if(valuecount < 2) goto scan_code; if(ADKEY1<50) code=AD1KEY3; else code=find_rock_adkeycode(ADKEY1,ad2valuetab); valuecount = 2; goto scan_code; ///scan_code; scan_io_key1: valuecount = 0; scan_code: if((g_code == 0) && (code == 0)){ goto scan_io_key; } ///DBG("\n key button PE2 == %d \n",GPIOGetPinLevel(GPIOPortE_Pin2)); if(code != 0){ if(valuecount<2) goto scan_io_key; if(g_code == 0){ g_code = code; DBG("\n %s::%d rock adc1 key scan ,find press down a key=%d \n",__func__,__LINE__,g_code); input_report_key(prockAD_button->input_dev,g_code,1); input_sync(prockAD_button->input_dev); pca955x_gpio_direction_output(PCA955X_Pin12,GPIO_HIGH); timercount = 20; // mdelay(500); // pca955x_gpio_direction_output(PCA955X_Pin12,GPIO_LOW); goto scan_io_key; }else{ if(g_code != code){ DBG("\n %s::%d rock adc1 key scan ,find press up a key=%d \n",__func__,__LINE__,g_code); input_report_key(prockAD_button->input_dev,g_code,0); input_sync(prockAD_button->input_dev); DBG("\n %s::%d rock adc1 key scan ,find press down a key=%d \n",__func__,__LINE__,code); input_report_key(prockAD_button->input_dev,code,1); input_sync(prockAD_button->input_dev); g_code = code; goto scan_io_key; } } } if((g_code != 0)&&(code == 0)&&(ADSampleTimes == 0)){ DBG("\n %s::%d rock adc1 key scan ,find press up a key=%d \n",__func__,__LINE__,g_code); input_report_key(prockAD_button->input_dev,g_code,0); input_sync(prockAD_button->input_dev); valuecount = 0; g_code = 0; goto scan_io_key; } scan_io_key : // rockchip_mux_api_set(GPIOF5_APWM3_DPWM3_NAME, IOMUXB_GPIO1_B5); //GPIOSetPinDirection(GPIOPortF_Pin5,GPIO_IN); #if 0 if(needfirstonwifi){ if(GPIOGetPinLevel(GPIOPortF_Pin5)){ if(!Wifi_turn_on_flag) { if(firstonwifi!=1){ wifi_turn_on_card(); wifi_power_up_wifi(); printk("GPIOPortF_Pin5 HIGH \n"); Wifi_turn_on_flag=1; Wifi_turn_off_flag=0; } } } else { if(!Wifi_turn_off_flag) { if(firstonwifi!=2){ wifi_turn_off_card(); wifi_power_up_wifi(); printk("GPIOPortF_Pin5 LOW \n"); Wifi_turn_on_flag=0; Wifi_turn_off_flag=1; } } } } #endif for(i=0;i<4;i++){ GPIOSetPinDirection(IoCode[i][0],GPIO_IN); #if 1 if(GPIOGetPinLevel(IoCode[i][0])){ if((IOkeyback!=IoCode[i][1])&&(IOkeyback)){ input_report_key(prockAD_button->input_dev,IOkeyback,0); input_sync(prockAD_button->input_dev); DBG("Key Pb%d up code=%d!!!\n",i,IOkeyback); } IOkeyback=IoCode[i][1]; input_report_key(prockAD_button->input_dev,IoCode[i][1],1); input_sync(prockAD_button->input_dev); DBG("Key Pb%d down code=%d!!!\n",i,IoCode[i][1]); pca955x_gpio_direction_output(PCA955X_Pin12,GPIO_HIGH); timercount = 20; // mdelay(500); // pca955x_gpio_direction_output(PCA955X_Pin12,GPIO_LOW); break; }else if(IOkeyback==IoCode[i][1]){ IOkeyback=0; input_report_key(prockAD_button->input_dev,IoCode[i][1],0); input_sync(prockAD_button->input_dev); DBG("Key Pb%d up code=%d!!!\n",i,IoCode[i][1]); break; } #endif } if(g_wake_press) { pwrscantimes = 0; g_wake_press = !GPIOGetPinLevel(WAKEUP_KEY_PORT); if(g_wake_press) return; } // if(!GPIOGetPinLevel(GPIOPortF_Pin0)) if(!GPIOGetPinLevel(WAKEUP_KEY_PORT)) { pwrscantimes += 1; if(pwrscantimes == (SEC_NUM * ONESEC_TIMES)) { input_report_key(prockAD_button->input_dev,ENDCALL,1); input_sync(prockAD_button->input_dev); DBG("the kernel come to power down!!!\n"); LED_Delay_Counter=LED_LIGHT_TIME; } if(pwrscantimes ==( (SEC_NUM + 1)* ONESEC_TIMES)) { pwrscantimes = 0; input_report_key(prockAD_button->input_dev,ENDCALL,0); input_sync(prockAD_button->input_dev); DBG("the kernel come to power up!!!\n"); } return ; } if( pwrscantimes > SLEEP_TIME) { pwrscantimes = 0; DBG("========== %s: g_enable_sleep=%d\n", __FUNCTION__, g_enable_sleep); if(g_enable_sleep) { input_report_key(prockAD_button->input_dev,AD1KEY5,1); input_sync(prockAD_button->input_dev); input_report_key(prockAD_button->input_dev,AD1KEY5,0); input_sync(prockAD_button->input_dev); rockchip_mux_api_set(GPIOE_I2C0_SEL_NAME, IOMUXA_I2C0); rockchip_mux_api_set(GPIOE_U1IR_I2C1_NAME, IOMUXA_I2C1); } DBG("\n%s^^^^Wake Up ^^^^^!!\n",__FUNCTION__); } }