summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2008-08-11 15:16:44 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-08-11 15:22:45 +0800
commit81bd24d8b1a3cdb8a539f4ca0c5f546e4c8070ed (patch)
treeb19e55981f74072779bf5c33dc91a0fcca76f410
parent02844d4dc0995f07dd438997ecc39bd9e3c4779b (diff)
Fix possible spurious interrupts in hotplug detect on 4 series chip
(cherry picked from commit d592eabc806b752053ade3c18e9dd8e0f39b45a3)
-rw-r--r--src/i810_reg.h2
-rw-r--r--src/i830_hdmi.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/i810_reg.h b/src/i810_reg.h
index 515e73d1..86909543 100644
--- a/src/i810_reg.h
+++ b/src/i810_reg.h
@@ -2813,4 +2813,6 @@ typedef enum {
#define DPFC_STATUS2 0x3214
#define DPFC_FENCE_YOFF 0x3218
+#define PEG_BAND_GAP_DATA 0x14d68
+
#endif /* _I810_REG_H */
diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c
index 58d1c49a..d56eec90 100644
--- a/src/i830_hdmi.c
+++ b/src/i830_hdmi.c
@@ -140,6 +140,15 @@ i830_hdmi_detect(xf86OutputPtr output)
I830Ptr pI830 = I830PTR(pScrn);
uint32_t temp, bit;
+ /* For G4X, PEG_BAND_GAP_DATA 3:0 must first be written 0xd.
+ * Failure to do so will result in spurious interrupts being
+ * generated on the port when a cable is not attached.
+ */
+ if (IS_G4X(pI830)) {
+ temp = INREG(PEG_BAND_GAP_DATA);
+ OUTREG(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd);
+ }
+
temp = INREG(PORT_HOTPLUG_EN);
OUTREG(PORT_HOTPLUG_EN,