diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-09-23 20:41:50 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-12-02 00:43:45 -0500 |
commit | 5b34cebe994b51a0d8a039be49b48756c0d3f7a7 (patch) | |
tree | d53882d4e370da44bba13a2f83f5e26dd33beae1 | |
parent | 309a5702c23f556d2125c38f7370eab4da0e479d (diff) |
drm/nouveau/i2c: segregate aux channel adapter indices from bit-banged i2c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/outp.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/subdev/i2c.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/i2c/base.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 1 |
5 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/outp.c b/drivers/gpu/drm/nouveau/core/engine/disp/outp.c index a5ff00a9cedc..bbd9b6fdc90f 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/outp.c | |||
@@ -85,7 +85,10 @@ nvkm_output_create_(struct nouveau_object *parent, | |||
85 | dcbE->sorconf.link : 0, dcbE->connector, dcbE->i2c_index, | 85 | dcbE->sorconf.link : 0, dcbE->connector, dcbE->i2c_index, |
86 | dcbE->bus, dcbE->heads); | 86 | dcbE->bus, dcbE->heads); |
87 | 87 | ||
88 | outp->port = i2c->find(i2c, outp->info.i2c_index); | 88 | if (outp->info.type != DCB_OUTPUT_DP) |
89 | outp->port = i2c->find(i2c, NV_I2C_PORT(outp->info.i2c_index)); | ||
90 | else | ||
91 | outp->port = i2c->find(i2c, NV_I2C_AUX(outp->info.i2c_index)); | ||
89 | outp->edid = outp->port; | 92 | outp->edid = outp->port; |
90 | 93 | ||
91 | data = nvbios_connEp(bios, outp->info.connector, &ver, &hdr, &connE); | 94 | data = nvbios_connEp(bios, outp->info.connector, &ver, &hdr, &connE); |
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h b/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h index 1b937c2c25ae..50453dd0f1d8 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <subdev/bios/i2c.h> | 8 | #include <subdev/bios/i2c.h> |
9 | 9 | ||
10 | #define NV_I2C_PORT(n) (0x00 + (n)) | 10 | #define NV_I2C_PORT(n) (0x00 + (n)) |
11 | #define NV_I2C_AUX(n) (0x10 + (n)) | ||
12 | #define NV_I2C_EXT(n) (0x20 + (n)) | ||
11 | #define NV_I2C_DEFAULT(n) (0x80 + (n)) | 13 | #define NV_I2C_DEFAULT(n) (0x80 + (n)) |
12 | 14 | ||
13 | #define NV_I2C_TYPE_DCBI2C(n) (0x0000 | (n)) | 15 | #define NV_I2C_TYPE_DCBI2C(n) (0x0000 | (n)) |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c index 2c9f2c36f8cc..0c0889e85024 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c | |||
@@ -255,6 +255,8 @@ init_i2c(struct nvbios_init *init, int index) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | index = init->outp->i2c_index; | 257 | index = init->outp->i2c_index; |
258 | if (init->outp->type == DCB_OUTPUT_DP) | ||
259 | index += NV_I2C_AUX(0); | ||
258 | } | 260 | } |
259 | 261 | ||
260 | return i2c->find(i2c, index); | 262 | return i2c->find(i2c, index); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c index 90d1660b8efa..3376356aba43 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c | |||
@@ -549,8 +549,12 @@ nouveau_i2c_create_(struct nouveau_object *parent, | |||
549 | case DCB_I2C_NV04_BIT: | 549 | case DCB_I2C_NV04_BIT: |
550 | case DCB_I2C_NV4E_BIT: | 550 | case DCB_I2C_NV4E_BIT: |
551 | case DCB_I2C_NVIO_BIT: | 551 | case DCB_I2C_NVIO_BIT: |
552 | nouveau_i2c_create_port(i2c, NV_I2C_PORT(index), | ||
553 | info.type, &info); | ||
554 | break; | ||
552 | case DCB_I2C_NVIO_AUX: | 555 | case DCB_I2C_NVIO_AUX: |
553 | nouveau_i2c_create_port(i2c, index, info.type, &info); | 556 | nouveau_i2c_create_port(i2c, NV_I2C_AUX(index), |
557 | info.type, &info); | ||
554 | break; | 558 | break; |
555 | case DCB_I2C_UNUSED: | 559 | case DCB_I2C_UNUSED: |
556 | default: | 560 | default: |
@@ -562,7 +566,7 @@ nouveau_i2c_create_(struct nouveau_object *parent, | |||
562 | * may be ddc/aux channels hiding behind external tmds/dp/etc | 566 | * may be ddc/aux channels hiding behind external tmds/dp/etc |
563 | * transmitters. | 567 | * transmitters. |
564 | */ | 568 | */ |
565 | index = ((index + 0x0f) / 0x10) * 0x10; | 569 | index = NV_I2C_EXT(0); |
566 | i = -1; | 570 | i = -1; |
567 | while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &outp))) { | 571 | while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &outp))) { |
568 | if (!outp.location || !outp.extdev) | 572 | if (!outp.location || !outp.extdev) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index dae2c96deef8..2c6b4a00debb 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -1493,6 +1493,7 @@ parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb, | |||
1493 | break; | 1493 | break; |
1494 | } | 1494 | } |
1495 | link = entry->dpconf.sor.link; | 1495 | link = entry->dpconf.sor.link; |
1496 | entry->i2c_index += NV_I2C_AUX(0); | ||
1496 | break; | 1497 | break; |
1497 | case DCB_OUTPUT_TMDS: | 1498 | case DCB_OUTPUT_TMDS: |
1498 | if (dcb->version >= 0x40) { | 1499 | if (dcb->version >= 0x40) { |