static int cec_late_check_rx_buffer(void)
{
int ret;
- struct delayed_work *dwork = &cec_dev->cec_work;
+ /*struct delayed_work *dwork = &cec_dev->cec_work;*/
ret = cec_rx_buf_check();
if (!ret)
cec_rx_buf_clear();
return 0;
} else {
- mod_delayed_work(cec_dev->cec_thread, dwork, 0);
+ /*mod_delayed_work(cec_dev->cec_thread, dwork, 0);*/
return 1;
}
}
if (cec_dev && (!wake_ok || cec_service_suspended()))
cec_rx_process();
- if (!cec_late_check_rx_buffer())
- queue_delayed_work(cec_dev->cec_thread, dwork, CEC_FRAME_DELAY);
+
+ /*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;
+ }
+ }
+ /*triger next process*/
+ queue_delayed_work(cec_dev->cec_thread, dwork, CEC_FRAME_DELAY);
}
static irqreturn_t cec_isr_handler(int irq, void *dev_instance)
tmp = (1 << HDMI_OPTION_ENABLE_CEC);
if (arg) {
cec_dev->hal_flag |= tmp;
- cec_config(0x2f, 1);
+ cec_config(CEC_FUNC_CFG_ALL, 1);
cec_pre_init();
} else {
cec_dev->hal_flag &= ~(tmp);
CEC_INFO("disable CEC\n");
- cec_config(0x0, 1);
+ cec_config(CEC_FUNC_CFG_NONE, 1);
cec_keep_reset();
}
break;
tmp = (1 << HDMI_OPTION_SYSTEM_CEC_CONTROL);
if (arg) {
cec_dev->hal_flag |= tmp;
- cec_config(0x2f, 1);
+ cec_config(CEC_FUNC_CFG_ALL, 1);
} else
cec_dev->hal_flag &= ~(tmp);
cec_dev->hal_flag |= (1 << HDMI_OPTION_SERVICE_FLAG);
#ifndef __AO_CEC_H__
#define __AO_CEC_H__
-#define CEC_DRIVER_VERSION "2018/06/14\n"
+#define CEC_DRIVER_VERSION "2018/06/15\n"
#define CEC_FRAME_DELAY msecs_to_jiffies(400)
#define CEC_DEV_NAME "cec"
#define ONE_TOUCH_STANDBY_MASK 2
#define AUTO_POWER_ON_MASK 3
+#define CEC_FUNC_CFG_ALL 0x2f
+#define CEC_FUNC_CFG_NONE 0x0
+
#define AO_BASE 0xc8100000
#define AO_GPIO_I ((0x0A << 2))