CHROMIUM: drm: bridge/dw_hdmi: Reorg hdmi_unmute_interrupts()
authorDouglas Anderson <dianders@chromium.org>
Wed, 16 Sep 2015 16:06:08 +0000 (09:06 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 06:34:28 +0000 (14:34 +0800)
Reorganize hdmi_unmute_interrupts() to put all the HPD-related config
together.  This also eliminates an extra clearning of the HPD
interrupt.

BUG=chrome-os-partner:44922
TEST=HDMI still works fine.

Change-Id: I9d3cd847a00f9c887e2d054ff2b5671b0eeb8a42
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/299777
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
drivers/gpu/drm/bridge/dw-hdmi.c

index 9dc4cf744600898585369d1c02a702dda748fdd8..0ddc7b7da990492a7b575f62b9a637e67c35dab0 100644 (file)
@@ -2115,16 +2115,6 @@ int dw_hdmi_bind(struct device *dev, struct device *master,
         */
        hdmi_init_clk_regenerator(hdmi);
 
-       /*
-        * Configure registers related to HDMI interrupt
-        * generation before registering IRQ.
-        */
-       hdmi_writeb(hdmi, HDMI_PHY_HPD | HDMI_PHY_RX_SENSE, HDMI_PHY_POL0);
-
-       /* Clear Hotplug interrupts */
-       hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
-                   HDMI_IH_PHY_STAT0);
-
        hdmi_writeb(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL,
                    HDMI_PHY_I2CM_INT_ADDR);
 
@@ -2132,18 +2122,16 @@ int dw_hdmi_bind(struct device *dev, struct device *master,
                    HDMI_PHY_I2CM_CTLINT_ADDR_ARBITRATION_POL,
                    HDMI_PHY_I2CM_CTLINT_ADDR);
 
-       /* enable cable hot plug irq */
-       hdmi_writeb(hdmi, hdmi->phy_mask, HDMI_PHY_MASK0);
+       /* Re-init HPD polarity */
+       hdmi_writeb(hdmi, HDMI_PHY_HPD | HDMI_PHY_RX_SENSE, HDMI_PHY_POL0);
 
-       /* Clear Hotplug interrupts */
-       hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
-                   HDMI_IH_PHY_STAT0);
+       /* Unmask HPD, clear transitory interrupts, then unmute */
+       hdmi_writeb(hdmi, hdmi->phy_mask, HDMI_PHY_MASK0);
 
        ret = dw_hdmi_register(drm, hdmi);
        if (ret)
                goto err_iahb;
 
-       /* Unmute interrupts */
        hdmi_writeb(hdmi, ~(HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE),
                    HDMI_IH_MUTE_PHY_STAT0);