cec: disable cec module clear logic addr

PD#169892: cec: disable cec module clear logic addr

	1.for replace "keep reset" when cec disable

Change-Id: I2af29cd4d89ffd13bf35a41fd41d2eb0dbf68e55
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
This commit is contained in:
Yong Qin
2018-07-11 16:44:27 +08:00
committed by Yixun Lan
parent 60e98ef37d
commit ae0631efa2
2 changed files with 31 additions and 18 deletions

View File

@@ -1672,21 +1672,24 @@ static bool cec_service_suspended(void)
static void cec_task(struct work_struct *work)
{
struct delayed_work *dwork;
struct delayed_work *dwork = &cec_dev->cec_work;
unsigned int cec_cfg;
dwork = &cec_dev->cec_work;
if (cec_dev && (!wake_ok || cec_service_suspended()))
cec_rx_process();
cec_cfg = cec_config(0, 0);
if (cec_cfg & (1 << HDMI_OPTION_ENABLE_CEC)) {
/*cec module on*/
if (cec_dev && (!wake_ok || cec_service_suspended()))
cec_rx_process();
/*for check rx buffer for old chip version, cec rx irq process*/
/*in internal hdmi rx, for avoid msg lose */
if ((cec_dev->cpu_type < MESON_CPU_MAJOR_ID_TXLX) &&
(cec_config(0, 0) == CEC_FUNC_CFG_ALL)) {
if (cec_late_check_rx_buffer()) {
/*msg in*/
mod_delayed_work(cec_dev->cec_thread, dwork, 0);
return;
/*for check rx buffer for old chip version, cec rx irq process*/
/*in internal hdmi rx, for avoid msg lose*/
if ((cec_dev->cpu_type < MESON_CPU_MAJOR_ID_TXLX) &&
(cec_cfg == CEC_FUNC_CFG_ALL)) {
if (cec_late_check_rx_buffer()) {
/*msg in*/
mod_delayed_work(cec_dev->cec_thread, dwork, 0);
return;
}
}
}
/*triger next process*/
@@ -1994,7 +1997,7 @@ static ssize_t fun_cfg_store(struct class *cla, struct class_attribute *attr,
return -EINVAL;
cec_config(val, 1);
if (val == 0)
cec_keep_reset();
cec_clear_logical_addr();/*cec_keep_reset();*/
else
cec_pre_init();
return count;
@@ -2098,7 +2101,8 @@ static ssize_t hdmitx_cec_write(struct file *f, const char __user *buf,
size_t size, loff_t *p)
{
unsigned char tempbuf[16] = {};
int ret;
int ret = CEC_FAIL_OTHER;
unsigned int cec_cfg;
if (size > 16)
size = 16;
@@ -2108,10 +2112,18 @@ static ssize_t hdmitx_cec_write(struct file *f, const char __user *buf,
if (copy_from_user(tempbuf, buf, size))
return -EINVAL;
ret = cec_ll_tx(tempbuf, size);
cec_cfg = cec_config(0, 0);
if (cec_cfg & (1 << HDMI_OPTION_ENABLE_CEC)) {
/*cec module on*/
ret = cec_ll_tx(tempbuf, size);
} else {
CEC_ERR("err:cec module disabled\n");
}
return ret;
}
static void init_cec_port_info(struct hdmi_port_info *port,
struct ao_cec_dev *cec_dev)
{
@@ -2327,7 +2339,8 @@ static long hdmitx_cec_ioctl(struct file *f,
cec_dev->hal_flag &= ~(tmp);
CEC_INFO("disable CEC\n");
cec_config(CEC_FUNC_CFG_NONE, 1);
cec_keep_reset();
/*cec_keep_reset();*/
cec_clear_logical_addr();
}
break;

View File

@@ -18,7 +18,7 @@
#ifndef __AO_CEC_H__
#define __AO_CEC_H__
#define CEC_DRIVER_VERSION "Ver**2018/07/03**\n"
#define CEC_DRIVER_VERSION "Ver**2018/07/16**\n"
#define CEC_FRAME_DELAY msecs_to_jiffies(400)
#define CEC_DEV_NAME "cec"