Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59365671 authored by Ben Skeggs's avatar Ben Skeggs Committed by Dave Airlie
Browse files

drm/nouveau/i2c: fix thinko/regression on really old chipsets



Fixes i2c on my TNT2.

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent c8435362
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -315,8 +315,8 @@ nouveau_i2c_init(struct drm_device *dev)
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct nvbios *bios = &dev_priv->vbios;
	struct nvbios *bios = &dev_priv->vbios;
	struct nouveau_i2c_chan *port;
	struct nouveau_i2c_chan *port;
	u8 version = 0x00, entries, recordlen;
	u8 *i2c, *entry, legacy[2][4] = {};
	u8 *i2c, *entry, legacy[2][4] = {};
	u8 version, entries, recordlen;
	int ret, i;
	int ret, i;


	INIT_LIST_HEAD(&dev_priv->i2c_ports);
	INIT_LIST_HEAD(&dev_priv->i2c_ports);
@@ -346,12 +346,12 @@ nouveau_i2c_init(struct drm_device *dev)
		if (i2c[7]) legacy[1][1] = i2c[7];
		if (i2c[7]) legacy[1][1] = i2c[7];
	}
	}


	if (i2c && version >= 0x30) {
	if (version >= 0x30) {
		entry     = i2c[1] + i2c;
		entry     = i2c[1] + i2c;
		entries   = i2c[2];
		entries   = i2c[2];
		recordlen = i2c[3];
		recordlen = i2c[3];
	} else
	} else
	if (i2c) {
	if (version) {
		entry     = i2c;
		entry     = i2c;
		entries   = 16;
		entries   = 16;
		recordlen = 4;
		recordlen = 4;