Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293829
b: refs/heads/master
c: c2b9152
h: refs/heads/master
i:
  293827: 5fd80a0
v: v3
  • Loading branch information
Daniel Vetter committed Feb 29, 2012
1 parent 7dae290 commit b39a4fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 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: caae745a352377f48f6eb43b5040214d803a885f
refs/heads/master: c2b9152f098e213dc5f2e8a4dbbfe090302c58ed
13 changes: 8 additions & 5 deletions trunk/drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ enum intel_pch {
struct intel_fbdev;
struct intel_fbc_work;

struct intel_gmbus {
struct i2c_adapter adapter;
struct i2c_adapter *force_bit;
u32 reg0;
struct drm_i915_private *dev_priv;
};

typedef struct drm_i915_private {
struct drm_device *dev;

Expand All @@ -315,11 +322,7 @@ typedef struct drm_i915_private {
/** gt_lock is also taken in irq contexts. */
struct spinlock gt_lock;

struct intel_gmbus {
struct i2c_adapter adapter;
struct i2c_adapter *force_bit;
u32 reg0;
} *gmbus;
struct intel_gmbus *gmbus;

/** gmbus_mutex protects against concurrent usage of the single hw gmbus
* controller on different i2c buses. */
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/gpu/drm/i915/intel_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
struct intel_gmbus *bus = container_of(adapter,
struct intel_gmbus,
adapter);
struct drm_i915_private *dev_priv = adapter->algo_data;
struct drm_i915_private *dev_priv = bus->dev_priv;
int i, reg_offset, ret;

mutex_lock(&dev_priv->gmbus_mutex);
Expand Down Expand Up @@ -406,7 +406,7 @@ int intel_setup_gmbus(struct drm_device *dev)
names[i]);

bus->adapter.dev.parent = &dev->pdev->dev;
bus->adapter.algo_data = dev_priv;
bus->dev_priv = dev_priv;

bus->adapter.algo = &gmbus_algorithm;
ret = i2c_add_adapter(&bus->adapter);
Expand Down Expand Up @@ -447,7 +447,7 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit)

if (force_bit) {
if (bus->force_bit == NULL) {
struct drm_i915_private *dev_priv = adapter->algo_data;
struct drm_i915_private *dev_priv = bus->dev_priv;
bus->force_bit = intel_gpio_create(dev_priv,
bus->reg0 & 0xff);
}
Expand Down

0 comments on commit b39a4fe

Please sign in to comment.