From patchwork Tue Jan 17 00:52:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9519713 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 151FC601C3 for ; Tue, 17 Jan 2017 00:53:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 006E828339 for ; Tue, 17 Jan 2017 00:53:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E968928441; Tue, 17 Jan 2017 00:53:13 +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 A0D2728339 for ; Tue, 17 Jan 2017 00:53:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B70A86E5A8; Tue, 17 Jan 2017 00:53:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32A486E594 for ; Tue, 17 Jan 2017 00:53:00 +0000 (UTC) Received: by mail-pg0-x22b.google.com with SMTP id t6so14250951pgt.3 for ; Mon, 16 Jan 2017 16:53:00 -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=6JyJ5RgoqRftK18waEcWXUupxdBK5DGZKck8m/LVYmQ=; b=S4PngVFTXr8LKjmMtvHPqBkfBrWWxYEvsQdq9mInyfRTd9bM0UrRLwH4c+OgfXbUOr viLn5x7lwEYGbOHvK/xxQf39A/JXkGF4Py35cARC7A5Cf+oKk+BTyKfqQ486GN5dg7I1 vqNPkXNYpLwv64zk4JzqhR0aC0Q1l5TkYILcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6JyJ5RgoqRftK18waEcWXUupxdBK5DGZKck8m/LVYmQ=; b=klpvplBGx1KD8piNvh+UbDH9RJEpO5oV+ztoci6cEo1a/Wx9YzOlVqZ2NujyBwpbSE EA7Jl6OccMg+oojfhcmTtMg2UV93oUU5zgsXbypY2xLn+lUfiIuFkM2DBDOrZQna4eos /G/thSdHH2YIq+jEerVRjXPuVq+htVCVnaOwZ252wWUrOGr2lrW0aJDnAUIpaXDfDAoW /hUathzBB+PcCZU+5UXnMfOI4UitHFFqVL/dWZqcv4nSJzkhZ71Cvf2ykuHb3vqVjLvE JpBHi+TDXKqXm9QcgpxAB+3eSTLwdgE1j7LobUFeOvgjuCdzOS+D1QiFAqiyUTJBOzha c+Ww== X-Gm-Message-State: AIkVDXJFM0+ZywGxMUAFo6GI38wQkj3tN9hQgfd3Gx4vKHM49HQotXMwWEADI7k+Yuyqhqwn X-Received: by 10.98.131.136 with SMTP id h130mr37407691pfe.4.1484614379631; Mon, 16 Jan 2017 16:52:59 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id q19sm50220516pfl.21.2017.01.16.16.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 16:52:59 -0800 (PST) From: John Stultz To: lkml Subject: [PATCH 3/6] drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve monitor detection Date: Mon, 16 Jan 2017 16:52:49 -0800 Message-Id: <1484614372-15342-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484614372-15342-1-git-send-email-john.stultz@linaro.org> References: <1484614372-15342-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 Tested-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 7b2b5af..405e460 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); } @@ -846,6 +846,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; }