From 7f3611ef45baaa02ac4bfb84a849e7cb0e42ed5d Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Wed, 16 Sep 2015 09:06:08 -0700 Subject: [PATCH] CHROMIUM: drm: bridge/dw_hdmi: Reorg hdmi_unmute_interrupts() 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 Signed-off-by: Yakir Yang Reviewed-on: https://chromium-review.googlesource.com/299777 Reviewed-by: Yakir Yang --- drivers/gpu/drm/bridge/dw-hdmi.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index 9dc4cf744600..0ddc7b7da990 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -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); -- 2.34.1