Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196573
b: refs/heads/master
c: 7e99a9b
h: refs/heads/master
i:
  196571: d875e24
v: v3
  • Loading branch information
Ben Skeggs committed May 19, 2010
1 parent 2b51b4b commit 75cc52d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07fee3d561eb7634b08e4362dc9c5c5708facd03
refs/heads/master: 7e99a9b2b5386c0ea4234d2845932ff4ab8e4829
21 changes: 16 additions & 5 deletions trunk/drivers/gpu/drm/nouveau/nouveau_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,27 @@ struct nouveau_i2c_chan *
nouveau_i2c_find(struct drm_device *dev, int index)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nvbios *bios = &dev_priv->vbios;
struct dcb_i2c_entry *i2c = &dev_priv->vbios.dcb.i2c[index];

if (index >= DCB_MAX_NUM_I2C_ENTRIES)
return NULL;

if (!bios->dcb.i2c[index].chan) {
if (nouveau_i2c_init(dev, &bios->dcb.i2c[index], index))
return NULL;
if (dev_priv->chipset >= NV_50 && (i2c->entry & 0x00000100)) {
uint32_t reg = 0xe500, val;

if (i2c->port_type == 6) {
reg += i2c->read * 0x50;
val = 0x2002;
} else {
reg += ((i2c->entry & 0x1e00) >> 9) * 0x50;
val = 0xe001;
}

nv_wr32(dev, reg, (nv_rd32(dev, reg) & ~0xf003) | val);
}

return bios->dcb.i2c[index].chan;
if (!i2c->chan && nouveau_i2c_init(dev, i2c, index))
return NULL;
return i2c->chan;
}

0 comments on commit 75cc52d

Please sign in to comment.