From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C854C433FE for ; Mon, 25 Oct 2021 15:29:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73F9060FDC for ; Mon, 25 Oct 2021 15:29:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233874AbhJYPbh (ORCPT ); Mon, 25 Oct 2021 11:31:37 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:39421 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233766AbhJYPbe (ORCPT ); Mon, 25 Oct 2021 11:31:34 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id B44C55806D4; Mon, 25 Oct 2021 11:29:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 25 Oct 2021 11:29:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=apYCseIKPEa7T yvpW6vrDcktfnDBwxegPWvT7BJ6R7o=; b=D+xlObxnqtG5KmvRn6mhjlRZmND2x 3yGVLDfxIsENjOLqkFjNvGt2/CiPPmyIo7g13uE9EwikIFMu6uMPv164wypXGVN+ Q/2LehDwKQeV9U83WMoQr43AMja1nr2RUNAxTaOgXwfj9mlSOAONboy5KuiA8a7k N3RxW0WiQV3BwYrBPNeJOwn6RVuLDKmgLQGBlwqCVRWeCEd3VGHbVr55KkRI5w5G Le643Exdj9+dmbsnOXR0DsTamlBtRheksGe9+vtOsIruIOmMH5GJ78MtJ/VVwqfD WUXagBHyYQDeXVxTaI4huHnT7mVjGx/nEu6oNWxeauKVSAT84f6/TDEcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=apYCseIKPEa7TyvpW6vrDcktfnDBwxegPWvT7BJ6R7o=; b=b6U++hPB FyMJhcR6QvSKJssGDL8QB2EGjQOcS4Bo5fO1VDMyvBClBu2LMFdbc0QtqhmzTOGJ mPCaNhySjKkaE4DG8b+Wf5kkxyWLXtq78PjcDiZb54V7HsPjXFZbAMZGea1YIEL9 l8vQgbDSycx5nNggH9bRUNDBZenpTiz9a0OZjiLrLi93Qhs2K4DJir8npd7TneBm +vSb0ECGQzBbvAE0UQJTQ284FtFDgpY6/T77MmWjPwCf3Y/qG+oVIIDKJFnJ2A5c +hVrgZNRptYKXPVqEuLcRFkduEVkvsR7P3yn4hrUg6HzFbsy4YiDfSbmW2+qmKwS iGmr8K9coD5BRw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 11:29:10 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Cc: linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Ripard , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, Emma Anholt , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley Subject: [PATCH v8 02/10] drm/vc4: hdmi: Fix HPD GPIO detection Date: Mon, 25 Oct 2021 17:28:55 +0200 Message-Id: <20211025152903.1088803-3-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211025152903.1088803-1-maxime@cerno.tech> References: <20211025152903.1088803-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prior to commit 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod"), in the detect hook, if we had an HPD GPIO we would only rely on it and return whatever state it was in. However, that commit changed that by mistake to only consider the case where we have a GPIO and it returns a logical high, and would fall back to the other methods otherwise. Since we can read the EDIDs when the HPD signal is low on some displays, we changed the detection status from disconnected to connected, and we would ignore an HPD pulse. Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 338968275724..dde67b991ae7 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -190,9 +190,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); - if (vc4_hdmi->hpd_gpio && - gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { - connected = true; + if (vc4_hdmi->hpd_gpio) { + if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) + connected = true; } else { unsigned long flags; u32 hotplug; -- 2.31.1