コード例 #1
0
void start_handle_mhl(unsigned long data)

{

	int rc = 0;
	MHL_DEV_INFO("%s : is called\n", __func__);

if (!MHL_Get_Cable_State()){	
	
	
	MHL_DEV_INFO("%s : queue detect work..\n", __func__);	

	 rc = queue_delayed_work(mhl_detect_work_queue, &mhl_detect_work, msecs_to_jiffies(600));

	if (!rc)
			{
				MHL_DEV_INFO("%s: mhl_detect_work is already on!!! let's try again", __func__);
				rc =  schedule_delayed_work(&mhl_detect_again_work, msecs_to_jiffies(0));
				if (!rc) 
					{
						pr_err("%s: mhl_detect_again_work is already on a queue", __func__);
					}
			}

}

return;

}
コード例 #2
0
void is_mhl_cable(struct work_struct *work)
{
	int rc=0;
	   MHL_DEV_INFO("%s: MHL_Get_Cable_State  %d\n ", __func__ , MHL_Get_Cable_State());
	if (!MHL_Get_Cable_State())		
	{
     if (is_mhl_mode())
	  {
		atomic_set(&mhl_connect_status,0);
		do{
		rc = queue_delayed_work(mhl_ctrl_connect_work_queue, &mhl_ctrl_connect_work,0);
		 wait_event_timeout(mhl_connect_wait_queue, 0 ,msecs_to_jiffies(10));
	    if (!rc) {
	 	  MHL_DEV_INFO("%s: mhl_ctrl_connect_work_queue is already on, queue again\n ", __func__);
        }
		}while(!rc);
		set_flag_mhl_mode(0);
	  }
   }
   else if (MHL_Get_Cable_State())
	{
	  if (!is_mhl_mode())
	  {
		atomic_set(&mhl_connect_status,1);
		MHL_DEV_INFO("%s: cable_mv is_mhl_mode\n ", __func__);
		do{
			rc = queue_delayed_work(mhl_ctrl_connect_work_queue, &mhl_ctrl_connect_work,0);
		    wait_event_timeout(mhl_connect_wait_queue, 0 ,msecs_to_jiffies(10));
 		    if (!rc) {
		 	 MHL_DEV_INFO("%s: mhl_ctrl_connect_work_queue is already on, queue again\n ", __func__);
		    }
				 
		}while(!rc);
		set_flag_mhl_mode(0);
	  }
    }
	return ;
}
コード例 #3
0
void mhl_cable_disconnect(void)
{

	
	MHL_DEV_INFO("%s: in\n ", __func__);	
	
		if(MHL_Get_Cable_State()){
			
					MHL_DEV_INFO("%s: really in!!!!!! in\n ", __func__);	
					MHL_Set_Cable_State(MHL_CABLE_DISCONNCET);	
					set_mhl_ctrled_hpd_state(false);
					MHL_Cable_On(0);
					MHL_On(0);
					mhl_power_ctrl(0);
					MHL_En_Control(0) ;// switch-MHL
		//			pantech_hdmi_cable_detect(0);
					MHL_DEV_INFO( "[SKY_MHL]%s MHL cable disConnect \n",__func__);
		
	
		}
		


}
コード例 #4
0
void is_mhl_cable(struct work_struct *work)
{
	
	struct pm8xxx_adc_chan_result result;
	int rc=0;
	int try_max=0;
	do
	{
	   rc = pm8xxx_adc_mpp_config_read(PM8XXX_AMUX_MPP_3, ADC_MPP_1_AMUX6, &result);
	   try_max++;
	}while(rc && try_max<20);
	#ifdef MHL_DEBUG
	   printk("%s: cable_mv %lld\n ", __func__, result.physical);
	#endif
#if ((BOARD_VER>=TP10 && BOARD_VER<TP20) && (defined(CONFIG_MACH_MSM8960_EF45K) || defined(CONFIG_MACH_MSM8960_EF46L) || defined(CONFIG_MACH_MSM8960_EF47S)))
	if (!MHL_Get_Cable_State() && (mhlsii9244_adc_value > 15000	&& mhlsii9244_adc_value< 50000))
#elif (BOARD_VER>=TP20 && (defined(CONFIG_MACH_MSM8960_EF45K) || defined(CONFIG_MACH_MSM8960_EF46L) || defined(CONFIG_MACH_MSM8960_EF47S)))
	if (!MHL_Get_Cable_State() && (mhlsii9244_adc_value> 22000	&&mhlsii9244_adc_value < 50000))		
#else /*(defined(CONFIG_MACH_MSM8960_VEGAPVW) || defined(CONFIG_MACH_MSM8960_VEGAPKDDI))*/
	if (!MHL_Get_Cable_State() && (mhlsii9244_adc_valuel< 300000))
#endif
	{
	
		sii9244_cfg_power(0);
		
			pantech_hdmi_cable_detect(1);


	schedule_delayed_work(&sii9244_cable_connect_work.work, msecs_to_jiffies(100));

	mhlsii9244_adc_value = 0;

}
#if ((BOARD_VER>=TP10 && BOARD_VER<TP20) && (defined(CONFIG_MACH_MSM8960_EF45K) || defined(CONFIG_MACH_MSM8960_EF46L) || defined(CONFIG_MACH_MSM8960_EF47S)))
	else if (MHL_Get_Cable_State() && (result.physical < 15000 ||  result.physical > 50000))
#elif (BOARD_VER>=TP20 && (defined(CONFIG_MACH_MSM8960_EF45K) || defined(CONFIG_MACH_MSM8960_EF46L) || defined(CONFIG_MACH_MSM8960_EF47S)))
	else if (MHL_Get_Cable_State() && (result.physical < 22000 ||  result.physical > 50000))
#else /*(defined(CONFIG_MACH_MSM8960_VEGAPVW) || defined(CONFIG_MACH_MSM8960_VEGAPKDDI))*/
	else if (MHL_Get_Cable_State() && (result.physical > 300000))
#endif

{
	if ( get_mhl_status()== MHL_RSEN_LOW)
{
			pantech_hdmi_cable_detect(0);


				MHL_On(0);
			//	mhl_power_ctrl(0);	
						MHL_En_Control(0) ;// switch-MHL
						MHL_Set_Cable_State(MHL_CABLE_DISCONNCET);
			#ifdef MHL_DEBUG
				printk(KERN_ERR "[SKY_MHL]%s MHL cable disConnect \n",__func__);
			#endif
				sii9244_cfg_power_init();
	}
	
}
#if (BOARD_VER>=TP20 && (defined(CONFIG_MACH_MSM8960_EF45K) || defined(CONFIG_MACH_MSM8960_EF46L) || defined(CONFIG_MACH_MSM8960_EF47S)))
		if (!MHL_Get_Cable_State() && (mhlsii9244_adc_value<22000))
	{
				if (is_mhl_mode())
			{
				sii9244_cfg_power(0);
				
				pantech_hdmi_cable_detect(1);


				schedule_delayed_work(&sii9244_cable_connect_work.work, msecs_to_jiffies(100));

				mhlsii9244_adc_value = 0;
				set_flag_mhl_mode(0);
			}
	}
#endif
	return ;

}