summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Huehner <stefan@huehner.org>2015-02-22 15:46:36 +0100
committerBen Skeggs <bskeggs@redhat.com>2015-03-17 09:38:54 +1000
commitb570e10f9b3c8228802f2a2a70dfe6645bc2f317 (patch)
tree1cb9f63f3bda8deff62de5223e80231ca13ded6e
parentb9a3a39f5f69e46aed48ac42f11c92d46f310435 (diff)
bios: fix i2c table parsing for dcb 4.1linux-3.20
Code before looked only at bit 31 to decide if a port is unused. However dcb 4.1 spec says 0x1F in bits 31-27 and 26-22 means unused. This fixed hdmi monitor detection on GM206. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drm/nouveau/nvkm/subdev/bios/i2c.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drm/nouveau/nvkm/subdev/bios/i2c.c b/drm/nouveau/nvkm/subdev/bios/i2c.c
index d1a89b2b..c4e1f085 100644
--- a/drm/nouveau/nvkm/subdev/bios/i2c.c
+++ b/drm/nouveau/nvkm/subdev/bios/i2c.c
@@ -74,7 +74,11 @@ dcb_i2c_parse(struct nvkm_bios *bios, u8 idx, struct dcb_i2c_entry *info)
u16 ent = dcb_i2c_entry(bios, idx, &ver, &len);
if (ent) {
if (ver >= 0x41) {
- if (!(nv_ro32(bios, ent) & 0x80000000))
+ u32 ent_value = nv_ro32(bios, ent);
+ u8 i2c_port = (ent_value >> 27) & 0x1f;
+ u8 dpaux_port = (ent_value >> 22) & 0x1f;
+ /* value 0x1f means unused according to DCB 4.x spec */
+ if (i2c_port == 0x1f && dpaux_port == 0x1f)
info->type = DCB_I2C_UNUSED;
else
info->type = DCB_I2C_PMGR;