CHROMIUM: drm: bridge/dw_hdmi: Eliminate dw_hdmi_fb_registered()
authorDouglas Anderson <dianders@chromium.org>
Wed, 16 Sep 2015 15:49:33 +0000 (08:49 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 06:34:07 +0000 (14:34 +0800)
This is a no-op change that eliminates the dw_hdmi_fb_registered()
function and just folds the code into the one caller of the function:
hdmi_unmute_interrupts().

Eliminated because:

* The name and comment of the function implied that it was to be called
  after the frame buffer was registered.  ...but it wasn't called when
  that happened, at least not directly.

* The function does some parts of enabling the HPD interrupt but not all
  parts.  Other parts are done by the calling function, and the calling
  function also duplicates some bits (like clearing existing HPD).  The
  split doesn't make sense.

A future change will reorganize hdmi_unmute_interrupts() a little.

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

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

index be0e1a3959e7c8fd4c09f9540024538468670edf..9dc4cf744600898585369d1c02a702dda748fdd8 100644 (file)
@@ -1570,26 +1570,6 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
        return 0;
 }
 
-/* Wait until we are registered to enable interrupts */
-static int dw_hdmi_fb_registered(struct dw_hdmi *hdmi)
-{
-       hdmi_writeb(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL,
-                   HDMI_PHY_I2CM_INT_ADDR);
-
-       hdmi_writeb(hdmi, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL |
-                   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);
-
-       /* Clear Hotplug interrupts */
-       hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
-                   HDMI_IH_PHY_STAT0);
-
-       return 0;
-}
-
 static void initialize_hdmi_ih_mutes(struct dw_hdmi *hdmi)
 {
        u8 ih_mute;
@@ -2145,9 +2125,19 @@ int dw_hdmi_bind(struct device *dev, struct device *master,
        hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
                    HDMI_IH_PHY_STAT0);
 
-       ret = dw_hdmi_fb_registered(hdmi);
-       if (ret)
-               goto err_iahb;
+       hdmi_writeb(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL,
+                   HDMI_PHY_I2CM_INT_ADDR);
+
+       hdmi_writeb(hdmi, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL |
+                   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);
+
+       /* Clear Hotplug interrupts */
+       hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE,
+                   HDMI_IH_PHY_STAT0);
 
        ret = dw_hdmi_register(drm, hdmi);
        if (ret)