From patchwork Mon Dec 12 21:00:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9471363 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 09ADF60573 for ; Mon, 12 Dec 2016 21:01:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2F93284CA for ; Mon, 12 Dec 2016 21:01:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E80612851D; Mon, 12 Dec 2016 21:01:08 +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 A0ACB284CA for ; Mon, 12 Dec 2016 21:01:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1BF16E412; Mon, 12 Dec 2016 21:01:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e:c05::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id D76156E35D for ; Mon, 12 Dec 2016 21:00:48 +0000 (UTC) Received: by mail-pg0-x232.google.com with SMTP id p66so39082637pga.2 for ; Mon, 12 Dec 2016 13:00:48 -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=HdOqgm/Luctt5M3Ye2TOJ0qYhdFL1maPj5o0uZFAeoU=; b=EQlFEbUdsUSpEGAeoJVynXqkyPqBsExhRy9+yhHONnF8TOvAxZipJt5tsx3C6ReuB1 xo7eTGLdrtInAhQWOha+tfFzbdqsd2qRRJBZ9eJJDzq62XWJRNzcJ+6F9g6JMjppVXgO 5TnahFtVY6JQR41BbCzo43u8Klhzv0T/vGixU= 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=HdOqgm/Luctt5M3Ye2TOJ0qYhdFL1maPj5o0uZFAeoU=; b=gh6OfjWAR+Vm2Y9aDuZjvnkxxD4a8PxTV/Wr75vLebN3Qvkze/29PLUUDZ6S80SCYc TcEBlIOX8/Kt7LyV8xe8FU5bjnnzyr0kl4xPX19QN/lD7CcYoThmEarg/ITXgapnqC2E AltYPr7g6NDHACwdY0dTe4gHxdFJCdlbHEi/MGUgXp1TP7jkno4KDknXYTUkOPFla0+3 qgbYTe7rpJgUqX33gVWj8KR7jsjVbp6Ec3Xz2Pj30HZH65zWir8fH0rGBzbQEOWR9Qh7 60GROv1jkGclJc8q+BCjr/R9ueHb7IbF5PZMZ0pVXcnlhKvYavPzLJG0ROSsIE6xilTH eKHQ== X-Gm-Message-State: AKaTC02ZNhXb9sEMCOMNL0k5Ud8JFLdYBsjY6E7kATAcnHTDVPIP0DcOiZoXHGNyZ97SGUFY X-Received: by 10.84.197.1 with SMTP id m1mr16396469pld.157.1481576448174; Mon, 12 Dec 2016 13:00:48 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id f3sm41074078pga.45.2016.12.12.13.00.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Dec 2016 13:00:47 -0800 (PST) From: John Stultz To: lkml Subject: [RFC][PATCH 3/5 v3] drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve monitor detection Date: Mon, 12 Dec 2016 13:00:39 -0800 Message-Id: <1481576441-23529-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481576441-23529-1-git-send-email-john.stultz@linaro.org> References: <1481576441-23529-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 d93d66f..4b90975 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; }