summaryrefslogtreecommitdiff
authorLianlian Zhu <lianlian.zhu@amlogic.com>2018-02-07 14:08:16 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2018-02-14 03:29:44 (GMT)
commit003e1bde450ed2103395f13a2511eb567df4408e (patch)
treeddc089d4de7ff1b499ea3f66600a739b2a69d47e
parente6e1aaf42d87cd4707e1303998bcf8aeab2fc9f5 (diff)
downloadcommon-003e1bde450ed2103395f13a2511eb567df4408e.zip
common-003e1bde450ed2103395f13a2511eb567df4408e.tar.gz
common-003e1bde450ed2103395f13a2511eb567df4408e.tar.bz2
hdmi_tx: solve audiopolicy update at flash plug issue[1/1]
PD#155057: add a delay of 2000ms for disconect to filt the flash plug Change-Id: Ic5402ccf9f03293a87ee0321c7f8754b2a1c5310 Signed-off-by: Lianlian Zhu <lianlian.zhu@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c16
-rw-r--r--drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c4
-rw-r--r--include/linux/amlogic/media/vout/hdmi_tx/hdmi_tx_module.h1
3 files changed, 18 insertions, 3 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 ebf95ab..d791870 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
@@ -2744,7 +2744,6 @@ static void hdmitx_hpd_plugin_handler(struct work_struct *work)
hdmitx_notify_hpd(hdev->hpd_state);
extcon_set_state_sync(hdmitx_extcon_hdmi, EXTCON_DISP_HDMI, 1);
- extcon_set_state_sync(hdmitx_excton_audio, EXTCON_DISP_HDMI, 1);
mutex_unlock(&setclk_mutex);
}
@@ -2762,6 +2761,17 @@ static void clear_hdr_info(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_excton_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,
@@ -2795,9 +2805,7 @@ static void hdmitx_hpd_plugout_handler(struct work_struct *work)
hdmitx_edid_ram_buffer_clear(hdev);
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_excton_audio, EXTCON_DISP_HDMI, 0);
mutex_unlock(&setclk_mutex);
}
@@ -2856,6 +2864,8 @@ 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 c2a2fd6..bdc0d6b 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
@@ -646,6 +646,8 @@ static irqreturn_t intr_handler(int irq, void *dev)
}
/* HPD rising */
if (data32 & (1 << 1)) {
+ queue_delayed_work(hdev->hdmi_wq,
+ &hdev->work_aud_hpd_plug, HZ / 2);
hdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN;
hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT;
queue_delayed_work(hdev->hdmi_wq,
@@ -653,6 +655,8 @@ static irqreturn_t intr_handler(int irq, void *dev)
}
/* HPD falling */
if (data32 & (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;
queue_delayed_work(hdev->hdmi_wq,
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 b44bc42..a118530 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
@@ -208,6 +208,7 @@ struct hdmitx_dev {
struct device *hdtx_dev;
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;