hdmirx: update eARC port and 5V high or low status to audio [1/1]
authoryicheng shen <yicheng.shen@amlogic.com>
Thu, 8 Aug 2019 07:27:13 +0000 (03:27 -0400)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 16 Aug 2019 03:07:49 +0000 (20:07 -0700)
PD#SWPL-12446

Problem:
Need update eARC port and 5V high or low status to audio

Solution:
update eARC port and 5V high or low status to audio

Verify:
TM2

Change-Id: Ie9891e045010e2020aa9ec64922f2810f6a0cb18
Signed-off-by: yicheng shen <yicheng.shen@amlogic.com>
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c
include/linux/amlogic/media/sound/hdmi_earc.h
sound/soc/amlogic/auge/earc.c

index 1810dcd..ab43a5d 100644 (file)
@@ -34,7 +34,7 @@
 #include "hdmi_rx_edid.h"
 
 
-#define RX_VER0 "ver.2019-06-14"
+#define RX_VER0 "ver.2019-08-08"
 /*
  *
  *
@@ -453,6 +453,7 @@ struct rx_s {
        struct emp_buff empbuff;
        uint32_t arc_port;
        enum edid_ver_e edid_ver;
+       bool arc_5vsts;
 };
 
 struct _hdcp_ksv {
index cbae377..15bee3e 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/delay.h>
 #include <linux/of_gpio.h>
 #include <linux/amlogic/media/frame_provider/tvin/tvin.h>
+#include <linux/amlogic/media/sound/hdmi_earc.h>
 
 /* Local include */
 #include "hdmi_rx_repeater.h"
@@ -1962,6 +1963,7 @@ static void rx_cable_clk_monitor(void)
                pre_sts = sts;
        }
 }
+
 /* ---------------------------------------------------------- */
 /* func:         port A,B,C,D  hdmitx-5v monitor & HPD control */
 /* note:         G9TV portD no used */
@@ -1970,6 +1972,7 @@ void rx_5v_monitor(void)
 {
        static uint8_t check_cnt;
        uint8_t tmp_5v = rx_get_hdmi5v_sts();
+       bool tmp_arc_5v;
 
        if (auto_switch_off)
                tmp_5v = 0x0f;
@@ -1997,6 +2000,13 @@ void rx_5v_monitor(void)
                else
                        hdcp_mode_sel = false;
        }
+       if (rx.chip_id == CHIP_ID_TM2) {
+               tmp_arc_5v = (pwr_sts >> rx.arc_port) & 1;
+               if (rx.arc_5vsts != tmp_arc_5v) {
+                       rx.arc_5vsts = tmp_arc_5v;
+                       earc_hdmirx_hpdst(rx.arc_port, rx.arc_5vsts);
+               }
+       }
 }
 
 /*
index 97e30af..36a8c5f 100644 (file)
@@ -18,9 +18,8 @@
 #ifndef __HDMI_EARC_H__
 #define __HDMI_EARC_H__
 
+extern void earc_hdmirx_hpdst(int port, bool st);
+
 extern void earc_hdmitx_hpdst(bool st);
 
-void earc_hdmitx_hpdst(bool st)
-{
-};
 #endif
index c284417..b013674 100644 (file)
@@ -65,6 +65,16 @@ struct earc {
        int sysclk_freq;
 };
 
+#include <linux/amlogic/media/sound/hdmi_earc.h>
+
+void earc_hdmirx_hpdst(int earc_port, bool st)
+{
+};
+
+void earc_hdmitx_hpdst(bool st)
+{
+};
+
 #define PREALLOC_BUFFER_MAX    (256 * 1024)
 
 #define EARC_RATES      (SNDRV_PCM_RATE_8000_192000)