From 01151bcb3f5541a2f57b24a75ac08adf58dd2ecb Mon Sep 17 00:00:00 2001 From: Zongdong Jiao Date: Wed, 4 Dec 2019 20:11:15 +0800 Subject: [PATCH] hdmitx: revert original hpd_state mark [1/1] PD#SWPL-17710 Problem: Suppose hdmitx already output in uboot, and next kernel boots up, the output will disable and then enable Solution: When hdmitx hpd_states initializes, read edid when hpd is high Verify: G12/U212 Change-Id: I538b8af2d59a7b2b34739f14d0b0cb6fd89aed2e Signed-off-by: Zongdong Jiao --- .../vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c index 43382a1b1762..9cc39b20b91e 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c @@ -4271,7 +4271,6 @@ static int hdmitx_notify_callback_a(struct notifier_block *block, static void hdmitx_get_edid(struct hdmitx_dev *hdev) { - static int once_flag = 1; mutex_lock(&getedid_mutex); /* TODO hdmitx_edid_ram_buffer_clear(hdev); */ hdev->hwop.cntlddc(hdev, DDC_RESET_EDID, 0); @@ -4296,10 +4295,6 @@ static void hdmitx_get_edid(struct hdmitx_dev *hdev) memset(dv, 0, sizeof(struct dv_info)); pr_info("clear dv_info\n"); } - if (once_flag) { - once_flag = 0; - edidinfo_attach_to_vinfo(hdev); - } mutex_unlock(&getedid_mutex); } @@ -4483,18 +4478,23 @@ static int hdmi_task_handle(void *data) struct vinfo_s *info = NULL; struct hdmitx_dev *hdmitx_device = (struct hdmitx_dev *)data; - /* hdmitx_extcon_hdmi->state = !!(hdmitx_device->hwop.cntlmisc( - * hdmitx_device, MISC_HPD_GPI_ST, 0)); - * hdmitx_device->hpd_state = hdmitx_extcon_hdmi->state; - * hdmitx_notify_hpd(hdmitx_device->hpd_state); - */ + hdmitx_extcon_hdmi->state = !!(hdmitx_device->hwop.cntlmisc( + hdmitx_device, MISC_HPD_GPI_ST, 0)); + hdmitx_device->hpd_state = hdmitx_extcon_hdmi->state; + hdmitx_notify_hpd(hdmitx_device->hpd_state); + extcon_set_state_sync(hdmitx_extcon_power, EXTCON_DISP_HDMI, - hdmitx_device->hpd_state); - INIT_WORK(&hdmitx_device->work_hdr, hdr_work_func); + hdmitx_device->hpd_state); /* When init hdmi, clear the hdmitx module edid ram and edid buffer. */ hdmitx_edid_clear(hdmitx_device); hdmitx_edid_ram_buffer_clear(hdmitx_device); + if (hdmitx_device->hpd_state) { + hdmitx_get_edid(hdmitx_device); + edidinfo_attach_to_vinfo(hdmitx_device); + } + + INIT_WORK(&hdmitx_device->work_hdr, hdr_work_func); hdmitx_device->hdmi_wq = alloc_workqueue(DEVICE_NAME, WQ_HIGHPRI | WQ_CPU_INTENSIVE, 0); INIT_DELAYED_WORK(&hdmitx_device->work_hpd_plugin, -- 2.20.1