diff --git a/drivers/amlogic/cec/hdmi_ao_cec.c b/drivers/amlogic/cec/hdmi_ao_cec.c index 21ca8bbdf6c6a5..ba457e8eea861b 100644 --- a/drivers/amlogic/cec/hdmi_ao_cec.c +++ b/drivers/amlogic/cec/hdmi_ao_cec.c @@ -996,6 +996,9 @@ int cec_node_init(struct hdmitx_dev *hdmitx_device) if ((cec_dev->hal_flag & (1 << HDMI_OPTION_SYSTEM_CEC_CONTROL))) return -1; + if (!(hdmitx_device->cec_func_config & (1 << CEC_FUNC_MSAK))) + return -1; + CEC_INFO("cec_node_init started\n"); cec_phy_addr = ((a << 12) | (b << 8) | (c << 4) | (d << 0)); @@ -1449,6 +1452,8 @@ static struct class_attribute aocec_class_attr[] = { /******************** cec hal interface ***************************/ static int hdmitx_cec_open(struct inode *inode, struct file *file) { + wait_event_interruptible(cec_dev->tx_dev->hdmi_info.vsdb_phy_addr.waitq, + cec_dev->tx_dev->hdmi_info.vsdb_phy_addr.valid == 1); cec_dev->cec_info.open_count++; if (cec_dev->cec_info.open_count) { cec_dev->cec_info.hal_ctl = 1; diff --git a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c index 4787300678d136..0c50ead3f12645 100644 --- a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c +++ b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_edid.c @@ -313,6 +313,9 @@ void set_vsdb_phy_addr(struct vsdb_phyaddr *vsdb, vsdb->d = (edid_offset[5] >> 0) & 0xf; vsdb_local = *vsdb; vsdb->valid = 1; +#ifdef CONFIG_AML_AO_CEC + wake_up_interruptible(&vsdb->waitq); +#endif } int Edid_Parse_check_HDMI_VSDB(struct hdmitx_info *info, diff --git a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c index 57105b62eda6e6..46fa16b506979e 100644 --- a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c @@ -1559,7 +1559,9 @@ void hdmitx_hpd_plugin_handler(struct work_struct *work) set_disp_mode_auto(); hdmitx_set_audio(hdev, &(hdev->cur_audio_param), hdmi_ch); switch_set_state(&sdev, 1); +#ifndef CONFIG_AML_AO_CEC cec_node_init(hdev); +#endif hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGIN; mutex_unlock(&setclk_mutex); } @@ -2188,6 +2190,9 @@ static int amhdmitx_probe(struct platform_device *pdev) HDMITX_Meson_Init(&hdmitx_device); hdmitx_device.task = kthread_run(hdmi_task_handle, &hdmitx_device, "kthread_hdmi"); +#ifdef CONFIG_AML_AO_CEC + init_waitqueue_head(&hdmitx_device.hdmi_info.vsdb_phy_addr.waitq); +#endif if (r < 0) { hdmi_print(INF, SYS "register switch dev failed\n"); diff --git a/include/linux/amlogic/hdmi_tx/hdmi_info_global.h b/include/linux/amlogic/hdmi_tx/hdmi_info_global.h index 7002c4602ce1a3..c7502e9ef35bd6 100644 --- a/include/linux/amlogic/hdmi_tx/hdmi_info_global.h +++ b/include/linux/amlogic/hdmi_tx/hdmi_info_global.h @@ -19,6 +19,7 @@ #define _HDMI_INFO_GLOBAL_H #include "hdmi_common.h" +#include /* old definitions move to hdmi_common.h */ @@ -269,6 +270,9 @@ struct vsdb_phyaddr { unsigned char c:4; unsigned char d:4; unsigned char valid; +#ifdef CONFIG_AML_AO_CEC + wait_queue_head_t waitq; +#endif }; struct hdmitx_clk {