From patchwork Fri Apr 19 08:41:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?David_M=C3=BCller?= X-Patchwork-Id: 2463481 Return-Path: X-Original-To: patchwork-dri-devel@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 EFF1B3FD8C for ; Fri, 19 Apr 2013 08:41:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFB81E67A3 for ; Fri, 19 Apr 2013 01:41:49 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by gabe.freedesktop.org (Postfix) with ESMTP id DA430E5F4E for ; Fri, 19 Apr 2013 01:41:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id CC5F717240; Fri, 19 Apr 2013 10:41:33 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id EynSABWBFpq8; Fri, 19 Apr 2013 10:41:33 +0200 (CEST) Received: from [192.168.11.10] (80-218-111-224.dclient.hispeed.ch [80.218.111.224]) by mail.hostpark.net (Postfix) with ESMTPA id 0DDDE171F2; Fri, 19 Apr 2013 10:41:32 +0200 (CEST) Message-ID: <5171034E.1020204@elsoft.ch> Date: Fri, 19 Apr 2013 10:41:50 +0200 From: =?UTF-8?B?IkRhdmlkIE3DvGxsZXIgKEVMU09GVCBBRyki?= Organization: ELSOFT AG User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1 MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Subject: [DVO][PATCH] drm/i915: Fall back to bit banging mode for DVO transmitter detection X-Enigmail-Version: 1.5.1 Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Hello As discussed in this thread http://lists.freedesktop.org/archives/dri-devel/2013-April/037411.html GMBUS based DVO transmitter detection seems to be unreliable which could result in an unusable DVO port. The attached patch fixes this by falling back to bit banging mode for the time DVO transmitter detection is in progress. Signed-off-by: David Müller Tested-by: David Müller diff -dpurN a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c --- a/drivers/gpu/drm/i915/intel_dvo.c 2012-12-11 10:09:35.113446850 +0100 +++ b/drivers/gpu/drm/i915/intel_dvo.c 2013-04-19 07:21:54.054546365 +0200 @@ -449,6 +449,7 @@ void intel_dvo_init(struct drm_device *d const struct intel_dvo_device *dvo = &intel_dvo_devices[i]; struct i2c_adapter *i2c; int gpio; + bool dvoinit; /* Allow the I2C driver info to specify the GPIO to be used in * special cases, but otherwise default to what's defined @@ -468,7 +469,17 @@ void intel_dvo_init(struct drm_device *d i2c = intel_gmbus_get_adapter(dev_priv, gpio); intel_dvo->dev = *dvo; - if (!dvo->dev_ops->init(&intel_dvo->dev, i2c)) + + /* GMBUS NAK handling seems to be unstable, hence let the + * transmitter detection run in bit banging mode for now. + */ + intel_gmbus_force_bit(i2c, true); + + dvoinit = dvo->dev_ops->init(&intel_dvo->dev, i2c); + + intel_gmbus_force_bit(i2c, false); + + if (!dvoinit) continue; intel_encoder->type = INTEL_OUTPUT_DVO;