[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331121050-17857-7-git-send-email-djkurtz@chromium.org>
Date: Wed, 7 Mar 2012 19:50:47 +0800
From: Daniel Kurtz <djkurtz@...omium.org>
To: Keith Packard <keithp@...thp.com>, David Airlie <airlied@...ux.ie>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc: Benson Leung <bleung@...omium.org>,
Yufeng Shen <miletus@...omium.org>,
Sameer Nanda <snanda@...omium.org>,
Daniel Kurtz <djkurtz@...omium.org>
Subject: [PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK
Return -ENXIO if a device NAKs a transaction.
Note: We should return -ETIMEDOUT, too if the transaction times out,
however, that error path is currently handled by the 'bit-bang fallback'.
Signed-off-by: Daniel Kurtz <djkurtz@...omium.org>
---
drivers/gpu/drm/i915/intel_i2c.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index b97392c..2cdd531 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -243,6 +243,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
adapter);
struct drm_i915_private *dev_priv = adapter->algo_data;
int i, reg_offset;
+ int ret = 0;
if (bus->force_bit)
return intel_i2c_quirk_xfer(dev_priv, bus->force_bit, msgs,
@@ -333,6 +334,7 @@ clear_err:
*/
I915_WRITE(GMBUS1 + reg_offset, GMBUS_SW_CLR_INT);
I915_WRITE(GMBUS1 + reg_offset, 0);
+ ret = -ENXIO;
done:
/* Mark the GMBUS interface as disabled. We will re-enable it at the
@@ -342,7 +344,7 @@ done:
mutex_unlock(&dev_priv->gmbus_mutex);
- return i;
+ return ret ?: i;
timeout:
DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n",
--
1.7.7.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists