diff --git a/drivers/amlogic/media/vout/cvbs/cvbs_out.c b/drivers/amlogic/media/vout/cvbs/cvbs_out.c index bbcbcac0ff84..47fe2f46da73 100644 --- a/drivers/amlogic/media/vout/cvbs/cvbs_out.c +++ b/drivers/amlogic/media/vout/cvbs/cvbs_out.c @@ -34,6 +34,8 @@ /*#include */ #include #include +#include +#include #include #include @@ -260,6 +262,7 @@ static void cvbs_out_disable_clk(void) static void cvbs_out_disable_venc(void) { + info->dwork_flag = 0; cvbs_cntl_output(0); cvbs_out_reg_write(ENCI_VIDEO_EN, 0); @@ -352,6 +355,13 @@ static void cvbs_out_clk_gate_ctrl(int status) } } +static void cvbs_dv_dwork(struct work_struct *work) +{ + if (!info->dwork_flag) + return; + cvbs_cntl_output(1); +} + int cvbs_out_setmode(void) { int ret; @@ -381,9 +391,8 @@ int cvbs_out_setmode(void) #ifdef CONFIG_CVBS_PERFORMANCE_COMPATIBILITY_SUPPORT cvbs_performance_enhancement(local_cvbs_mode); #endif - msleep(1000); - cvbs_cntl_output(1); - + info->dwork_flag = 1; + schedule_delayed_work(&info->dv_dwork, msecs_to_jiffies(1000)); mutex_unlock(&setmode_mutex); return 0; } @@ -565,6 +574,7 @@ static int cvbs_vmode_is_supported(enum vmode_e mode) } static int cvbs_module_disable(enum vmode_e cur_vmod) { + info->dwork_flag = 0; cvbs_cntl_output(0); cvbs_out_vpu_power_ctrl(0); @@ -578,6 +588,7 @@ static int cvbs_suspend(void) { /* TODO */ /* video_dac_disable(); */ + info->dwork_flag = 0; cvbs_cntl_output(0); return 0; } @@ -1261,6 +1272,7 @@ static int cvbsout_probe(struct platform_device *pdev) cvbs_log_err("create_cvbs_attr error\n"); return -1; } + INIT_DELAYED_WORK(&info->dv_dwork, cvbs_dv_dwork); cvbs_log_info("%s OK\n", __func__); return 0; } diff --git a/drivers/amlogic/media/vout/cvbs/cvbs_out.h b/drivers/amlogic/media/vout/cvbs/cvbs_out.h index 7be7113924d4..e980c69fe288 100644 --- a/drivers/amlogic/media/vout/cvbs/cvbs_out.h +++ b/drivers/amlogic/media/vout/cvbs/cvbs_out.h @@ -18,6 +18,9 @@ #ifndef _CVBS_OUT_H_ #define _CVBS_OUT_H_ +/* Standard Linux Headers */ +#include + /* Amlogic Headers */ #include #include "cvbs_mode.h" @@ -95,6 +98,8 @@ struct disp_module_info_s { struct device *dev; struct meson_cvbsout_data *cvbs_data; struct cvbs_config_s cvbs_conf; + struct delayed_work dv_dwork; + bool dwork_flag; /* clktree */ unsigned int clk_gate_state;