From c411936feb52a74ce28ead3d8dea6056f8ba8a4a Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 27 Nov 2014 17:54:25 +0100 Subject: [PATCH] drm/i915: idle gmbus in intel_i2c_reset The bios might have left a transaction hanging in there, let's see what happens ... References: https://bugs.freedesktop.org/show_bug.cgi?id=58876 Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_i2c.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index b31088a551f2..6cae92fea642 100644 --- a/drivers/gpu/drm/i915/intel_i2c.c +++ b/drivers/gpu/drm/i915/intel_i2c.c @@ -58,15 +58,6 @@ to_intel_gmbus(struct i2c_adapter *i2c) return container_of(i2c, struct intel_gmbus, adapter); } -void -intel_i2c_reset(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - - I915_WRITE(dev_priv->gpio_mmio_base + GMBUS0, 0); - I915_WRITE(dev_priv->gpio_mmio_base + GMBUS4, 0); -} - static void intel_i2c_quirk_set(struct drm_i915_private *dev_priv, bool enable) { u32 val; @@ -269,6 +260,16 @@ gmbus_wait_idle(struct drm_i915_private *dev_priv) #undef C } +void +intel_i2c_reset(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + gmbus_wait_idle(dev_priv); + I915_WRITE(dev_priv->gpio_mmio_base + GMBUS0, 0); + I915_WRITE(dev_priv->gpio_mmio_base + GMBUS4, 0); +} + static int gmbus_xfer_read(struct drm_i915_private *dev_priv, struct i2c_msg *msg, u32 gmbus1_index) -- 2.1.1