eARCrx: add hdmitx hpd notify [1/1]
authorZongdong Jiao <zongdong.jiao@amlogic.com>
Wed, 31 Jul 2019 07:30:56 +0000 (15:30 +0800)
committerZongdong Jiao <zongdong.jiao@amlogic.com>
Wed, 31 Jul 2019 07:30:56 +0000 (15:30 +0800)
PD#SWPL-6861

Problem:
Lack hdmitx hpd event notify to eARC

Solution:
Add hdmitx hpd event notify to eARC in HPD interrupt handler
w/o any delay.

Verify:
TBD

Change-Id: Ic7f35365a2af634dee604f7121d62738b4b17a8d
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
MAINTAINERS
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c
include/linux/amlogic/media/sound/hdmi_earc.h [new file with mode: 0644]

index d221b8a8f4c7372c9eff8f86abb25efe352e3a5b..1cf49af04a0a3c21f0c6eb3e5e12f59e7c6c1e43 100644 (file)
@@ -15085,4 +15085,4 @@ F:      drivers/amlogic/drm/meson_vpu.c
 AMLOGIC ADD DTS FOR T312 PLATFORM
 M:  hualing chen <hualing.chen@amlogic.com>
 F:  arch/arm64/boot/dts/amlogic/mesontm2_t962x3_t312-panel.dtsi
-F:  arch/arm/boot/dts/amlogic/mesontm2_t962x3_t312-panel.dtsi
\ No newline at end of file
+F:  arch/arm/boot/dts/amlogic/mesontm2_t962x3_t312-panel.dtsi
index 2dc690405d8ca4355fc29398cdb67fecd5fcfd6d..b6ffa514dd29233013e4753995ce4957b687da4e 100644 (file)
@@ -47,6 +47,7 @@
 #include "hw_clk.h"
 #include <linux/arm-smccc.h>
 #include "checksha.h"
+#include <linux/amlogic/media/sound/hdmi_earc.h>
 
 static void mode420_half_horizontal_para(void);
 static void hdmi_phy_suspend(void);
@@ -641,6 +642,20 @@ void HDMITX_Meson_Init(struct hdmitx_dev *hdev)
        hdev->HWOp.CntlMisc(hdev, MISC_AVMUTE_OP, CLR_AVMUTE);
 }
 
+static void hdmitx_phy_bandgap_en(struct hdmitx_dev *hdev)
+{
+       switch (hdev->chip_type) {
+       case MESON_CPU_ID_TM2:
+               hd_write_reg(P_TM2_HHI_HDMI_PHY_CNTL0, 0x0b4242);
+               break;
+       case MESON_CPU_ID_SM1:
+               hd_write_reg(P_HHI_HDMI_PHY_CNTL0, 0x0b4242);
+               break;
+       default:
+               break;
+       }
+}
+
 static irqreturn_t intr_handler(int irq, void *dev)
 {
        /* get interrupt status */
@@ -670,6 +685,8 @@ static irqreturn_t intr_handler(int irq, void *dev)
                hdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN;
                hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT;
                hdev->rhpd_state = 1;
+               hdmitx_phy_bandgap_en(hdev);
+               earc_hdmitx_hpdst(1);
                queue_delayed_work(hdev->hdmi_wq,
                        &hdev->work_hpd_plugin, HZ / 2);
        }
@@ -678,6 +695,7 @@ static irqreturn_t intr_handler(int irq, void *dev)
                hdev->hdmitx_event |= HDMI_TX_HPD_PLUGOUT;
                hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGIN;
                hdev->rhpd_state = 0;
+               earc_hdmitx_hpdst(0);
                queue_delayed_work(hdev->hdmi_wq,
                        &hdev->work_hpd_plugout, HZ / 20);
        }
diff --git a/include/linux/amlogic/media/sound/hdmi_earc.h b/include/linux/amlogic/media/sound/hdmi_earc.h
new file mode 100644 (file)
index 0000000..97e30af
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * include/linux/amlogic/media/sound/hdmi_earc.h
+ *
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#ifndef __HDMI_EARC_H__
+#define __HDMI_EARC_H__
+
+extern void earc_hdmitx_hpdst(bool st);
+
+void earc_hdmitx_hpdst(bool st)
+{
+};
+#endif