]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/nouveau/i2c: segregate aux channel adapter indices from bit-banged i2c
authorBen Skeggs <bskeggs@redhat.com>
Wed, 24 Sep 2014 00:41:50 +0000 (10:41 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 2 Dec 2014 05:43:45 +0000 (15:43 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/disp/outp.c
drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
drivers/gpu/drm/nouveau/core/subdev/bios/init.c
drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
drivers/gpu/drm/nouveau/nouveau_bios.c

index a5ff00a9cedc044ee83d9ae343a0ed1461a38f3e..bbd9b6fdc90f1744ccce55375afa66f0f320fef0 100644 (file)
@@ -85,7 +85,10 @@ nvkm_output_create_(struct nouveau_object *parent,
            dcbE->sorconf.link : 0, dcbE->connector, dcbE->i2c_index,
            dcbE->bus, dcbE->heads);
 
-       outp->port = i2c->find(i2c, outp->info.i2c_index);
+       if (outp->info.type != DCB_OUTPUT_DP)
+               outp->port = i2c->find(i2c, NV_I2C_PORT(outp->info.i2c_index));
+       else
+               outp->port = i2c->find(i2c, NV_I2C_AUX(outp->info.i2c_index));
        outp->edid = outp->port;
 
        data = nvbios_connEp(bios, outp->info.connector, &ver, &hdr, &connE);
index 1b937c2c25ae2e43a6594c203ad989294028a57c..50453dd0f1d87932c69887b923ce30b8351540fc 100644 (file)
@@ -8,6 +8,8 @@
 #include <subdev/bios/i2c.h>
 
 #define NV_I2C_PORT(n)    (0x00 + (n))
+#define NV_I2C_AUX(n)     (0x10 + (n))
+#define NV_I2C_EXT(n)     (0x20 + (n))
 #define NV_I2C_DEFAULT(n) (0x80 + (n))
 
 #define NV_I2C_TYPE_DCBI2C(n) (0x0000 | (n))
index 2c9f2c36f8ccb56c344e8e264e645bfc96ba9473..0c0889e850240670a985015f09811e27289070da 100644 (file)
@@ -255,6 +255,8 @@ init_i2c(struct nvbios_init *init, int index)
                }
 
                index = init->outp->i2c_index;
+               if (init->outp->type == DCB_OUTPUT_DP)
+                       index += NV_I2C_AUX(0);
        }
 
        return i2c->find(i2c, index);
index 90d1660b8efab331d5569e75a29f756f19d48cbc..3376356aba43d973120ec6d4eb0e022fc9d2c1b1 100644 (file)
@@ -549,8 +549,12 @@ nouveau_i2c_create_(struct nouveau_object *parent,
                case DCB_I2C_NV04_BIT:
                case DCB_I2C_NV4E_BIT:
                case DCB_I2C_NVIO_BIT:
+                       nouveau_i2c_create_port(i2c, NV_I2C_PORT(index),
+                                               info.type, &info);
+                       break;
                case DCB_I2C_NVIO_AUX:
-                       nouveau_i2c_create_port(i2c, index, info.type, &info);
+                       nouveau_i2c_create_port(i2c, NV_I2C_AUX(index),
+                                               info.type, &info);
                        break;
                case DCB_I2C_UNUSED:
                default:
@@ -562,7 +566,7 @@ nouveau_i2c_create_(struct nouveau_object *parent,
         * may be ddc/aux channels hiding behind external tmds/dp/etc
         * transmitters.
         */
-       index = ((index + 0x0f) / 0x10) * 0x10;
+       index = NV_I2C_EXT(0);
        i = -1;
        while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &outp))) {
                if (!outp.location || !outp.extdev)
index dae2c96deef86f882888899f64d952950587882d..2c6b4a00debb3b587124a84280b9e0982368f90a 100644 (file)
@@ -1493,6 +1493,7 @@ parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb,
                        break;
                }
                link = entry->dpconf.sor.link;
+               entry->i2c_index += NV_I2C_AUX(0);
                break;
        case DCB_OUTPUT_TMDS:
                if (dcb->version >= 0x40) {