MLK-20451-3: hdmi rx: Add hdmi rx cec running status
authorSandor Yu <Sandor.yu@nxp.com>
Fri, 23 Nov 2018 07:01:08 +0000 (15:01 +0800)
committerSandor Yu <Sandor.yu@nxp.com>
Fri, 19 Apr 2019 02:40:50 +0000 (10:40 +0800)
Add hdmi rx cec running status.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/media/platform/imx8/hdmi/mxc-hdmi-rx.c
drivers/media/platform/imx8/hdmi/mxc-hdmi-rx.h

index 43cee86..1eb48c1 100644 (file)
@@ -748,14 +748,16 @@ static void hpd5v_work_func(struct work_struct *work)
                if (hdmi_rx->is_cec) {
                        mxc_hdmi_cec_init(hdmi_rx);
                        imx_cec_register(&hdmi_rx->cec);
+                       hdmi_rx->cec_running = true;
                }
 #endif
        } else if (hpd == 0){
                pr_info("HDMI RX Cable Plug Out\n");
                hdmirx_stop(&hdmi_rx->state);
 #ifdef CONFIG_IMX_HDP_CEC
-               if (hdmi_rx->is_cec) {
+               if (hdmi_rx->is_cec && hdmi_rx->cec_running) {
                        imx_cec_unregister(&hdmi_rx->cec);
+                       hdmi_rx->cec_running = false;
                }
 #endif
                hdmirx_phy_pix_engine_reset(&hdmi_rx->state);
index 5541361..1c8292a 100644 (file)
@@ -124,6 +124,7 @@ struct mxc_hdmi_rx_dev {
        bool cable_plugin;
 
        u8 is_cec;
+       bool cec_running;
        struct imx_cec_dev cec;
        u32 sample_rate;
        u32 sample_width;