Beispiel #1
0
static int vo_open(int layer, struct file *file)
{
	int ret = 0;

	mutex_lock(mutex_for_fo);

	/* check tvout path available!! */
	if (!s5ptv_status.tvout_output_enable) {
		BASEPRINTK("check tvout start !!\n");
		ret =  -EACCES;
		goto resource_busy;
	}

	if (s5ptv_status.grp_layer_enable[layer]) {
		BASEPRINTK("grp %d layer is busy!!\n", layer);
		ret =  -EBUSY;
		goto resource_busy;
	}

	/* set layer info.!! */
	s5ptv_overlay[layer].index = layer;

	/* set file private data.!! */
	file->private_data = &s5ptv_overlay[layer];

	mutex_unlock(mutex_for_fo);

	return 0;

resource_busy:
	mutex_unlock(mutex_for_fo);

	return ret;
}
static int s5p_tv_v_open(struct file *file)
{
	int ret = 0;

	mutex_lock(g_mutex_for_fo);

	if (g_s5ptv_status.tvout_output_enable) {
		pr_err("%s::tvout drv. already used !!\n", __func__);
		ret =  -EBUSY;
		goto drv_used;
	}

#ifdef CONFIG_PM
	if ((g_s5ptv_status.hpd_status) && !(g_s5ptv_status.suspend_status)) {
		BASEPRINTK("tv is turned on\n");
#endif
		s5p_set_qos();
		s5p_tv_base_clk_gate(true);
		s5p_tv_base_phy_power(true);
#ifdef CONFIG_PM
	} else
		BASEPRINTK("tv is off\n");
#endif
	s5p_tv_if_init_param();

	s5p_tv_v4l2_init_param();

	mutex_unlock(g_mutex_for_fo);

	return 0;

drv_used:
	mutex_unlock(g_mutex_for_fo);
	return ret;
}
Beispiel #3
0
/*
 *  Resume
 */
int s5p_tv_late_resume(struct platform_device *dev)
{
    BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status);

    mutex_lock(mutex_for_fo);
    s5ptv_status.suspend_status = false;

    if(!(s5ptv_status.hpd_status))
    {
	    mutex_unlock(mutex_for_fo);
	    return 0;
    }
    else
    {
#if 0
    #ifdef CONFIG_CPU_FREQ
    #ifdef CONFIG_CPU_MAX_FREQ_1GHZ // 2010.3.9.
        s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 3);
    #else
        s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 2);
    #endif
    #endif
#endif
    #ifdef CONFIG_PM_PWR_GATING
        /* clk & power on */
        s5p_tv_clk_gate( true );
        if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
            tv_phy_power( true );
    #endif

	/* tv on */
	if ( s5ptv_status.tvout_output_enable ) {
		_s5p_tv_if_start();
	}

	/* video layer start */
	if ( s5ptv_status.vp_layer_enable )
		_s5p_vlayer_start();

	/* grp0 layer start */
	if ( s5ptv_status.grp_layer_enable[0] )
		_s5p_grp_start(VM_GPR0_LAYER);

	/* grp1 layer start */
	if ( s5ptv_status.grp_layer_enable[1] )
		_s5p_grp_start(VM_GPR1_LAYER);

#ifdef CONFIG_TV_FB
	if ( s5ptv_status.tvout_output_enable ) {
		s5ptvfb_display_on(&s5ptv_status);
		s5ptvfb_set_par(s5ptv_status.fb);
	}
#endif
    }
    mutex_unlock(mutex_for_fo);
    BASEPRINTK("()--\n");
    return 0;
}
Beispiel #4
0
/*
 *  Suspend
 */
int s5p_tv_early_suspend(struct platform_device *dev, pm_message_t state)
{
    BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status);

    mutex_lock(mutex_for_fo);
    s5ptv_status.suspend_status = true;

    if(!(s5ptv_status.hpd_status))
    {
	    mutex_unlock(mutex_for_fo);
	    return 0;
    }
    else
    {
	    /* video layer stop */
	    if ( s5ptv_status.vp_layer_enable ) {
		    _s5p_vlayer_stop();
		    s5ptv_status.vp_layer_enable = true;

	    }

	    /* grp0 layer stop */
	    if ( s5ptv_status.grp_layer_enable[0] ) {
		    _s5p_grp_stop(VM_GPR0_LAYER);
		    s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
	    }

	    /* grp1 layer stop */
	    if ( s5ptv_status.grp_layer_enable[1] ) {
		    _s5p_grp_stop(VM_GPR1_LAYER);
		    s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
	    }

	    if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB
			|| s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_DVI)
		    tv_phy_power( false );
	    
	   
	    /* tv off */
	    if ( s5ptv_status.tvout_output_enable ) {
		    _s5p_tv_if_stop();
		    s5ptv_status.tvout_output_enable = true;
		    s5ptv_status.tvout_param_available = true;
	    }

	    /* clk & power off */
	    s5p_tv_clk_gate( false );


#ifdef CONFIG_CPU_FREQ_S5PV210
	    s5pv210_set_cpufreq_level(NORMAL_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */
    }

    mutex_unlock(mutex_for_fo);
    BASEPRINTK("()--\n");
    return 0;
}
Beispiel #5
0
/*
 *  Suspend
 */
int s5p_tv_early_suspend(struct platform_device *dev, pm_message_t state)
{
    BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status);

    mutex_lock(mutex_for_fo);
    s5ptv_status.suspend_status = true;

    if(!(s5ptv_status.hpd_status))
    {
	    mutex_unlock(mutex_for_fo);
	    return 0;
    }
    else
    {
	    /* video layer stop */
	    if ( s5ptv_status.vp_layer_enable ) {
		    _s5p_vlayer_stop();
		    s5ptv_status.vp_layer_enable = true;

	    }

	    /* grp0 layer stop */
	    if ( s5ptv_status.grp_layer_enable[0] ) {
		    _s5p_grp_stop(VM_GPR0_LAYER);
		    s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
	    }

	    /* grp1 layer stop */
	    if ( s5ptv_status.grp_layer_enable[1] ) {
		    _s5p_grp_stop(VM_GPR1_LAYER);
		    s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
	    }

	    /* tv off */
	    if ( s5ptv_status.tvout_output_enable ) {
		    _s5p_tv_if_stop();
		    s5ptv_status.tvout_output_enable = true;
		    s5ptv_status.tvout_param_available = true;
	    }

#ifdef CONFIG_PM_PWR_GATING
	    /* clk & power off */
	    s5p_tv_clk_gate( false );
	    if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
		    tv_phy_power( false );
#endif
#if 0
#ifdef CONFIG_CPU_FREQ
	    s5pc110_unlock_dvfs_high_level(DVFS_LOCK_TOKEN_4);
#endif
#endif    
    }

    mutex_unlock(mutex_for_fo);
    BASEPRINTK("()--\n");
    return 0;
}
Beispiel #6
0
/*
 *  Resume
 */
int s5p_tv_late_resume(struct platform_device *dev)
{
    BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status);

    mutex_lock(mutex_for_fo);
    s5ptv_status.suspend_status = false;

	if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB
		|| s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_DVI)
		s5p_handle_cable();

    if(!(s5ptv_status.hpd_status))
    {
	    mutex_unlock(mutex_for_fo);
	    return 0;
    }
    else
    {
#ifdef CONFIG_CPU_FREQ_S5PV210
		s5pv210_set_cpufreq_level(RESTRICT_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */

	/* clk & power on */
	s5p_tv_clk_gate( true );
	if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB
		|| s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_DVI)
	    tv_phy_power( true );

	/* tv on */
	if (s5ptv_status.tvout_output_enable) {
		_s5p_tv_if_start();
	}

	/* video layer start */
	if (s5ptv_status.vp_layer_enable)
		_s5p_vlayer_start();

	/* grp0 layer start */
	if (s5ptv_status.grp_layer_enable[0])
		_s5p_grp_start(VM_GPR0_LAYER);

	/* grp1 layer start */
	if (s5ptv_status.grp_layer_enable[1])
		_s5p_grp_start(VM_GPR1_LAYER);

#ifdef CONFIG_TV_FB
	if (s5ptv_status.tvout_output_enable) {
		s5ptvfb_display_on(&s5ptv_status);
		s5ptvfb_set_par(s5ptv_status.fb);
	}
#endif
    }
    mutex_unlock(mutex_for_fo);
    BASEPRINTK("()--\n");
    return 0;
}
Beispiel #7
0
/*
 *  Suspend
 */
void s5p_tv_early_suspend(struct early_suspend *h)
{
	BASEPRINTK("%s----------------start \n", __func__);

	mutex_lock(mutex_for_fo);
	s5ptv_status.suspend_status = true;

	if (!(s5ptv_status.hpd_status)) {
		printk(KERN_INFO "(hpd_status = %d)++\n", \
				s5ptv_status.hpd_status);
		mutex_unlock(mutex_for_fo);
		return ;
	} else  {
		/* video layer stop */
		if (s5ptv_status.vp_layer_enable) {
			_s5p_vlayer_stop();
			s5ptv_status.vp_layer_enable = true;
		}

		/* grp0 layer stop */
		if (s5ptv_status.grp_layer_enable[0]) {
			_s5p_grp_stop(VM_GPR0_LAYER);
			s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
		}

		/* grp1 layer stop */
		if (s5ptv_status.grp_layer_enable[1]) {
			_s5p_grp_stop(VM_GPR1_LAYER);
			s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
		}

		/* tv off */
		if (s5ptv_status.tvout_output_enable) {
			_s5p_tv_if_stop();
			s5ptv_status.tvout_output_enable = true;
			s5ptv_status.tvout_param_available = true;
		}

		/* clk & power off */
		s5p_tv_clk_gate(false);
		if ((s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI) ||\
		(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB))
			tv_phy_power(false);

#ifdef CONFIG_CPU_FREQ_S5PV210
		s5pv210_set_cpufreq_level(NORMAL_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */
	}

	mutex_unlock(mutex_for_fo);
	BASEPRINTK("()--\n");
	return ;
}
Beispiel #8
0
/*
 *  Resume
 */
void s5p_tv_late_resume(struct early_suspend *h)
{
	BASEPRINTK("%s----------------start \n", __func__);

	mutex_lock(mutex_for_fo);
	s5ptv_status.suspend_status = false;

	if (!(s5ptv_status.hpd_status)) {
		printk(KERN_INFO "(hpd_status = %d)++\n", \
				s5ptv_status.hpd_status);
		mutex_unlock(mutex_for_fo);
		return ;
	} else {
#ifdef CONFIG_CPU_FREQ_S5PV210
		s5pv210_set_cpufreq_level(RESTRICT_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */

		/* clk & power on */
		s5p_tv_clk_gate(true);
		if ((s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI) ||\
		(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB))
			tv_phy_power(true);

		/* tv on */
		if (s5ptv_status.tvout_output_enable)
			_s5p_tv_if_start();

		/* video layer start */
		if (s5ptv_status.vp_layer_enable)
			_s5p_vlayer_start();

		/* grp0 layer start */
		if (s5ptv_status.grp_layer_enable[0])
			_s5p_grp_start(VM_GPR0_LAYER);

		/* grp1 layer start */
		if (s5ptv_status.grp_layer_enable[1])
			_s5p_grp_start(VM_GPR1_LAYER);

#ifdef CONFIG_TV_FB
		if (s5ptv_status.tvout_output_enable) {
			s5ptvfb_display_on(&s5ptv_status);
			s5ptvfb_set_par(s5ptv_status.fb);
		}
#endif
	}
	mutex_unlock(mutex_for_fo);
	BASEPRINTK("()--\n");
	return ;
}
int s5p_tv_base_clk_gate(bool on)
{
	int err = 0;

	BASEPRINTK("tv clks are: %d\n", on);
	if (g_clks_enabled == on)
		return 0;

	if (on == true) {
		err = regulator_enable(g_s5ptv_status.regulator);
		if (err) {
			pr_err("Failed to enable regulator of tvout\n");
			return -1;
		}
		clk_enable(g_s5ptv_status.vp_clk);
		clk_enable(g_s5ptv_status.mixer_clk);
		clk_enable(g_s5ptv_status.tvenc_clk);
		clk_enable(g_s5ptv_status.hdmi_clk);
	} else {
		/* off */
		clk_disable(g_s5ptv_status.vp_clk);
		clk_disable(g_s5ptv_status.mixer_clk);
		clk_disable(g_s5ptv_status.tvenc_clk);
		clk_disable(g_s5ptv_status.hdmi_clk);
		err = regulator_disable(g_s5ptv_status.regulator);
		if (err) {
			pr_err("Failed to disable regulator of tvout\n");
			return -1;
		}
	}

	g_clks_enabled = on;

	return 0;
}
Beispiel #10
0
static irqreturn_t __s5p_hpd_irq(int irq, void *dev_id)
{

	spin_lock_irq(&slock_hpd);
	
	s5ptv_status.hpd_status = gpio_get_value(S5PC1XX_GPH0(5)) 
		? false:true;

	if(s5ptv_status.hpd_status){
		
		set_irq_type(IRQ_EINT5, IRQ_TYPE_EDGE_RISING);
		
	}else{
		set_irq_type(IRQ_EINT5, IRQ_TYPE_EDGE_FALLING);			

	}

	if (s5ptv_status.hdcp_en)
		schedule_work(&ws_hpd);

	spin_unlock_irq(&slock_hpd);

	BASEPRINTK("hpd_status = %d\n", s5ptv_status.hpd_status);
			
	return IRQ_HANDLED;
}
void s5p_tv_early_suspend(struct early_suspend *h)
{
	BASEPRINTK("(hpd_status = %d)++\n", g_s5ptv_status.hpd_status);

	mutex_lock(g_mutex_for_fo);
	g_s5ptv_status.suspend_status = true;

	if (g_s5ptv_status.hpd_status == true) {
		/* video layer stop */
		if (g_s5ptv_status.vp_layer_enable) {
			s5p_vlayer_stop();
			g_s5ptv_status.vp_layer_enable = true;
		}

		/* grp0 layer stop */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER]) {
			s5p_grp_stop(VM_GPR0_LAYER);
			g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
		}

		/* grp1 layer stop */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER]) {
			s5p_grp_stop(VM_GPR1_LAYER);
			g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER] = true;
		}

		/* tv off */
		if (g_s5ptv_status.tvout_output_enable) {
			s5p_tv_if_stop();
			g_s5ptv_status.tvout_output_enable = true;
			g_s5ptv_status.tvout_param_available = true;
		}

		/* clk & power off */
		s5p_tv_base_clk_gate(false);
		if (g_s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI ||
		    g_s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
			s5p_tv_base_phy_power(false);
	}

	mutex_unlock(g_mutex_for_fo);
	BASEPRINTK("()--\n");
	return;
}
void s5p_tv_late_resume(struct early_suspend *h)
{
	BASEPRINTK("(hpd_status = %d)++\n", g_s5ptv_status.hpd_status);

	mutex_lock(g_mutex_for_fo);
	g_s5ptv_status.suspend_status = false;

	if (g_s5ptv_status.hpd_status == true) {
		/* clk & power on */
		s5p_tv_base_clk_gate(true);
		if (g_s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI ||
		    g_s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
			s5p_tv_base_phy_power(true);

		/* tv on */
		if (g_s5ptv_status.tvout_output_enable)
			s5p_tv_if_start();

		/* video layer start */
		if (g_s5ptv_status.vp_layer_enable)
			s5p_vlayer_start();

		/* grp0 layer start */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER])
			s5p_grp_start(VM_GPR0_LAYER);

		/* grp1 layer start */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER])
			s5p_grp_start(VM_GPR1_LAYER);

#ifdef CONFIG_TV_FB
		if (g_s5ptv_status.tvout_output_enable) {
			s5ptvfb_display_on(&g_s5ptv_status);
			s5ptvfb_set_par(g_s5ptv_status.fb);
		}
#endif
	}
	mutex_unlock(g_mutex_for_fo);
	BASEPRINTK("()--\n");
	return;
}
Beispiel #13
0
//MHL v1 //NAGSM_Android_SEL_Kernel_Aakash_20101126
void rcp_cbus_uevent(u8 rcpCode)	//NAGSM_Android_SEL_Kernel_Aakash_20101206
{
	char env_buf[120];
	char *envp[2];
	int env_offset = 0;

	memset(env_buf, 0, sizeof(env_buf));
	BASEPRINTK("\n RCP Message Recvd \n");
	sprintf(env_buf, "MHL_RCP=%x", rcpCode);	//NAGSM_Android_SEL_Kernel_Aakash_20101206
	envp[env_offset++] = env_buf;
	envp[env_offset] = NULL;
	kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
	return;


}
Beispiel #14
0
static irqreturn_t __s5p_hpd_irq(int irq, void *dev_id)
{



	if(gpio_get_value(S5PC11X_GPH1(5)))
	{
	printk("\n cable inserted \n");
	set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_FALLING);
	}
	else
	{
	printk("\n cable removed\n");
	set_irq_type(IRQ_EINT13,IRQ_TYPE_EDGE_RISING);
	}

#if 0
	spin_lock_irq(&slock_hpd);
	
#ifdef CONFIG_CPU_S5PC110
//mkh:
s5ptv_status.hpd_status = gpio_get_value(S5PC11X_GPH0(5))
                ? false:true;
#else
	s5ptv_status.hpd_status = gpio_get_value(S5PC1XX_GPH0(5)) 
		? false:true;
#endif	
	if(s5ptv_status.hpd_status){
		
		set_irq_type(IRQ_EINT5, IRQ_TYPE_EDGE_RISING);
		
	}else{
		set_irq_type(IRQ_EINT5, IRQ_TYPE_EDGE_FALLING);			

	}

	if (s5ptv_status.hdcp_en)
		schedule_work(&ws_hpd);

	spin_unlock_irq(&slock_hpd);

	BASEPRINTK("hpd_status = %d\n", s5ptv_status.hpd_status);
#endif		
	return IRQ_HANDLED;
}
void s5p_tv_base_handle_cable(void)
{
	char env_buf[120];
	char *envp[2];
	int env_offset = 0;
	bool previous_hpd_status = g_s5ptv_status.hpd_status;

#ifdef CONFIG_HDMI_HPD
#else
	return;
#endif

	switch (g_s5ptv_status.tvout_param.out_mode) {
	case TVOUT_OUTPUT_HDMI:
	case TVOUT_OUTPUT_HDMI_RGB:
	case TVOUT_OUTPUT_DVI:
		break;
	default:
		return;
	}

	g_s5ptv_status.hpd_status = s5p_hpd_get_state();

	if (previous_hpd_status == g_s5ptv_status.hpd_status) {
		pr_err("same hpd_status value: %d\n", previous_hpd_status);
		return;
	}

	memset(env_buf, 0, sizeof(env_buf));

	if (g_s5ptv_status.hpd_status == true) {
		BASEPRINTK("\n hdmi cable is connected\n");
		sprintf(env_buf, "HDMI_STATE=online");
		envp[env_offset++] = env_buf;
		envp[env_offset] = NULL;

		s5p_set_qos();

		if (g_s5ptv_status.suspend_status) {
			kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
			return;
		}

#ifdef CONFIG_PM
		s5p_tv_base_clk_gate(true);
		s5p_tv_base_phy_power(true);
#endif
		/* tv on */
		if (g_s5ptv_status.tvout_output_enable)
			s5p_tv_if_start();

		/* video layer start */
		if (g_s5ptv_status.vp_layer_enable)
			s5p_vlayer_start();

		/* grp0 layer start */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER])
			s5p_grp_start(VM_GPR0_LAYER);

		/* grp1 layer start */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER])
			s5p_grp_start(VM_GPR1_LAYER);

	} else {
		BASEPRINTK("\n hdmi cable is disconnected\n");
		sprintf(env_buf, "HDMI_STATE=offline");
		envp[env_offset++] = env_buf;
		envp[env_offset] = NULL;

		s5p_restore_qos();

		if (g_s5ptv_status.suspend_status) {
			kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
			return;
		}

		if (g_s5ptv_status.vp_layer_enable) {
			s5p_vlayer_stop();
			g_s5ptv_status.vp_layer_enable = true;
		}

		/* grp0 layer stop */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER]) {
			s5p_grp_stop(VM_GPR0_LAYER);
			g_s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
		}

		/* grp1 layer stop */
		if (g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER]) {
			s5p_grp_stop(VM_GPR1_LAYER);
			g_s5ptv_status.grp_layer_enable[VM_GPR1_LAYER] = true;
		}

		/* tv off */
		if (g_s5ptv_status.tvout_output_enable) {
			s5p_tv_if_stop();
			g_s5ptv_status.tvout_output_enable = true;
			g_s5ptv_status.tvout_param_available = true;
		}

#ifdef CONFIG_PM
		/* clk & power off */
		s5p_tv_base_clk_gate(false);
		s5p_tv_base_phy_power(false);
#endif
	}
	kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
}
Beispiel #16
0
/*
 * ftn for video
 */
static int s5p_tv_v_open(struct file *file)
{
	int ret = 0,err;
	unsigned int status;
	ref_count_tv ++ ;
	mutex_lock(mutex_for_fo);

	if (s5ptv_status.tvout_output_enable) {
		mutex_unlock(mutex_for_fo);
		goto re_open;
		BASEPRINTK("tvout drv. already used !!\n");
		ret =  -EBUSY;
		goto drv_used;
	}

#ifdef CONFIG_CPU_S5PC110
	s5p_tv_clk_gate( true );
#endif
	
#ifdef CONFIG_CPU_S5PC110

#if defined(CONFIG_S5PC110_KEPLER_BOARD)//Kepler

	err = gpio_request(S5PC11X_GPJ4(4),"TV_EN");
	udelay(50);
	gpio_direction_output(S5PC11X_GPJ4(4),1);
	gpio_set_value(S5PC11X_GPJ4(4),1);
	udelay(50);

	err = gpio_request(S5PC11X_GPJ2(6),"EAR_SEL");
	udelay(50);
	gpio_direction_output(S5PC11X_GPJ2(6),0);
	gpio_set_value(S5PC11X_GPJ2(6),0);
	udelay(50);

#elif (defined CONFIG_S5PC110_T959_BOARD)//T959
	status=get_headset_status();
	printk("s5p_tv_v_open: get_headset_status:%d\n",status);
	
	if((SEC_HEADSET_3_POLE_DEVICE==status)||(SEC_TVOUT_DEVICE==status))
	{
		printk("EAR_SEL:Low\n");
		err = gpio_request(S5PC11X_GPJ2(6),"EAR_SEL"); //GPIO_EARPATH_SEL
		udelay(50);
		gpio_direction_output(S5PC11X_GPJ2(6),0);
		gpio_set_value(S5PC11X_GPJ2(6),0);
		udelay(50);
	}
	else if(SEC_HEADSET_4_POLE_DEVICE==status)
	{
		printk("EAR_SEL:High\n");
		err = gpio_request(S5PC11X_GPJ2(6),"EAR_SEL"); //GPIO_EARPATH_SEL
		udelay(50);
		gpio_direction_output(S5PC11X_GPJ2(6),0);
		gpio_set_value(S5PC11X_GPJ2(6),1);
		udelay(50);
	}

#endif

#endif

	_s5p_tv_if_init_param();

	s5p_tv_v4l2_init_param();

	mutex_unlock(mutex_for_fo);
	#if 0
	mutex_lock(mutex_for_i2c);
	/* for ddc(hdcp port) */
	if(s5ptv_status.hpd_status) {
		if (i2c_add_driver(&hdcp_i2c_driver)) 
			BASEPRINTK("HDCP port add failed\n");
		hdcp_i2c_drv_state = true;
	} else 
		hdcp_i2c_drv_state = false;

	mutex_unlock(mutex_for_i2c);
	#endif
	printk("\n\nTV open success\n\n");
re_open:
	/* for i2c probing */
	udelay(100);
	
	return 0;

drv_used:
	mutex_unlock(mutex_for_fo);
	return ret;
}
Beispiel #17
0
/*
 * ftn for video
 */
static int s5p_tv_v_open(struct file *file)
{
	int ret = 0,err;

	mutex_lock(mutex_for_fo);

	if (s5ptv_status.tvout_output_enable) {
		BASEPRINTK("tvout drv. already used !!\n");
		ret =  -EBUSY;
		goto drv_used;
	}

#ifdef CONFIG_CPU_S5PV210
#ifdef CONFIG_PM_PWR_GATING 
	if((s5ptv_status.hpd_status) && !(s5ptv_status.suspend_status))
	{
		BASEPRINTK("tv is turned on\n");
#endif
#if 0
#ifdef CONFIG_CPU_FREQ
#ifdef CONFIG_CPU_MAX_FREQ_1GHZ // 2010.3.9.
		if((s5ptv_status.hpd_status))
			s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 3);    
#else
		if((s5ptv_status.hpd_status))
			s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 2);
#endif
#endif
#endif

#if defined(CONFIG_S5PC110_SIDEKICK_BOARD)	
	err = gpio_request(S5PV210_GPJ3(1),"EAR_SEL");
	udelay(50);
	gpio_direction_output(S5PV210_GPJ3(1),0);
	gpio_set_value(S5PV210_GPJ3(1),0);
	udelay(50);
#elif defined(CONFIG_S5PC110_DEMPSEY_BOARD)
//there is no connected pin
#else
	err = gpio_request(S5PV210_GPJ4(4),"TV_EN");
	udelay(50);
	gpio_direction_output(S5PV210_GPJ4(4),1);
	gpio_set_value(S5PV210_GPJ4(4),1);
	udelay(50);

	err = gpio_request(S5PV210_GPJ2(6),"EAR_SEL");
	udelay(50);
	gpio_direction_output(S5PV210_GPJ2(6),0);
	gpio_set_value(S5PV210_GPJ2(6),0);
	udelay(50);
#endif
	
		s5p_tv_clk_gate( true );
		tv_phy_power( true );
#ifdef CONFIG_PM_PWR_GATING
	}
	else
		BASEPRINTK("tv is off\n");
#endif
#endif
	_s5p_tv_if_init_param();

	s5p_tv_v4l2_init_param();

	mutex_unlock(mutex_for_fo);

	/* c110 test */	//s5ptv_status.hpd_status = true;

  printk("\n\nTV open success\n\n");

#ifdef I2C_BASE
	mutex_lock(mutex_for_i2c);
	/* for ddc(hdcp port) */
	if(s5ptv_status.hpd_status) {
		if (i2c_add_driver(&hdcp_i2c_driver)) 
			BASEPRINTK("HDCP port add failed\n");
		hdcp_i2c_drv_state = true;
	} else 
		hdcp_i2c_drv_state = false;

	mutex_unlock(mutex_for_i2c);
	/* for i2c probing */
	udelay(100);
#endif

	return 0;

drv_used:
	mutex_unlock(mutex_for_fo);
	return ret;
}
Beispiel #18
0
void s5p_handle_cable(void)
{
    char env_buf[120];
    char *envp[2];
    int env_offset = 0;

#if defined (CONFIG_S5PC110_DEMPSEY_BOARD)				//MHL v1 //NAGSM_Android_SEL_Kernel_Aakash_20101130

#else
    if(s5ptv_status.tvout_param.out_mode != TVOUT_OUTPUT_HDMI && s5ptv_status.tvout_param.out_mode != TVOUT_OUTPUT_HDMI_RGB)
        return;
#endif

    bool previous_hpd_status = s5ptv_status.hpd_status;
#ifdef CONFIG_HDMI_HPD
    s5ptv_status.hpd_status= s5p_hpd_get_state();
#else
    return;
#endif
    
    memset(env_buf, 0, sizeof(env_buf));

    if(previous_hpd_status == s5ptv_status.hpd_status)
    {
        BASEPRINTK("same hpd_status value: %d\n", previous_hpd_status);
        return;
    }

    if(s5ptv_status.hpd_status)
    {
        BASEPRINTK("\n hdmi cable is connected \n");			
        if(s5ptv_status.suspend_status)
            return;

#if 0
    #ifdef CONFIG_CPU_FREQ
    #ifdef CONFIG_CPU_MAX_FREQ_1GHZ // 2010.3.9.
        s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 3);
    #else
        s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 2);    
    #endif
    #endif
#endif

    #ifdef CONFIG_PM_PWR_GATING
        s5p_tv_clk_gate( true );
        tv_phy_power( true );
    #endif
        /* tv on */
        if ( s5ptv_status.tvout_output_enable )
                _s5p_tv_if_start();

        /* video layer start */
        if ( s5ptv_status.vp_layer_enable )
                _s5p_vlayer_start();

        /* grp0 layer start */
        if ( s5ptv_status.grp_layer_enable[0] )
                _s5p_grp_start(VM_GPR0_LAYER);

        /* grp1 layer start */
        if ( s5ptv_status.grp_layer_enable[1] )
                _s5p_grp_start(VM_GPR1_LAYER);

        sprintf(env_buf, "HDMI_STATE=online");
        envp[env_offset++] = env_buf;
        envp[env_offset] = NULL;
        kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
    }
    else{
        BASEPRINTK("\n hdmi cable is disconnected \n");
        
        if(s5ptv_status.suspend_status)
            return;

        sprintf(env_buf, "HDMI_STATE=offline");
        envp[env_offset++] = env_buf;
        envp[env_offset] = NULL;
        kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);

        if ( s5ptv_status.vp_layer_enable ) {
            _s5p_vlayer_stop();
            s5ptv_status.vp_layer_enable = true;

        }

        /* grp0 layer stop */
        if ( s5ptv_status.grp_layer_enable[0] ) {
            _s5p_grp_stop(VM_GPR0_LAYER);
            s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
        }

        /* grp1 layer stop */
        if ( s5ptv_status.grp_layer_enable[1] ) {
            _s5p_grp_stop(VM_GPR1_LAYER);
            s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
        }

        /* tv off */
        if ( s5ptv_status.tvout_output_enable ) {
            _s5p_tv_if_stop();
            s5ptv_status.tvout_output_enable = true;
            s5ptv_status.tvout_param_available = true;
        }

    #ifdef CONFIG_PM_PWR_GATING
        /* clk & power off */
        s5p_tv_clk_gate( false );
        tv_phy_power( false );
    #endif

#if 0
    #ifdef CONFIG_CPU_FREQ
        s5pc110_unlock_dvfs_high_level(DVFS_LOCK_TOKEN_4);
    #endif
#endif    
    }
        
}
Beispiel #19
0
/*
 * ftn for video
 */
static int s5p_tv_v_open(struct file *file)
{
	int ret = 0;
	printk("[TVOUT]s5p_tv_v_open ++\n");
	TVout_LDO_ctrl(true);
	Isdrv_open = 1;
	mutex_lock(mutex_for_fo);

	if (s5ptv_status.tvout_output_enable) {
		BASEPRINTK("tvout drv. already used !!\n");
		ret =  -EBUSY;
		goto drv_used;
	}

		s5p_tv_clk_gate( true );
		

#ifdef CONFIG_CPU_S5PV210
#ifdef CONFIG_PM 
	if((s5ptv_status.hpd_status) && !(s5ptv_status.suspend_status))
	{
		BASEPRINTK("tv is turned on\n");
#endif
#ifdef CONFIG_CPU_FREQ_S5PV210
		if((s5ptv_status.hpd_status))
			s5pv210_set_cpufreq_level(RESTRICT_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */
		//s5p_tv_clk_gate( true );
		//if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
		//tv_phy_power( true );
#ifdef CONFIG_PM
	}
	else
		BASEPRINTK("tv is off\n");
#endif
#endif
	_s5p_tv_if_init_param();

	s5p_tv_v4l2_init_param();

	mutex_unlock(mutex_for_fo);

#ifdef I2C_BASE
	mutex_lock(mutex_for_i2c);
	/* for ddc(hdcp port) */
	if (s5ptv_status.hpd_status) {
		if (i2c_add_driver(&hdcp_i2c_driver))
			BASEPRINTK("HDCP port add failed\n");
		hdcp_i2c_drv_state = true;
	} else
		hdcp_i2c_drv_state = false;

	mutex_unlock(mutex_for_i2c);
	/* for i2c probing */
	udelay(100);
#endif

	//if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
		tv_phy_power( true );

	return 0;

drv_used:
	mutex_unlock(mutex_for_fo);
	return ret;
}
Beispiel #20
0
/*
 *  Suspend
 */
int s5p_tv_early_suspend(struct platform_device *dev, pm_message_t state)
{
    BASEPRINTK("(hpd_status = %d)++\n", s5ptv_status.hpd_status);

    mutex_lock(mutex_for_fo);
    s5ptv_status.suspend_status = true;
    suspend_resume_sync = 1;
    printk(KERN_INFO "s5p_tv_early suspend executing..\n");
#ifdef CABLE_CHECK
          //s5p_hpd_set_state(HPD_SLEEP);
    if (s5p_hpd_get_state()) {
        hpd_sleep_state = 0;
        set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_FALLING);
    } else {
        hpd_sleep_state = 1;
        set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_RISING);
    }
#endif
    if(!(s5ptv_status.hpd_status))
    {
        printk(KERN_INFO "s5p_tv_early_suspend returned no HDMI connected\n");
	    mutex_unlock(mutex_for_fo);
        return 0;
    }
    else
    {
                 IsPower_on = false;
                 TVout_LDO_ctrl(true);
	    /* video layer stop */
	    if ( s5ptv_status.vp_layer_enable ) {
		    _s5p_vlayer_stop();
		    s5ptv_status.vp_layer_enable = true;

	    }

	    /* grp0 layer stop */
	    if ( s5ptv_status.grp_layer_enable[0] ) {
		    _s5p_grp_stop(VM_GPR0_LAYER);
		    s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
	    }

	    /* grp1 layer stop */
	    if ( s5ptv_status.grp_layer_enable[1] ) {
		    _s5p_grp_stop(VM_GPR1_LAYER);
		    s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
	    }

	    if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB
			|| s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_DVI)
		    tv_phy_power( false );
	    
	   
	    /* tv off */
	    if ( s5ptv_status.tvout_output_enable ) {
		    _s5p_tv_if_stop();
		    s5ptv_status.tvout_output_enable = true;
		    s5ptv_status.tvout_param_available = true;
	    }

	    /* clk & power off */
	    s5p_tv_clk_gate( false );


#ifdef CONFIG_CPU_FREQ_S5PV210
	    s5pv210_set_cpufreq_level(NORMAL_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */
    }

    mutex_unlock(mutex_for_fo);
    BASEPRINTK("()--\n");
    return 0;
}
Beispiel #21
0
void s5p_handle_cable(void)
{
    char env_buf[120];
    char *envp[2];
    int env_offset = 0;

	#if 0
    if(s5ptv_status.tvout_param.out_mode != TVOUT_OUTPUT_HDMI && s5ptv_status.tvout_param.out_mode != TVOUT_OUTPUT_HDMI_RGB)
        return;
#endif

    bool previous_hpd_status = s5ptv_status.hpd_status;
#ifdef CONFIG_HDMI_HPD
    s5ptv_status.hpd_status= s5p_hpd_get_state();
#else
    return;
#endif
    
    memset(env_buf, 0, sizeof(env_buf));

    if(previous_hpd_status == s5ptv_status.hpd_status)
    {
        BASEPRINTK("same hpd_status value: %d\n", previous_hpd_status);
        return;
    }

    if(s5ptv_status.hpd_status)
    {
    	
        BASEPRINTK("\n hdmi cable is connected \n");
		sprintf(env_buf, "HDMI_STATE=online");
		envp[env_offset++] = env_buf;
		envp[env_offset] = NULL;
		kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
        
        if(s5ptv_status.suspend_status)
            return;

#ifdef CONFIG_CPU_FREQ_S5PV210
        s5pv210_set_cpufreq_level(RESTRICT_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */

 				s5p_tv_clk_gate( true );
				//if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
        	//	tv_phy_power( true );

    #ifdef CONFIG_PM
    #if 0
        s5p_tv_clk_gate( true );
		if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
        tv_phy_power( true );
    #endif
    #endif
        /* tv on */
        if ( s5ptv_status.tvout_output_enable )
                _s5p_tv_if_start();

        /* video layer start */
        if ( s5ptv_status.vp_layer_enable )
                _s5p_vlayer_start();

        /* grp0 layer start */
        if ( s5ptv_status.grp_layer_enable[0] )
                _s5p_grp_start(VM_GPR0_LAYER);

        /* grp1 layer start */
        if ( s5ptv_status.grp_layer_enable[1] )
                _s5p_grp_start(VM_GPR1_LAYER);
		
		
		printk("[TVOUT]hdmi cable is connected\n");
    }
    else{
		
        BASEPRINTK("\n hdmi cable is disconnected \n");

	#if 1
        if(s5ptv_status.suspend_status)
        {
			//if(gpio_get_value(GPIO_ACCESSORY_INT))
			{
				s5p_tv_clk_gate( true );
				tv_phy_power( true );
			}
 			//else
            //	return;
        }
	#endif 
        if ( s5ptv_status.vp_layer_enable ) {
            _s5p_vlayer_stop();
            s5ptv_status.vp_layer_enable = true;

        }

        /* grp0 layer stop */
        if ( s5ptv_status.grp_layer_enable[0] ) {
            _s5p_grp_stop(VM_GPR0_LAYER);
            s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
        }

        /* grp1 layer stop */
        if ( s5ptv_status.grp_layer_enable[1] ) {
            _s5p_grp_stop(VM_GPR1_LAYER);
            s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
        }

        /* tv off */
        if ( s5ptv_status.tvout_output_enable ) {
            _s5p_tv_if_stop();
            s5ptv_status.tvout_output_enable = false;
            s5ptv_status.tvout_param_available = false;
        }

    #ifdef CONFIG_PM
        /* clk & power off */
        s5p_tv_clk_gate( false );
  //if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
    //    tv_phy_power( false );
    #endif

		sprintf(env_buf, "HDMI_STATE=offline");
		envp[env_offset++] = env_buf;
		envp[env_offset] = NULL;
		kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
		printk("[TVOUT]hdmi cable is disconnected\n");

#ifdef CONFIG_CPU_FREQ_S5PV210
        s5pv210_set_cpufreq_level(NORMAL_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */
    }
}
Beispiel #22
0
void s5p_handle_cable(void)
{
    char env_buf[120];
    char *envp[2];
    int env_offset = 0;

	#if 0
    if(s5ptv_status.tvout_param.out_mode != TVOUT_OUTPUT_HDMI && s5ptv_status.tvout_param.out_mode != TVOUT_OUTPUT_HDMI_RGB)
        return;
#endif
   int previous_hpd_status = s5ptv_status.hpd_status;
#ifdef CONFIG_HDMI_HPD
    if (s5p_hpd_get_state()) {
        s5ptv_status.hpd_status = 1;
        set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_FALLING);
        if (suspend_resume_sync == 2)
            suspend_resume_sync = 0;

    } else {
        s5ptv_status.hpd_status = 0;
        set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_RISING); 
    }

//    s5ptv_status.hpd_status= gpio_get_value(S5PV210_GPH1(5));
#else
    return;
#endif
    printk(KERN_INFO "HDMI handle_cable previous status is %d and current status is %d\n",previous_hpd_status,s5ptv_status.hpd_status);
    
    memset(env_buf, 0, sizeof(env_buf));

    if(previous_hpd_status == s5ptv_status.hpd_status)
    {
        BASEPRINTK("same hpd_status value: %d\n", previous_hpd_status);
        return;
    }

    if(s5ptv_status.hpd_status)
    {
        TVout_LDO_ctrl(true);
        BASEPRINTK("\n hdmi cable is connected \n");
		sprintf(env_buf, "HDMI_STATE=online");
		envp[env_offset++] = env_buf;
		envp[env_offset] = NULL;
		kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
        
        if(s5ptv_status.suspend_status)
        {
		    printk("[TVOUT]hdmi cable is connected Before Suspend \n");
            return;
        }
#ifdef CONFIG_CPU_FREQ_S5PV210
        s5pv210_set_cpufreq_level(RESTRICT_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */

 				s5p_tv_clk_gate( true );
				//if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
        	//	tv_phy_power( true );

    #ifdef CONFIG_PM
    #if 0
        s5p_tv_clk_gate( true );
		if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
        tv_phy_power( true );
    #endif
    #endif
        /* tv on */
        if ( s5ptv_status.tvout_output_enable )
                _s5p_tv_if_start();

        /* video layer start */
        if ( s5ptv_status.vp_layer_enable )
                _s5p_vlayer_start();

        /* grp0 layer start */
        if ( s5ptv_status.grp_layer_enable[0] )
                _s5p_grp_start(VM_GPR0_LAYER);

        /* grp1 layer start */
        if ( s5ptv_status.grp_layer_enable[1] )
                _s5p_grp_start(VM_GPR1_LAYER);
		
		
		printk("[TVOUT]hdmi cable is connected\n");
    }
    else{
		
        BASEPRINTK("\n hdmi cable is disconnected \n");

	#if 1
        if(s5ptv_status.suspend_status || suspend_resume_sync == 2)
        {
			//if(gpio_get_value(GPIO_ACCESSORY_INT))
			{
				s5p_tv_clk_gate( true );
				tv_phy_power( true );
			}
 			//else
            //	return;
        }
	#endif 
//    if (!s5ptv_status.suspend_status) {
    if (suspend_resume_sync == 0) {
        if ( s5ptv_status.vp_layer_enable ) {
            _s5p_vlayer_stop();
            s5ptv_status.vp_layer_enable = true;

        }

        /* grp0 layer stop */
        if ( s5ptv_status.grp_layer_enable[0] ) {
            _s5p_grp_stop(VM_GPR0_LAYER);
            s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
        }

        /* grp1 layer stop */
        if ( s5ptv_status.grp_layer_enable[1] ) {
            _s5p_grp_stop(VM_GPR1_LAYER);
            s5ptv_status.grp_layer_enable[VM_GPR0_LAYER] = true;
        }

        /* tv off */
        if ( s5ptv_status.tvout_output_enable ) {
            _s5p_tv_if_stop();
            s5ptv_status.tvout_output_enable = false;
            s5ptv_status.tvout_param_available = false;
        }

    #ifdef CONFIG_PM
        /* clk & power off */
        s5p_tv_clk_gate( false );
  //if(s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI || s5ptv_status.tvout_param.out_mode == TVOUT_OUTPUT_HDMI_RGB)
    //    tv_phy_power( false );
    #endif
    }

		sprintf(env_buf, "HDMI_STATE=offline");
		envp[env_offset++] = env_buf;
		envp[env_offset] = NULL;
		kobject_uevent_env(&(s5p_tvout[0].dev.kobj), KOBJ_CHANGE, envp);
		printk("[TVOUT]hdmi cable is disconnected\n");

#ifdef CONFIG_CPU_FREQ_S5PV210
    if (suspend_resume_sync == 0)
        s5pv210_set_cpufreq_level(NORMAL_TABLE);
#endif /* CONFIG_CPU_FREQ_S5PV210 */
    }
}