/* * 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; }
/* * 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; }
/* * 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 ; }
/* * Resume */ int s5p_tv_resume(struct platform_device *dev) { /* clk & power on */ s5p_tv_clk_gate( true ); //tv_phy_power( true ); if ( s5ptv_status.tvout_output_enable ) _s5p_tv_if_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); if ( s5ptv_status.grp_layer_enable[1] ) _s5p_grp_start(VM_GPR1_LAYER); return 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 */ } }
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 */ } }
/* * before call this ftn. set the status data!! */ bool _s5p_tv_if_set_disp(void) { s5p_tv_status *st = &s5ptv_status; s5p_tv_disp_mode disp_mode = st->tvout_param.disp_mode; s5p_tv_o_mode out_mode = st->tvout_param.out_mode; TVOUTIFPRINTK("(%d, %d)\n\r",disp_mode,out_mode); switch (disp_mode) { case TVOUT_NTSC_M: case TVOUT_NTSC_443: st->sdout_video_scale_cfg.component_level=S5P_TV_SD_LEVEL_0IRE; st->sdout_video_scale_cfg.component_ratio=SDOUT_VTOS_RATIO_7_3; st->sdout_video_scale_cfg.composite_level=S5P_TV_SD_LEVEL_75IRE; st->sdout_video_scale_cfg.composite_ratio=SDOUT_VTOS_RATIO_10_4; break; case TVOUT_PAL_BDGHI: case TVOUT_PAL_M: case TVOUT_PAL_N: case TVOUT_PAL_NC: case TVOUT_PAL_60: st->sdout_video_scale_cfg.component_level=S5P_TV_SD_LEVEL_0IRE; st->sdout_video_scale_cfg.component_ratio=SDOUT_VTOS_RATIO_7_3; st->sdout_video_scale_cfg.composite_level=S5P_TV_SD_LEVEL_0IRE; st->sdout_video_scale_cfg.composite_ratio=SDOUT_VTOS_RATIO_7_3; break; case TVOUT_480P_60_16_9: case TVOUT_480P_60_4_3: case TVOUT_576P_50_16_9: case TVOUT_576P_50_4_3: case TVOUT_720P_50: case TVOUT_720P_60: #ifdef CONFIG_CPU_S5PV210 case TVOUT_1080I_50: case TVOUT_1080I_60: case TVOUT_1080P_50: case TVOUT_1080P_60: case TVOUT_1080P_30: case TVOUT_480P_59: case TVOUT_720P_59: case TVOUT_1080I_59: case TVOUT_1080P_59: #endif if (!_s5p_tv_if_init_avi_frame(&st->tvout_param)) { st->tvout_param_available = false; return false; } break; default: TVOUTIFPRINTK("invalid disp_mode parameter(%d)\n\r",disp_mode); st->tvout_param_available = false; return false; break; } switch (out_mode) { case TVOUT_OUTPUT_COMPOSITE: st->sdout_order = S5P_TV_SD_O_ORDER_COMPOSITE_Y_C_CVBS; st->sdout_dac_on[2] = false; st->sdout_dac_on[1] = false; st->sdout_dac_on[0] = true; break; case TVOUT_OUTPUT_SVIDEO: st->sdout_order = S5P_TV_SD_O_ORDER_COMPOSITE_C_Y_CVBS; st->sdout_dac_on[2] = true; st->sdout_dac_on[1] = true; st->sdout_dac_on[0] = false; break; case TVOUT_OUTPUT_COMPONENT_YPBPR_INERLACED: case TVOUT_OUTPUT_COMPONENT_YPBPR_PROGRESSIVE: case TVOUT_OUTPUT_COMPONENT_RGB_PROGRESSIVE: st->sdout_order = S5P_TV_SD_O_ORDER_COMPONENT_RBG_PRPBY; st->sdout_dac_on[2] = true; st->sdout_dac_on[1] = true; st->sdout_dac_on[0] = true; break; case TVOUT_OUTPUT_HDMI_RGB: case TVOUT_OUTPUT_HDMI: case TVOUT_OUTPUT_DVI: st->hdmi_video_blue_screen.cb_b = 0;//128; st->hdmi_video_blue_screen.y_g = 0; st->hdmi_video_blue_screen.cr_r = 0;//128; break; default: TVOUTIFPRINTK("invalid out_mode parameter(%d)\n\r",out_mode); st->tvout_param_available = false; return false; break; } #if defined(CONFIG_CPU_S5PV210) && defined(CONFIG_PM_PWR_GATING ) if((st->hpd_status) && st->suspend_status == false) { #endif _s5p_tv_if_start(); #if defined(CONFIG_CPU_S5PV210) && defined(CONFIG_PM_PWR_GATING ) } // If the cable is not inserted or system is on suspend mode // Just set variable, _s5p_tv_if_start() function will be called in resume or handle_cable function according to this variable else st->tvout_output_enable = true; #endif return true; }
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 } }