From bdee9fadcbc0e91c5aa58d93d25672db9036f7da Mon Sep 17 00:00:00 2001 From: Zongdong Jiao Date: Mon, 11 Mar 2019 15:55:09 +0800 Subject: [PATCH] hdmitx: sync hdmi_audio uevent to hdmi hpd [1/1] PD#SWPL-5827 Problem: When Mbox->AVR->TV connected, if TV switch input sources, there may be up 3 times short HPD in Mbox side. And this may cause audio module lost downstream's capability. Solution: Remove original 2s delay in 'hdmi_audio' event. Verify: S905X2/U212 Change-Id: I39512030f058ab9c72ee4c779f3b692898440271 Signed-off-by: Luan Yuan Signed-off-by: Zongdong Jiao --- .../amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 14 +------------- .../amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c | 2 -- include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h | 1 - 3 files changed, 1 insertion(+), 16 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 3642942..61b606f 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 @@ -3931,17 +3931,6 @@ static void clear_rx_vinfo(struct hdmitx_dev *hdev) } } -static void hdmitx_aud_hpd_plug_handler(struct work_struct *work) -{ - int st; - struct hdmitx_dev *hdev = container_of((struct delayed_work *)work, - struct hdmitx_dev, work_aud_hpd_plug); - - st = hdev->HWOp.CntlMisc(hdev, MISC_HPD_GPI_ST, 0); - pr_info("hdmitx_aud_hpd_plug_handler state:%d\n", st); - extcon_set_state_sync(hdmitx_extcon_audio, EXTCON_DISP_HDMI, st); -} - static void hdmitx_hpd_plugout_handler(struct work_struct *work) { struct hdmitx_dev *hdev = container_of((struct delayed_work *)work, @@ -3982,6 +3971,7 @@ static void hdmitx_hpd_plugout_handler(struct work_struct *work) hdev->hpd_state = 0; hdmitx_notify_hpd(hdev->hpd_state); extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, 0); + extcon_set_state_sync(hdmitx_extcon_audio, EXTCON_DISP_HDMI, 0); mutex_unlock(&setclk_mutex); } @@ -4040,8 +4030,6 @@ static int hdmi_task_handle(void *data) hdmitx_hpd_plugin_handler); INIT_DELAYED_WORK(&hdmitx_device->work_hpd_plugout, hdmitx_hpd_plugout_handler); - INIT_DELAYED_WORK(&hdmitx_device->work_aud_hpd_plug, - hdmitx_aud_hpd_plug_handler); INIT_WORK(&hdmitx_device->work_internal_intr, hdmitx_internal_intr_handler); diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c index 8e42d76..2a5a85d 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c @@ -661,8 +661,6 @@ static irqreturn_t intr_handler(int irq, void *dev) } /* HPD falling */ if (dat_top & (1 << 2)) { - queue_delayed_work(hdev->hdmi_wq, - &hdev->work_aud_hpd_plug, 2 * HZ); hdev->hdmitx_event |= HDMI_TX_HPD_PLUGOUT; hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGIN; hdev->rhpd_state = 0; diff --git a/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h b/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h index 7e46a27..503f6f1 100644 --- a/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h +++ b/include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h @@ -307,7 +307,6 @@ struct hdmitx_dev { struct pinctrl_state *pinctrl_default; struct delayed_work work_hpd_plugin; struct delayed_work work_hpd_plugout; - struct delayed_work work_aud_hpd_plug; struct delayed_work work_rxsense; struct work_struct work_internal_intr; struct work_struct work_hdr; -- 2.7.4