Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306980
b: refs/heads/master
c: 110447f
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Vetter committed Mar 25, 2012
1 parent 36d29e7 commit ae7ffa5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 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: eef4eacb6ed3940b4a15daf3fbd060243e54056c
refs/heads/master: 110447fc2f30c22dcaa1936828cb33cec5b72272
5 changes: 5 additions & 0 deletions trunk/drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ typedef struct drm_i915_private {
* controller on different i2c buses. */
struct mutex gmbus_mutex;

/**
* Base address of the gmbus and gpio block.
*/
uint32_t gpio_mmio_base;

struct pci_dev *bridge_dev;
struct intel_ring_buffer ring[I915_NUM_RINGS];
uint32_t next_seqno;
Expand Down
15 changes: 8 additions & 7 deletions trunk/drivers/gpu/drm/i915/intel_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ void
intel_i2c_reset(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
if (HAS_PCH_SPLIT(dev))
I915_WRITE(PCH_GMBUS0, 0);
else
I915_WRITE(GMBUS0, 0);
I915_WRITE(dev_priv->gpio_mmio_base + GMBUS0, 0);
}

static void intel_i2c_quirk_set(struct drm_i915_private *dev_priv, bool enable)
Expand Down Expand Up @@ -162,8 +159,7 @@ intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
algo = &bus->bit_algo;

bus->gpio_reg = map_pin_to_reg[pin];
if (HAS_PCH_SPLIT(dev_priv->dev))
bus->gpio_reg += PCH_GPIOA - GPIOA;
bus->gpio_reg += dev_priv->gpio_mmio_base;

bus->adapter.algo_data = algo;
algo->setsda = set_data;
Expand Down Expand Up @@ -219,7 +215,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
goto out;
}

reg_offset = HAS_PCH_SPLIT(dev_priv->dev) ? PCH_GMBUS0 - GMBUS0 : 0;
reg_offset = dev_priv->gpio_mmio_base;

I915_WRITE(GMBUS0 + reg_offset, bus->reg0);

Expand Down Expand Up @@ -359,6 +355,11 @@ int intel_setup_gmbus(struct drm_device *dev)
struct drm_i915_private *dev_priv = dev->dev_private;
int ret, i;

if (HAS_PCH_SPLIT(dev))
dev_priv->gpio_mmio_base = PCH_GPIOA - GPIOA;
else
dev_priv->gpio_mmio_base = 0;

dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus),
GFP_KERNEL);
if (dev_priv->gmbus == NULL)
Expand Down

0 comments on commit ae7ffa5

Please sign in to comment.