From patchwork Tue Mar 5 00:48:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 13581386 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 862D0C54E49 for ; Tue, 5 Mar 2024 00:49:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 645941127AC; Tue, 5 Mar 2024 00:49:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Bp5izz3t"; dkim-atps=neutral Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 03E411127AC for ; Tue, 5 Mar 2024 00:49:10 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7c76a566218so269115339f.2 for ; Mon, 04 Mar 2024 16:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709599749; x=1710204549; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rbMkt4JH9fQU1k/SM3hjf0aOsa5Ez6LXN7/VqqW0kvc=; b=Bp5izz3tlLatK+bhdSuLX8bp2Df4a7kc95eAFsGa4oKeCzOjq2LidS5C6KRLRyZu4h /vgsuyETPu50QyWafEWzpYTBdJQWWf4DUz5GOgQpuJ2N/yF9QDA2LD5tuRQHHU4Ukv4A MB6IrE1sG6fD7+8aFSqlYN1u2X4SgXZKeO9Z9pWIHSF0GdwqJuPkc7UISN/2lvnZDjej 7eQ0Om6AZnzgevwvt8jffXV6jPULvbXCul7EAANx3H1BDYRFMazvwdFK5Rr8zHAyTraq khNp6tBKMbcNbVmo3cAde+5rtADfWbA4gYgP5Lf6SpT+hYxBClB6t6/XY8HSf3+aVfHu Ocvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709599749; x=1710204549; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rbMkt4JH9fQU1k/SM3hjf0aOsa5Ez6LXN7/VqqW0kvc=; b=STOeMwNB6yDEGC+AUTMmiuQ1FkxUCw/ktS+wXhUQqFtdHWAYEaJPsxwHzgjDa4Ft0D frgVhMjbtKK5SC7Lalxs6OkAXd2wHHSZJAzHESTweo1fXozmp//pYfftY37abPVukG2c aD2HjqYu/tjbJ8EVU0mFeWtv5A5PMkeawDpfGanydxnNZTp4cyFIB5uMIbMNTWa2Za7v 4i34k5n5L9pNh5ow980uhgezjVV7kGvGrhDtrniKgfv2cpTBzMkIiF5F520mZZ7dm3q1 2OMGtPWgZQ1NOJGkKfG9+7zHRQVA4U20lZUUHGHM3TvGQ+THVxI3UdlrtqfCjIFzcDfo oCeg== X-Gm-Message-State: AOJu0Yxq7ZavTtxtjIMVZRv37GOe86LKf1AGUI3NmaNpYsM1MXEp9FMo 6Gu6DKQOZiS44QDrDzruqdTRIb55ZRY77gkLtyydjynRsIu7sYQoe6cKQz0za4NsLA== X-Google-Smtp-Source: AGHT+IEw6edKSWyLjziH3r6j5+b+3S3cO5883mFBAzNRhvz6MbZxITGLrOquyH+Wdhvdz/oFR1TNWg== X-Received: by 2002:a6b:d802:0:b0:7c8:55d8:7f12 with SMTP id y2-20020a6bd802000000b007c855d87f12mr4434882iob.10.1709599749414; Mon, 04 Mar 2024 16:49:09 -0800 (PST) Received: from aford-System-Version.lan ([2601:447:d002:5be:8c4f:ad40:e7e2:538]) by smtp.gmail.com with ESMTPSA id i20-20020a02cc54000000b00474d40f8381sm1931209jaq.122.2024.03.04.16.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 16:49:08 -0800 (PST) From: Adam Ford To: dri-devel@lists.freedesktop.org Cc: aford@beaconembedded.com, laurent.pinchart@ideasonboard.com, Adam Ford , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/2] drm/bridge: adv7511: Allow IRQ to share GPIO pins Date: Mon, 4 Mar 2024 18:48:57 -0600 Message-ID: <20240305004859.201085-1-aford173@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The IRQ registration currently assumes that the GPIO is dedicated to it, but that may not necessarily be the case. If the board has another device sharing the GPIO, it won't be registered and the hot-plug detect fails to function. Currently, the handler reads two registers and blindly assumes one of them caused the interrupt and returns IRQ_HANDLED unless there is an error. In order to properly do this, the IRQ handler needs to check if it needs to handle the IRQ and return IRQ_NONE if there is nothing to handle. With the check added and the return code properly indicating whether or not it there was an IRQ, the IRQF_SHARED can be set to share a GPIO IRQ. Signed-off-by: Adam Ford Reviewed-by: Laurent Pinchart Reviewed-by: Dmitry Baryshkov --- V2: Add check to see if there is IRQ data to handle diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index b5518ff97165..f3b4616a8fb6 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -477,6 +477,11 @@ static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd) if (ret < 0) return ret; + /* If there is no IRQ to handle, exit indicating no IRQ data */ + if (!(irq0 & (ADV7511_INT0_HPD | ADV7511_INT0_EDID_READY)) && + !(irq1 & ADV7511_INT1_DDC_ERROR)) + return -ENODATA; + regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0); regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1); @@ -1318,7 +1323,8 @@ static int adv7511_probe(struct i2c_client *i2c) ret = devm_request_threaded_irq(dev, i2c->irq, NULL, adv7511_irq_handler, - IRQF_ONESHOT, dev_name(dev), + IRQF_ONESHOT | IRQF_SHARED, + dev_name(dev), adv7511); if (ret) goto err_unregister_audio; From patchwork Tue Mar 5 00:48:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 13581387 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9099FC48BF6 for ; Tue, 5 Mar 2024 00:49:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D146A1127AD; Tue, 5 Mar 2024 00:49:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cbib4TY6"; dkim-atps=neutral Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) by gabe.freedesktop.org (Postfix) with ESMTPS id E98A01127AD for ; Tue, 5 Mar 2024 00:49:12 +0000 (UTC) Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-36576b35951so651885ab.3 for ; Mon, 04 Mar 2024 16:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709599751; x=1710204551; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y+BHVxrlI9al90zgfzMAMYGXo6UILvOU2ILHGRC0OBw=; b=Cbib4TY67u+m2ax7mFbQXuEoOwFPOX/GYZfovLm1OEXEWBTmESDaZopD1hfIsVXNTK jF0sHh+JlLJ1ZIWElzlMnUiQNLJV7TeQSsCM/b6mKVwBo+Pguy8r+yswJya3sjxAXfhA DZg/BAA5X4sI6HdDbBgZlE/JP30eAoA99Bceol1/tuMak9utp9JtKkJuBef8wEr/qgta HMOZ2NiRRPeW+0OGa3pLvB8uTWmPhCbAagUT+uRdmfVMi9MPTCiys/nEx0FDwpuFpAFA QBIwJu5PX5AWFtFVPZFEN8pXAA8k5xLiEbu1amPNOM6oKIwDLKw8DHnq557iiSZRA0pF ncNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709599751; x=1710204551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y+BHVxrlI9al90zgfzMAMYGXo6UILvOU2ILHGRC0OBw=; b=d4rVsIIvRbezNoYSU7Hqmfxi7IFuMSTyf/eML0CeUNp4bHHxhvLmGKMVvVLj7YveZB AfIfh9Ulg/BfE5a3GLmrol9Z2CSrJZVt4Q+APuTkvCK5liaq7VizCB86Ee5gBMFSDvnf E5uhADF9On6O0CaQw/MN+HLWJ7ExjukJ5/QssRxThGOc8jjgrb0+94DUmlhAnyPiYuSz fw7L4fiXJJmH94BBRL//oob0xNeq39RdCPC40k+yqQzITYbG7/BNlb84e9siM/IlXg2s 0bZK71QAAABWI46QfEXAQK8oHTfwjOHnaeqAOyTR60kxV8wGsK7VYikKgXbhtGYGLhlk nFJw== X-Gm-Message-State: AOJu0Yxsx/yOXsPLL51Y2UoLoTGbU9NRmN1oZ9Afbg+BRUQMussnFp8s kUDtzmAwJARibODnJRTz65K8YZtp2EpobNnttKtRaD8pbTz80J5oOdlMHGGVa1oFkg== X-Google-Smtp-Source: AGHT+IFcwi9gaoZxVBmlUA/f4yh+4E16WuLN4gryhMWjZuOM6lWeIU9uwmOYkkJrmY/3PWsDYKmleQ== X-Received: by 2002:a05:6e02:1c24:b0:365:1555:9fe1 with SMTP id m4-20020a056e021c2400b0036515559fe1mr15026004ilh.1.1709599751378; Mon, 04 Mar 2024 16:49:11 -0800 (PST) Received: from aford-System-Version.lan ([2601:447:d002:5be:8c4f:ad40:e7e2:538]) by smtp.gmail.com with ESMTPSA id i20-20020a02cc54000000b00474d40f8381sm1931209jaq.122.2024.03.04.16.49.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 16:49:10 -0800 (PST) From: Adam Ford To: dri-devel@lists.freedesktop.org Cc: aford@beaconembedded.com, laurent.pinchart@ideasonboard.com, Adam Ford , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] arm64: dts: imx8mp-beacon-kit: Enable HDMI bridge HPD Date: Mon, 4 Mar 2024 18:48:58 -0600 Message-ID: <20240305004859.201085-2-aford173@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240305004859.201085-1-aford173@gmail.com> References: <20240305004859.201085-1-aford173@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The DSI to HDMI bridge supports hot-plut-detect, but the driver didn't previously support a shared IRQ GPIO. With the driver updated, the interrupt can be added to the bridge. Signed-off-by: Adam Ford Reviewed-by: Laurent Pinchart --- V2: No Change diff --git a/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts b/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts index a08057410bde..fba8fd04398d 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts @@ -304,6 +304,8 @@ adv_bridge: hdmi@3d { compatible = "adi,adv7535"; reg = <0x3d>, <0x3c>, <0x3e>, <0x3f>; reg-names = "main", "cec", "edid", "packet"; + interrupt-parent = <&gpio4>; + interrupts = <27 IRQ_TYPE_EDGE_FALLING>; adi,dsi-lanes = <4>; #sound-dai-cells = <0>;