From patchwork Tue Nov 29 05:04:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9450949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C54436074E for ; Tue, 29 Nov 2016 05:05:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA5A3201BD for ; Tue, 29 Nov 2016 05:05:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD34127F46; Tue, 29 Nov 2016 05:05:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E78A201BD for ; Tue, 29 Nov 2016 05:05:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62AF36E4CF; Tue, 29 Nov 2016 05:05:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x22d.google.com (mail-pg0-x22d.google.com [IPv6:2607:f8b0:400e:c05::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id E90166E359 for ; Tue, 29 Nov 2016 05:04:54 +0000 (UTC) Received: by mail-pg0-x22d.google.com with SMTP id p66so65140853pga.2 for ; Mon, 28 Nov 2016 21:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bWTyujRgvakyVPts6T0J7XWWx80fqHixZ5h+Bwv3khY=; b=AYoPcbw6UPvotK8hQHAvRoiZ7kOzeq0NlrqiHZrecRrJBTsjA1OGqLWbK2pO+Cwusg FaasorduSf+mU6qQesvin2E4PhtbgENEDYweg1tN+CW7xhlj2owLwiLzuObVC9PSO5JK u3cm1yE+2RN2zFkSM7n+CBhruz0XjaGXW4XRM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bWTyujRgvakyVPts6T0J7XWWx80fqHixZ5h+Bwv3khY=; b=Bl4aaVHz95uLFHZvwVFjyfv1Hv8Hf8Ykmz69ikYrjsNoAu7CsT++wesdgBHUOE+l1u i98sh6dJf6gCdyvCLcoWxWn5IH4+A/a6i5dLJtYKpVnKgoW/iCq0Owe5q+xBw3gbx9M/ uPi5cf8r9BZ4W5dWG33idxaMMteWNKRjkpW4bq2T5ZCamjJ/TWqFFlgMA9LmraD/b1pY gtVoaaxV9oHkg9Tu5qwC4cU8bAyo3i1NgmJ7cuaxcCbOVHNoSj2NfHWKlifAepiPFDXk IK7v/xKQVPPt2OUgpMizWFyoQBvW0ucOFZ9EhW986da9CJCivuGtBIfIyygIsVH8mpqb 530Q== X-Gm-Message-State: AKaTC00AmYj5hu62V2VQ1DJoRfIktqIXKQmL0mZ15e2pziI50j+uZQIKZn44/RMLb3bnQX0V X-Received: by 10.99.207.17 with SMTP id j17mr45416353pgg.57.1480395894407; Mon, 28 Nov 2016 21:04:54 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id b29sm73191498pgn.48.2016.11.28.21.04.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 21:04:53 -0800 (PST) From: John Stultz To: lkml Subject: [RFC][PATCH 3/5 v2] drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve monitor detection Date: Mon, 28 Nov 2016 21:04:42 -0800 Message-Id: <1480395884-5471-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480395884-5471-1-git-send-email-john.stultz@linaro.org> References: <1480395884-5471-1-git-send-email-john.stultz@linaro.org> Cc: dri-devel@lists.freedesktop.org, Wolfram Sang , Laurent Pinchart X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Archit Taneja On some adv7511 implementations, we can get some spurious disconnect signals which can cause monitor probing to fail. This patch enables HPD (hot plug detect) interrupt support which allows the monitor to be properly re-initialized when the spurious disconnect signal goes away. This also enables proper hotplug support. Cc: David Airlie Cc: Archit Taneja Cc: Wolfram Sang Cc: Lars-Peter Clausen Cc: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org Acked-by: Laurent Pinchart Originally-by: Archit Taneja [jstultz: Added proper commit message] Signed-off-by: John Stultz --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 2caca0c..9f8dffd 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -338,7 +338,7 @@ static void adv7511_power_on(struct adv7511 *adv7511) * Still, let's be safe and stick to the documentation. */ regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0), - ADV7511_INT0_EDID_READY); + ADV7511_INT0_EDID_READY | ADV7511_INT0_HPD); regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1), ADV7511_INT1_DDC_ERROR); } @@ -833,6 +833,10 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge) if (adv->type == ADV7533) ret = adv7533_attach_dsi(adv); + if (adv->i2c_main->irq) + regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), + ADV7511_INT0_HPD); + return ret; }