From d994162350fe7f1c86d833b283bdfaf120f77bf2 Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Wed, 16 Sep 2015 08:49:33 -0700 Subject: [PATCH] CHROMIUM: drm: bridge/dw_hdmi: Eliminate dw_hdmi_fb_registered() 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 Reviewed-on: https://chromium-review.googlesource.com/299776 Reviewed-by: Yakir Yang Signed-off-by: Yakir Yang --- drivers/gpu/drm/bridge/dw-hdmi.c | 36 ++++++++++++-------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index be0e1a3959e7..9dc4cf744600 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -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) -- 2.34.1