diff options
author | Rob Clark <rob@ti.com> | 2010-08-27 13:48:31 -0500 |
---|---|---|
committer | Sebastien Jan <s-jan@ti.com> | 2010-09-01 18:20:36 +0200 |
commit | e3acc167de4ba3f69b05b9a72cdfed1d3f599b3a (patch) | |
tree | 59ca25a6b93f76d96cab7cbca91f9f744bc2cb63 /arch | |
parent | 5c14f478b9b4495521cf4044afbf170c0514f823 (diff) |
OMAP4:DSS:HDMI: don't handle DISCONNECT if we've already got a CONNECT
(renamed from:
RFC: don't handle DISCONNECT if we've already got a CONNECT)
Change the irq status to be a bitmask, so multiple irq's can be
handled at one time in work-queue function. This avoids handling
a disconnect if a connect already comes by the time the work
queue function runs.
Also, avoid powering off PHY/PLL to avoid getting inconsistant
connect/disconnect interrupts and inconsistant HPD status.
Signed-off-by: Rob Clark <rob@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-omap/hdmi_lib.c | 38 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/hdmi_lib.h | 5 |
2 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/plat-omap/hdmi_lib.c b/arch/arm/plat-omap/hdmi_lib.c index 6058fdfa2ae5..bf4065018d87 100644 --- a/arch/arm/plat-omap/hdmi_lib.c +++ b/arch/arm/plat-omap/hdmi_lib.c @@ -924,6 +924,7 @@ int hdmi_w1_set_wait_srest(void) /* PHY_PWR_CMD */ int hdmi_w1_set_wait_phy_pwr(HDMI_PhyPwr_t val) { + DBG("*** Set PHY power mode to %d\n", val); REG_FLD_MOD(HDMI_WP, HDMI_WP_PWR_CTRL, val, 7, 6); if (hdmi_w1_wait_for_bit_change(HDMI_WP, @@ -1361,32 +1362,27 @@ void HDMI_W1_HPD_handler(int *r) hdmi_read_reg(HDMI_WP, HDMI_WP_IRQSTATUS); mdelay(30); *r = 0; - if ((count == 0) && ((val & 0x02000000) == 0x02000000) && - ((set & 0x00000002) != 0x00000002)) { - *r = 2; - DBG("First interrupt physical attach but not HPD"); - count_hpd = 0; + + if (val & 0x02000000) { + DBG("connect, "); + *r |= HDMI_CONNECT; } - count++; - hdmi_set_irqs(); - DBG("%d count and count_hpd %d", count, count_hpd); - if ((set & 0x00000002) == 0x00000002) { - if (count_hpd == 0) { - *r = 4; - count_hpd++; - goto end; - } else - *r = 1; - DBG("HPD is set you can read edid"); + if (set & 0x00000002) { + DBG("hpd (count=%d), ", count_hpd); + *r |= HDMI_HPD; + if (count_hpd == 0) + *r |= HDMI_FIRST_HPD; + count_hpd++; } - if (((val & 0x04000000) == 0x04000000) && ((set & 0x00000002) != 0x00000002)) { - *r = 3; - count = 0; + if ((val & 0x04000000) && !(set & 0x00000002)) { + DBG("disconnect, "); + *r |= HDMI_DISCONNECT; count_hpd = 0; } + hdmi_set_irqs(); + intr = hdmi_read_reg(HDMI_CORE_SYS, HDMI_CORE_SYS__INTR1); - DBG("%x hdmi_core_sys_sys_intr\n", intr); - end: /*Do nothing*/; + DBG("intr=%08x\n", intr); } diff --git a/arch/arm/plat-omap/include/plat/hdmi_lib.h b/arch/arm/plat-omap/include/plat/hdmi_lib.h index 03958e171e2c..bf8065ef1e62 100644 --- a/arch/arm/plat-omap/include/plat/hdmi_lib.h +++ b/arch/arm/plat-omap/include/plat/hdmi_lib.h @@ -408,6 +408,11 @@ struct hdmi_core_audio_config { enum hdmi_cea_code if_audio_channel_location; }; +#define HDMI_CONNECT 0x01 +#define HDMI_DISCONNECT 0x02 +#define HDMI_HPD 0x04 +#define HDMI_FIRST_HPD 0x08 + /* Function prototype */ int HDMI_W1_StopVideoFrame(u32); int HDMI_W1_StartVideoFrame(u32); |