Commit 5a6f690c authored by Stefan Huehner's avatar Stefan Huehner Committed by Ben Skeggs

drm/nouveau/bios: fix i2c table parsing for dcb 4.1

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: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7e547adc
...@@ -74,7 +74,11 @@ dcb_i2c_parse(struct nvkm_bios *bios, u8 idx, struct dcb_i2c_entry *info) ...@@ -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); u16 ent = dcb_i2c_entry(bios, idx, &ver, &len);
if (ent) { if (ent) {
if (ver >= 0x41) { 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; info->type = DCB_I2C_UNUSED;
else else
info->type = DCB_I2C_PMGR; info->type = DCB_I2C_PMGR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment