static void cec_task(struct work_struct *work)
{
- struct delayed_work *dwork;
-
- dwork = &cec_dev->cec_work;
- 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;
+ struct delayed_work *dwork = &cec_dev->cec_work;
+ unsigned int cec_cfg;
+
+ 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_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*/
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;
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;
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)
{
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;