Esempio n. 1
0
static void headset_int_handler(void *dev_id)
{
	lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_int_handler()!!\n");

	struct headset_switch_data *switch_data =
		(struct headset_switch_data *)dev_id;
	headset_detecting = 1;
	cancel_delayed_work_sync(&switch_data->hook_delayed_work);
	//schedule_work(&switch_data->work);
	NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, &headset_gpio_status);	
	headset_status = headset_gpio_status;

	if(headset_status == 0)
   	{
        schedule_work(&headset_sw_data->delayed_work);
		  #if defined(STAR_COUNTRY_KR) && !defined(CONFIG_MACH_STAR_SKT_REV_A)  
			headset_Mic_Bias(0);
		  #endif
   	}
	else
	{
	    schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(type_detection_time));	
//P990_IFX_GB_PORTING_LGSI_START
#if !defined (STAR_OPERATOR_FIDO)
	    wake_lock_timeout(&headset_wake_lock, msecs_to_jiffies(type_detection_time + 50));	 //20111017 [email protected] Problem that no wake up when disconn headset in calling
#endif
//P990_IFX_GB_PORTING_LGSI_END
    }
	NvOdmGpioInterruptDone(s_hHeadsetHandle.hheadsetInterrupt);	//20100420 [email protected] for next interrupt (nVidia Interrupt Spec.) [LGE]
//FIDO - GB Porting [09/08/2011] - Start
#if defined (STAR_OPERATOR_FIDO)
	wake_lock_timeout(&headset_wake_lock, msecs_to_jiffies(1500));		 //20110427 [email protected] headset wake lock timeout
#endif
//FIDO - GB Porting [09/08/2011] - End
}
Esempio n. 2
0
static void headset_int_handler(void *dev_id)
{
	lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_int_handler()!!\n");

	struct headset_switch_data *switch_data =
		(struct headset_switch_data *)dev_id;
	headset_detecting = 1;
	cancel_delayed_work_sync(&switch_data->hook_delayed_work);
	//schedule_work(&switch_data->work);
	NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, &headset_gpio_status);	
	headset_status = headset_gpio_status;

	if(headset_status == 0)
   	{
        schedule_work(&headset_sw_data->delayed_work);
		  #if defined(STAR_COUNTRY_KR) && !defined(CONFIG_MACH_STAR_SKT_REV_A)  
			headset_Mic_Bias(0);
		  #endif
   	}
	else
	{
	    schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(type_detection_time));	
    }
	NvOdmGpioInterruptDone(s_hHeadsetHandle.hheadsetInterrupt);	//20100420  for next interrupt (nVidia Interrupt Spec.) [LGE]
}
Esempio n. 3
0
static void headset_det_work(struct work_struct *work)
{
    if (headset_off) return;
	NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, &headset_gpio_status);	//20100419 [email protected] for nVidia headset driver [LGE]
	headset_status = headset_gpio_status;

	lprintk(D_AUDIO, KERN_ERR "@@(Headset_det.c)@@ headset_det_work(), headset_status = %d\n",headset_status);

   if(headset_status == 0)
   {
        schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(remove_detection_time));
	#if defined(STAR_COUNTRY_KR) && !defined(CONFIG_MACH_STAR_SKT_REV_A)	  
		 headset_Mic_Bias(0);
	#endif

   }
	else
	{
	     schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(type_detection_time));
		  
	}
}
Esempio n. 4
0
static void type_det_work(struct work_struct *work)
{
    NvU32 hook_value =0;
	if (headset_off) return;

    NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, &headset_gpio_status);	
	headset_status = headset_gpio_status;
    
	if( (headset_status == 1) && (headset_type == STAR_NONE))	
	{
#if defined(CONFIG_MACH_STAR_SKT_REV_A)  
		 if(star_get_i2c_busy())
		 {
			  schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(type_detection_time));	
			lprintk(D_AUDIO, KERN_ERR "@@(Headset_det.c)@@ type_det_work(), i2c is busy\n");
			return;
		 }
		 star_set_i2c_busy();
		star_headsetdet_bias(1);
#else
		headset_Mic_Bias(1);
#endif

	#if HOOK_USE_ADC
		hook_value = headset_get_hook_adc_value();	

		if(hook_value > 350) //20101127 [email protected] detect adc 1200==>350[LGE_LAB1]
			headset_type = STAR_HEADSET;	
		else
			headset_type = STAR_HEADPHONE;
	#else
		NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Hookkey_Detection, &hookkey_gpio_status);	//[email protected] 20100419 for nVidia headset driver
		if(hookkey_gpio_status == 0){ 
		   headset_type = STAR_HEADPHONE;
			hook_value = 1111;
		}
		else{
		   headset_type = STAR_HEADSET;
			hook_value = 2222;
		}
	#endif
	}
	else if(headset_status == 0){
		headset_type = STAR_NONE;
        hook_status = HOOK_RELEASED; 
		input_report_key(headset_sw_data->ip_dev, KEY_HOOK, 0);
		input_sync(headset_sw_data->ip_dev);
    }

	lprintk(D_AUDIO, KERN_ERR "@@(Headset_det.c)@@ type_det_work(), HOOKVALUE %d headset_type = %d\n", hook_value, headset_type);
#if defined(CONFIG_MACH_STAR_SKT_REV_A)  
	if(headset_type != STAR_HEADSET){
		block_hook_int =1;
		star_headsetdet_bias(0);	//20100419 [email protected]  for Headset MIC Bias  ==> framwork function used in kernel ==> error [LGE]
	}
	else{
        block_hook_int =0;
	}
	star_unset_i2c_busy();
#else
	if(headset_type != STAR_HEADSET){
        block_hook_int =1;
		headset_Mic_Bias(0);
	}
    else{
        block_hook_int =0;
	}
#endif
	headset_detecting = 0;

	switch_set_state(&headset_sw_data->sdev, headset_type); 
}