From 1de79d0662e6dc8cba02270060e07b933ee42a06 Mon Sep 17 00:00:00 2001 From: hang cheng Date: Wed, 1 Sep 2021 20:50:35 +0800 Subject: [PATCH] hdmitx: add extra uevents to supplement extcon [4/4] PD#SWPL-57172 Problem: hal can't receive suspend/resume uevent on android S + 4.9-q Solution: add extra uevents to supplement extcon; on android S, it will only listen to uevent on android Q, it will only listen to extcon Verify: u221 Change-Id: I52fbe9756a824d6876753ae3ff36c7bb7b9b6f97 Signed-off-by: hang cheng --- .../media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 343cfafb5ecb..5e71e0c50b7e 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 @@ -246,6 +246,7 @@ static void hdmitx_early_suspend(struct early_suspend *h) edidinfo_detach_to_vinfo(hdev); extcon_set_state_sync(hdmitx_extcon_power, EXTCON_DISP_HDMI, HDMI_SUSPEND); + hdmitx_set_uevent(HDMITX_HDCPPWR_EVENT, 0); phdmi->hwop.cntlconfig(&hdmitx_device, CONF_CLR_AVI_PACKET, 0); phdmi->hwop.cntlconfig(&hdmitx_device, CONF_CLR_VSDB_PACKET, 0); /*close vpu clk*/ @@ -319,10 +320,13 @@ static void hdmitx_late_resume(struct early_suspend *h) extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, hdmitx_device.hpd_state); + hdmitx_set_uevent(HDMITX_HPD_EVENT, hdmitx_device.hpd_state); extcon_set_state_sync(hdmitx_extcon_power, EXTCON_DISP_HDMI, HDMI_WAKEUP); + hdmitx_set_uevent(HDMITX_HDCPPWR_EVENT, 1); extcon_set_state_sync(hdmitx_extcon_audio, EXTCON_DISP_HDMI, hdmitx_device.hpd_state); + hdmitx_set_uevent(HDMITX_AUDIO_EVENT, hdmitx_device.hpd_state); pr_info("amhdmitx: late resume module %d\n", __LINE__); phdmi->hwop.cntl((struct hdmitx_dev *)h->param, @@ -1371,10 +1375,12 @@ static void hdmitx_sdr_hdr_uevent(struct hdmitx_dev *hdev) (hdev->hdmi_current_hdr_mode != 0)) { /* SDR -> HDR*/ extcon_set_state_sync(hdmitx_extcon_hdr, EXTCON_DISP_HDMI, 1); + hdmitx_set_uevent(HDMITX_HDR_EVENT, 1); } else if ((hdev->hdmi_last_hdr_mode != 0) && (hdev->hdmi_current_hdr_mode == 0)) { /* HDR -> SDR*/ extcon_set_state_sync(hdmitx_extcon_hdr, EXTCON_DISP_HDMI, 0); + hdmitx_set_uevent(HDMITX_HDR_EVENT, 0); } /* NOTE: for HDR <-> HLG, also need update last mode */ hdev->hdmi_last_hdr_mode = hdev->hdmi_current_hdr_mode; @@ -4344,6 +4350,7 @@ static ssize_t store_fake_plug(struct device *dev, extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, hdev->hpd_state); + hdmitx_set_uevent(HDMITX_HPD_EVENT, hdev->hpd_state); return count; } @@ -5625,6 +5632,7 @@ static void hdmitx_hpd_plugin_handler(struct work_struct *work) extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, 1); hdmitx_set_uevent(HDMITX_HPD_EVENT, 1); extcon_set_state_sync(hdmitx_extcon_audio, EXTCON_DISP_HDMI, 1); + hdmitx_set_uevent(HDMITX_AUDIO_EVENT, 1); mutex_unlock(&setclk_mutex); /* Should be started at end of output */ cancel_delayed_work(&hdev->work_cedst); @@ -5679,6 +5687,7 @@ static void hdmitx_hpd_plugout_handler(struct work_struct *work) extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, 0); hdmitx_set_uevent(HDMITX_HPD_EVENT, 0); extcon_set_state_sync(hdmitx_extcon_audio, EXTCON_DISP_HDMI, 0); + hdmitx_set_uevent(HDMITX_AUDIO_EVENT, 0); mutex_unlock(&setclk_mutex); return; } @@ -5706,6 +5715,7 @@ static void hdmitx_hpd_plugout_handler(struct work_struct *work) extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, 0); hdmitx_set_uevent(HDMITX_HPD_EVENT, 0); extcon_set_state_sync(hdmitx_extcon_audio, EXTCON_DISP_HDMI, 0); + hdmitx_set_uevent(HDMITX_AUDIO_EVENT, 0); mutex_unlock(&setclk_mutex); } @@ -5810,6 +5820,7 @@ static int hdmi_task_handle(void *data) extcon_set_state_sync(hdmitx_extcon_power, EXTCON_DISP_HDMI, HDMI_WAKEUP); + hdmitx_set_uevent(HDMITX_HDCPPWR_EVENT, 1); INIT_WORK(&hdmitx_device->work_hdr, hdr_work_func); hdmitx_device->hdmi_wq = alloc_workqueue(DEVICE_NAME, -- 2.20.1