From patchwork Tue Jan 3 19:41:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9495519 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 E2707606A9 for ; Tue, 3 Jan 2017 19:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D107027B2F for ; Tue, 3 Jan 2017 19:45:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C580627C05; Tue, 3 Jan 2017 19:45:18 +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 3C7E427B2F for ; Tue, 3 Jan 2017 19:45:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 719246E134; Tue, 3 Jan 2017 19:45:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1AF4D6E13E for ; Tue, 3 Jan 2017 19:41:54 +0000 (UTC) Received: by mail-pf0-x232.google.com with SMTP id d2so78291880pfd.0 for ; Tue, 03 Jan 2017 11:41: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=HdOqgm/Luctt5M3Ye2TOJ0qYhdFL1maPj5o0uZFAeoU=; b=KJHNJQFvEQl3qmGwU19Kph2uohp9H6ZZXu4NddMX0I2p2dX8fmZ5+fqfplALD6+9Bd 8lpLSaEtPPavJEgFIURZjvC5xWwK8/usxuqVFBDpA5FTUeIEMdxgJc2d12RrM/3LwlFA PJPkugxmUo15Sq5nxok8+KY5wXfVRbaPqOqb4= 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=HdOqgm/Luctt5M3Ye2TOJ0qYhdFL1maPj5o0uZFAeoU=; b=XvCrHorK0sphieq6Ca7JI0rNve3hz3KFHM0uEcwNQs09c1mfhUpkba7htAwzLfAOBp EklwVZdkctkIL6UA8z2nEwUX5m8+0/G+Q9tDprYPP/AUxGNcrdVTFfqZU2aHIMdfkcio CrSWBTldIdD4X5fb1RDGzc7ZLVccOOXwSjbHQzO9Duhe3mGh5wmj21mytFUue8Tt5QeH 45fLaSq6d4UV134sImssDMx4eUQai1Pj9OY+RkxexCejhFDlUVDFBBfniE79C0fdbzwp iZsb8AXm7Iep5FQAlG3FI6O1DoqKmNhPnRk7E1EMJuyFSIiTi0lLy3pj6TXH8FJHkAMx lt+A== X-Gm-Message-State: AIkVDXKt5zeoQ5nySsN3ZXBpJ0QSmPsFWtvDP0yx5K4UJ+eZdVWr4BWQWsecXjVuvJvCfuN7 X-Received: by 10.98.202.72 with SMTP id n69mr59966051pfg.24.1483472513181; Tue, 03 Jan 2017 11:41:53 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id y62sm77865957pfk.52.2017.01.03.11.41.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jan 2017 11:41:52 -0800 (PST) From: John Stultz To: lkml Subject: [PATCH 3/5 v3] drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve monitor detection Date: Tue, 3 Jan 2017 11:41:40 -0800 Message-Id: <1483472502-16403-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483472502-16403-1-git-send-email-john.stultz@linaro.org> References: <1483472502-16403-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; }