Ejemplo n.º 1
0
static int __init sii9244_init(void)
{
	int ret;

	sii9244_cfg_gpio();	

	MHL_DEV_INFO(KERN_ERR "[SKY_MHL]+%s 3rd i2c_add_driver\n", __FUNCTION__);

	ret = i2c_add_driver(&sii9244_i2c_driver);
	if (ret != 0)
	{
		pr_err("[MHL sii9244] can't add i2c driver\n");
	}
	else{

		MHL_DEV_INFO("[MHL sii9244] add i2c driver\n");

	}
	
	ret = i2c_add_driver(&sii9244A_i2c_driver);
	if (ret != 0){
		pr_err("[MHL sii9244A] can't add i2c driver\n");
	}
	else{

		MHL_DEV_INFO("[MHL sii9244A] add i2c driver\n");

	}
	
	ret = i2c_add_driver(&sii9244B_i2c_driver);
	if (ret != 0){
		pr_err("[MHL sii9244B] can't add i2c driver\n");
	}
	else{

		MHL_DEV_INFO("[MHL sii9244B] add i2c driver\n");

	}
	
	ret = i2c_add_driver(&sii9244C_i2c_driver);
	if (ret != 0){
		pr_err("[MHL sii9244C] can't add i2c driver\n");
	}
	else{

		MHL_DEV_INFO("[MHL sii9244C] add i2c driver\n");

	}
	//mhl_power_ctrl(1); //sleep problem 
	sii9244_remote_control_init();
	sii9244_cfg_power_init();	//Turn On power to sii9244 

	return ret;	
}
Ejemplo n.º 2
0
static int __init sii9244_init(void)
{
	int ret;

	sii9244_cfg_gpio();	
#ifdef MHL_DEBUG
	printk(KERN_ERR "[SKY_MHL]+%s 3rd i2c_add_driver\n", __FUNCTION__);
#endif	
	ret = i2c_add_driver(&sii9244_i2c_driver);
	if (ret != 0)
	{
		pr_err("[MHL sii9244] can't add i2c driver\n");
	}
	else{
	#ifdef MHL_DEBUG
		printk("[MHL sii9244] add i2c driver\n");
	#endif
	}
	
	ret = i2c_add_driver(&sii9244A_i2c_driver);
	if (ret != 0){
		pr_err("[MHL sii9244A] can't add i2c driver\n");
	}
	else{
	#ifdef MHL_DEBUG
		printk("[MHL sii9244A] add i2c driver\n");
	#endif
	}
	
	ret = i2c_add_driver(&sii9244B_i2c_driver);
	if (ret != 0){
		pr_err("[MHL sii9244B] can't add i2c driver\n");
	}
	else{
	#ifdef MHL_DEBUG
		printk("[MHL sii9244B] add i2c driver\n");
	#endif
	}
	
	ret = i2c_add_driver(&sii9244C_i2c_driver);
	if (ret != 0){
		pr_err("[MHL sii9244C] can't add i2c driver\n");
	}
	else{
	#ifdef MHL_DEBUG
		printk("[MHL sii9244C] add i2c driver\n");
	#endif
	}
	mhl_power_ctrl(1);
	sii9244_remote_control_init();
	sii9244_cfg_power_init();	//Turn On power to sii9244 

	return ret;	
}
Ejemplo n.º 3
0
static int __init sii9244_init(void)
{
	int ret;

	sii9244_cfg_gpio();	

	printk(KERN_ERR "[SKY_MHL]+%s 3rd i2c_add_driver\n", __FUNCTION__);
	
	ret = i2c_add_driver(&sii9244_i2c_driver);
	if (ret != 0)
		printk("[MHL sii9244] can't add i2c driver\n");	
	else
		printk("[MHL sii9244] add i2c driver\n");
	
	ret = i2c_add_driver(&sii9244A_i2c_driver);
	if (ret != 0)
		printk("[MHL sii9244A] can't add i2c driver\n");	
	else
		printk("[MHL sii9244A] add i2c driver\n");
	
	ret = i2c_add_driver(&sii9244B_i2c_driver);
	if (ret != 0)
		printk("[MHL sii9244B] can't add i2c driver\n");	
	else
		printk("[MHL sii9244B] add i2c driver\n");
	
	ret = i2c_add_driver(&sii9244C_i2c_driver);
	if (ret != 0)
		printk("[MHL sii9244C] can't add i2c driver\n");	
	else
		printk("[MHL sii9244C] add i2c driver\n");

	sii9244_cfg_power_init();	//Turn On power to sii9244 

	return ret;	
}
Ejemplo n.º 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 ;

}