From patchwork Tue Aug 21 08:37:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1353721 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id D0ABB40210 for ; Tue, 21 Aug 2012 10:43:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB0B29F676 for ; Tue, 21 Aug 2012 03:43:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 072989E88B for ; Tue, 21 Aug 2012 01:37:30 -0700 (PDT) Received: by eekc13 with SMTP id c13so1729130eek.36 for ; Tue, 21 Aug 2012 01:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer; bh=mL1aHzhe44ulQRugOcZ1cuRmKQ3GIbOOAYc5filIM8c=; b=TL2ZpQ9N9XU/ObUtTwYXh2jqWJobcTKURY0kGr42KYqXIRBspl3sO0W2S6yY52ljPd SzaFQoQmVlP8usMy9mbcKE7m1Q9dNPqAIandH9wlQRBBfOyiKLz67ZeSHVE7+gjrdcZw 3wM6fHc5K+g3dpNot3HwnTXEdZ7bUCkoTDq28= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=mL1aHzhe44ulQRugOcZ1cuRmKQ3GIbOOAYc5filIM8c=; b=NmNT2Xstxmn01LWZeawWAatfq1pvxtIoSIaI3wqB8S/Awn2aQwLjDeC6Qum+6Dmyff 5P6oq6BJGXAak1M52a8XQ5g53ym1AR5SbpAB8dVp1i2kD8+s6BTPhoPnYfZIllYiiAO9 zinXIUhU31Xicx48Mq/EIGbbV/am+6R1ZDacBHSQfHbiEamo0+eWf4M+zad+pBsvvJae GJbx2QhDsy8v1nD10E7xSQAQOGHjNAqFD3fud6JKpLS6R4Qv9gWE/fbKnkDnjxN334v5 B8F7TTXmz3nYwdZqXOR6/idVgj4ogyrORTRhcmQELloc0RXSuoKye283+qDKmfz1QDqz VZcg== Received: by 10.14.181.132 with SMTP id l4mr12455752eem.17.1345538249717; Tue, 21 Aug 2012 01:37:29 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id 45sm2230982eed.17.2012.08.21.01.37.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 01:37:28 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Tue, 21 Aug 2012 10:37:49 +0200 Message-Id: <1345538269-27765-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnDlBuJO2mXeduvgcnfMyk7DoxMRblqedcixB6WFlkEQl/HH/2o1sYP+EzJDoUFbFKAVyX1 Cc: Jani Nikula , Daniel Vetter , stable@vger.kernel.org Subject: [Intel-gfx] [PATCH] drm/i915: enforce bitbanging for i2c X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Now that we have also have a workaround for crt to fallback to bitbanging in some cases and then restore gmbus again, we need to ensure that we don't try to enable gmbus on broken hw (like i830M). Previously only sdvo had a bit-banging fallback, and sdvo is gen3+ only, so no issue with that. Enforce this by tracking separately whether gmbus even could work. This issue has been introduced in commit f1a2f5b7c5f0941d23eef0a095c0b99bf8d051e6 Author: Jani Nikula Date: Mon Aug 13 13:22:35 2012 +0300 drm/i915: fall back to bit-banging if GMBUS fails in CRT EDID reads Found by code-inspection, no bug report afaik. Cc: Jani Nikula Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_i2c.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a2382a1..365df4c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -382,6 +382,7 @@ struct intel_fbc_work; struct intel_gmbus { struct i2c_adapter adapter; bool force_bit; + bool always_bit; u32 reg0; u32 gpio_reg; struct i2c_algo_bit_data bit_algo; diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index b9755f6..e79f316 100644 --- a/drivers/gpu/drm/i915/intel_i2c.c +++ b/drivers/gpu/drm/i915/intel_i2c.c @@ -492,7 +492,7 @@ int intel_setup_gmbus(struct drm_device *dev) /* gmbus seems to be broken on i830 */ if (IS_I830(dev)) - bus->force_bit = true; + bus->always_bit = bus->force_bit = true; intel_gpio_setup(bus, port); @@ -533,6 +533,9 @@ void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit) { struct intel_gmbus *bus = to_intel_gmbus(adapter); + if (bus->always_bit) + force_bit = true; + bus->force_bit = force_bit; }