aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_i2c.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-30 12:55:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-30 12:55:53 -0400
commit6bb340c7868fbfd7bd0e8a0e23397a2bcb528429 (patch)
treea171806a7d992073865f0d2885c22004264ee8fb /drivers/gpu/drm/i915/intel_i2c.c
parenta70f35af4e49f87ba4b6c4b30220fbb66cd74af6 (diff)
parentbc42aabc6a01b92b0f961d65671564e0e1cd7592 (diff)
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Just regular fixes, bunch from intel, quieting some of the over zealous power warnings, and the rest just misc. I've got another pull with the remaining dma-buf bits, since the vmap bits are in your tree now. I'll send tomorrow just to space things out a bit." * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits) drm/edid/quirks: ViewSonic VA2026w drm/udl: remove unused variables. drm/radeon: fix XFX quirk drm: Use stdint types for consistency drm: Constify params to format_check() and framebuffer_checks() drm/radeon: fix typo in trinity tiling setup drm/udl: unlock before returning in udl_gem_mmap() radeon: make radeon_cs_update_pages static. drm/i915: tune down the noise of the RP irq limit fail drm/i915: Remove the error message for unbinding pinned buffers drm/i915: Limit page allocations to lowmem (dma32) for i965 drm/i915: always use RPNSWREQ for turbo change requests drm/i915: reject doubleclocked cea modes on dp drm/i915: Adding TV Out Missing modes. drm/i915: wait for a vblank to pass after tv detect drm/i915: no lvds quirk for HP t5740e Thin Client drm/i915: enable vdd when switching off the eDP panel drm/i915: Fix PCH PLL assertions to not assume CRTC:PLL relationship drm/i915: Always update RPS interrupts thresholds along with frequency drm/i915: properly handle interlaced bit for sdvo dtd conversion ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_i2c.c')
-rw-r--r--drivers/gpu/drm/i915/intel_i2c.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 4a9707dd0f9c..1991a4408cf9 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -396,11 +396,22 @@ clear_err:
396 * Wait for bus to IDLE before clearing NAK. 396 * Wait for bus to IDLE before clearing NAK.
397 * If we clear the NAK while bus is still active, then it will stay 397 * If we clear the NAK while bus is still active, then it will stay
398 * active and the next transaction may fail. 398 * active and the next transaction may fail.
399 *
400 * If no ACK is received during the address phase of a transaction, the
401 * adapter must report -ENXIO. It is not clear what to return if no ACK
402 * is received at other times. But we have to be careful to not return
403 * spurious -ENXIO because that will prevent i2c and drm edid functions
404 * from retrying. So return -ENXIO only when gmbus properly quiescents -
405 * timing out seems to happen when there _is_ a ddc chip present, but
406 * it's slow responding and only answers on the 2nd retry.
399 */ 407 */
408 ret = -ENXIO;
400 if (wait_for((I915_READ(GMBUS2 + reg_offset) & GMBUS_ACTIVE) == 0, 409 if (wait_for((I915_READ(GMBUS2 + reg_offset) & GMBUS_ACTIVE) == 0,
401 10)) 410 10)) {
402 DRM_DEBUG_KMS("GMBUS [%s] timed out after NAK\n", 411 DRM_DEBUG_KMS("GMBUS [%s] timed out after NAK\n",
403 adapter->name); 412 adapter->name);
413 ret = -ETIMEDOUT;
414 }
404 415
405 /* Toggle the Software Clear Interrupt bit. This has the effect 416 /* Toggle the Software Clear Interrupt bit. This has the effect
406 * of resetting the GMBUS controller and so clearing the 417 * of resetting the GMBUS controller and so clearing the
@@ -414,14 +425,6 @@ clear_err:
414 adapter->name, msgs[i].addr, 425 adapter->name, msgs[i].addr,
415 (msgs[i].flags & I2C_M_RD) ? 'r' : 'w', msgs[i].len); 426 (msgs[i].flags & I2C_M_RD) ? 'r' : 'w', msgs[i].len);
416 427
417 /*
418 * If no ACK is received during the address phase of a transaction,
419 * the adapter must report -ENXIO.
420 * It is not clear what to return if no ACK is received at other times.
421 * So, we always return -ENXIO in all NAK cases, to ensure we send
422 * it at least during the one case that is specified.
423 */
424 ret = -ENXIO;
425 goto out; 428 goto out;
426 429
427timeout: 430timeout: