/*#include <linux/major.h>*/
#include <linux/cdev.h>
#include <linux/delay.h>
+#include <linux/jiffies.h>
+#include <linux/workqueue.h>
#include <linux/uaccess.h>
#include <linux/clk.h>
static void cvbs_out_disable_venc(void)
{
+ info->dwork_flag = 0;
cvbs_cntl_output(0);
cvbs_out_reg_write(ENCI_VIDEO_EN, 0);
}
}
+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;
#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;
}
}
static int cvbs_module_disable(enum vmode_e cur_vmod)
{
+ info->dwork_flag = 0;
cvbs_cntl_output(0);
cvbs_out_vpu_power_ctrl(0);
{
/* TODO */
/* video_dac_disable(); */
+ info->dwork_flag = 0;
cvbs_cntl_output(0);
return 0;
}
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;
}
#ifndef _CVBS_OUT_H_
#define _CVBS_OUT_H_
+/* Standard Linux Headers */
+#include <linux/workqueue.h>
+
/* Amlogic Headers */
#include <linux/amlogic/media/vout/vout_notify.h>
#include "cvbs_mode.h"
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;