From: Tomi Valkeinen Date: Thu, 6 Jun 2013 10:08:35 +0000 (+0300) Subject: OMAPDSS: HDMI: clean up PHY power handling X-Git-Tag: v3.11-rc1~66^2~3^2~5 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddb1d5ca99f515442592b487171481dbf3a309d5;p=pandora-kernel.git OMAPDSS: HDMI: clean up PHY power handling The TRM tells to set PHY to TXON only after getting LINK_CONNECT, and to set PHY to OFF or LDOON after getting LINK_DISCONNECT, in order to avoid damage to the PHY. We don't currently do it quite like that. Instead of using the HDMI interrupts, we use HPD signal. This works, but is not actually quite correct, as HPD comes at a different time than LINK_CONNECT and LINK_DISCONNECT interrupts. Also, the HPD GPIO is a property of the TPD level shifter, not HDMI IP, so handling the GPIO in the HDMI driver is wrong. This patch implements the PHY power handling correctly, using the interrupts. There is a corner case that causes some additional difficulties: we may get both LINK_CONNECT and LINK_DISCONNECT interrupts at the same time. This is handled in the code by retrying: turning off the PHY, clearing the interrupt status, and re-enabling the PHY. This causes a new LINK_CONNECT interrupt to happen if a cable is connected. Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 0f93903d4409..0fb3662e28b6 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -1072,6 +1072,12 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) if (IS_ERR(hdmi.ip_data.base_wp)) return PTR_ERR(hdmi.ip_data.base_wp); + hdmi.ip_data.irq = platform_get_irq(pdev, 0); + if (hdmi.ip_data.irq < 0) { + DSSERR("platform_get_irq failed\n"); + return -ENODEV; + } + r = hdmi_get_clocks(pdev); if (r) { DSSERR("can't get clocks\n"); Reading git-diff-tree failed