From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1E7947CA73; Thu, 24 Sep 2026 12:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251568; cv=pass; b=gO0RkFQxbBN4FuSKevZU40GpnA3AFW1XOL4W3WBzbaor/36VolHU33/cZBSDsa3eXduN5DJIiTu56om7evGYgYNAKqtiLuSc4x4tte008NEgOwOhgjGGX8lIwhXk/Nxqn/qPGkZRS43XcP3WshfK92FFizymrSIBioi8Du+9BVc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251568; c=relaxed/simple; bh=/C7CtqaNr5SoHMXI/KMNxIoLwTQ7gGl2eC5ncNA+6cE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OfGJhyJGGbMVjlEZKnD1XntB8VqJ9PafmPCs7zgp1uLnB4wZVgLxopyRPjOqIYYC4uEP4VorUREP/8jgTy7XsmfF4CQbK8fXRY9WWGB06/Ix+Q3RsEZH1Gw1/gveYAG+NjCQfRnrcSgs5uYho3TeayF1KvkzDK7UN+T8av0xECE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=MsHD9ARS; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="MsHD9ARS" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id E7179200B66; Thu, 24 Sep 2026 14:05:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gzqi4eMOsIxYxypilO5M4GqTbX/Tk4lvEkSYHODftBU=; b=MsHD9ARSpos07Ec1zdf7rkPXSu/PlAK4oDQJSoF/aBBQ+AB8tzbOSVUg+DoDjauJP8Pfbw GAoF20KyV3SbOgCJ0QEuE6P8AA1IbvLQkd+J8Uo5fZLr2AcO3ZdI0hlfG2FcUinz0SzHlc pTqKoxA2jy8AFxEbuEy2p/Z6gvJkqSz6fYgpN2z0IYdHnlPYe1SAX7Ly4BtnrqtIBjASLM gBc9FNMdXAy9JaVyiECV3FFUebTnM9Uiq3zWFwfyJr58/ymECGm4gnlAaZn8qMnbiLbw0k pXO/iMvp4YbEGM2yQp/NPFVVLbR1lNTg5lWyJG3bukfuYJ/3vNbtkb/9WLsP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gzqi4eMOsIxYxypilO5M4GqTbX/Tk4lvEkSYHODftBU=; b=GKhLATccSMMEvIzBE0Szk7OHfSO4fay8DtcDSe0x7SfZdLg4c05+UoCjqxyrArKAHomqpb iopMksTFytDQAWFljqt4CDG74GyhuIYOfcN1o7pFxboG/rtnV+y1e8KPNq1s0ZrZQ4g0u0 HQJVF4bPXPp2Dc7pRbQky+pqT9Gu8ILUCVXTk2LhHDw1xUXlwOSvIoyORGjz8RifyLURHL UT4lz/ejK+vPnChv2DPt9UT4wShxPhbU+dIxZcfQwsgAUkzIccRabA7e6oCA42R7nBc7ru KzVk0zTeojQwt8w4aPa1yFCZ8hScuvIRDkXCzF96gHB64NTABNU2BoM+QosbwA== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251557; a=rsa-sha256; cv=none; b=E1nbUcOkcAJ1Lhyv+TOw46eVqu33AEIlDRspFQUFKbLTRyKvKHJt4G+Bp9Gf8djFiwS4Hu wRgsmMb+ksRX+U5YjaIQWnNM1XrRiX/hfK1txpl6JYcD4c8WR0Q6/EGpsKZLDGJBKLi1lx iYZuifT9K9/luxa7rbkTjJJa/Fxj7lBEjzn0qOB555hAzB6+pR30TrqSxyg+1pw0nyzsSS IPikajcrvIL7/21wQYG3qnDhvzxKZGwXKFHwtsCdYYbsV/KLNDuPFnxE4og91c6EYa2eLv 4AG+PWQ22xpEXerWw6LfTTrqqPg/WF6uvaZ3ehM1Ti+OUFWlSP65/FKaZ0ji3A== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:05:55 +0200 Subject: [PATCH v2 1/9] media: synopsys: hdmirx: add media device infrastructure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-1-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=2335; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=NuNNgUFsC9RW7kHtNJHPpvTxgDs+TKGIHfD/QjqPBAI=; b=h+3MY+jpLjJXmh980n/HklrmVqu7S7CL6SJRgLUWmoO8TeZ6kmtl48zqlhRXzLeP4DDqACUNF xOOWEJSgtVOA8OO51syF29rlzPkvRvukaRqJF+u2YspkhQGsQr8cIBT X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= From: Gerald Loacker Initialize the media device to enable integration with HDMI bridge devices in the video capture pipeline. This provides the foundation for representing the hardware topology through the media controller framework. Signed-off-by: Gerald Loacker Signed-off-by: Sascha Hauer --- drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index 25f8ca0d6d946..f51a1619b71ec 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -31,6 +31,7 @@ #include =20 #include +#include #include #include #include @@ -123,6 +124,7 @@ struct snps_hdmirx_dev { struct device *dev; struct hdmirx_stream stream; struct v4l2_device v4l2_dev; + struct media_device mdev; struct v4l2_ctrl_handler hdl; struct v4l2_ctrl *detect_tx_5v_ctrl; struct v4l2_ctrl *rgb_range; @@ -2742,6 +2744,11 @@ static int hdmirx_probe(struct platform_device *pdev) goto err_hdl; } =20 + hdmirx_dev->mdev.dev =3D dev; + strscpy(hdmirx_dev->mdev.model, "snps-hdmirx", sizeof(hdmirx_dev->mdev.mo= del)); + media_device_init(&hdmirx_dev->mdev); + hdmirx_dev->v4l2_dev.mdev =3D &hdmirx_dev->mdev; + stream =3D &hdmirx_dev->stream; stream->hdmirx_dev =3D hdmirx_dev; ret =3D hdmirx_register_stream_vdev(stream); @@ -2771,6 +2778,7 @@ static int hdmirx_probe(struct platform_device *pdev) vb2_video_unregister_device(&hdmirx_dev->stream.vdev); err_unreg_v4l2_dev: v4l2_device_unregister(&hdmirx_dev->v4l2_dev); + media_device_cleanup(&hdmirx_dev->mdev); err_hdl: v4l2_ctrl_handler_free(&hdmirx_dev->hdl); err_pm: @@ -2794,6 +2802,7 @@ static void hdmirx_remove(struct platform_device *pde= v) vb2_video_unregister_device(&hdmirx_dev->stream.vdev); v4l2_ctrl_handler_free(&hdmirx_dev->hdl); v4l2_device_unregister(&hdmirx_dev->v4l2_dev); + media_device_cleanup(&hdmirx_dev->mdev); =20 /* touched by hdmirx_disable()->hdmirx_plugout() */ hdmirx_dev->rgb_range =3D NULL; --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1CA847AF5C; Thu, 24 Sep 2026 12:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251568; cv=pass; b=CxfSF6/vIKPswEAL4OlMuMurG/w1Yuzyx5x1c9ICZb//3zzpXZXX6C/UTOxawyAcPcqtJeX0ueCayBgCnE4+Jt6r2SENvo3DkZjoMXZwRhikHPs0vNQvzcwSr9SPQ/GzV1JqE5Xew7BRBUENYyKLci0csrDStH1NSRBVueYQouM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251568; c=relaxed/simple; bh=ycs4ObMprK4flWOLIWr10LTMNjPTG7lkKT5OYTwxHBw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OCPWkP5ST1goNCAZDx/+jbtun2RlowXiMtqa08CJj14p3Ns1Yoe+aavMFkHN6Q0PqEdNKO7w2HaeJ7k3pB3TbUUCYRXG+TcnHKSTdLCr+OPOp6keBMlX6oNxi2DikZwAZ6T+791uPRNeX5M4Vhkp4f3xuQkIe5/w8zPdLoY5vzo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=QSEq5wZZ; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="QSEq5wZZ" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 07924202108; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UBEDDu/J1MDr9WOvSIGGAqAjcW5uhUos4+n3DxvZsBo=; b=QSEq5wZZli64wsU5MJTyUrMU/tAozqb9hTjBlB4Wh7LsCI8aNVlsUiU/Q/kZkxJYmMzfcM ONibrkKt7lZmilh+desUKi8ngEBypKLDAYpgdpPO2AVU/bzMyJ/OGdyKhhhtqzT++hj1yl Tf/4tBSIgBfz6T0tuKdXu+0vr9CpvzI377yJ05Q7M/QbQo7Q98O/tNuNtbX/9CGs4myGSj ITguzgPVfnNPl4E6dP2sokLQiqTLktuhGccwWhAVeSoOYUFosnRDdNU8R/ADVG2MKuSTmz gysn7qB/9mMiRNq6KkIZWrkcU5hxc2yJUrzb4BFgqth2Z/bbyVGILhabb/Y1Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UBEDDu/J1MDr9WOvSIGGAqAjcW5uhUos4+n3DxvZsBo=; b=DN3KC+490X+GkjKCAIePfYFBgmBnTY2NVoEBjtbpfGae/GXXPAFivAPBxmd3eLGu4f9cv+ 9WZJM83MabxKx5Kk5k10LCxsj3QN9m+qomV+EuDup4lnR0l1ouyov8JnepxInhoPm8IH/l fmIl7psmccqLNErBDDERvar6rto5HOCUKypIndIkjScG6Vz6xNs+V8OjJJX3bLYnVOz4zw KWZmyRo6Kyh5tLjmxFzIOm36zeT/0GreYQ491VEdz0zvXsTdS7S4YlBFmRPCShBIgpFMxT DcrzyrcDHwdrMOJZ2DpedBOBAYcHIZwLknmtERx5qn2serqGSqY/5DqUnLurGA== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=J9BdKevW66DrAWxfh3x60RsJXWJVIp6lNEpsqSDS7XqajnUwO81fXnXb7L3l3GWItqOC8d /+YN2jo590zBbmqoZkALSC4IOBJ4dLv9a2jhMNh+DzZcpqJte3Njk9+dq7HCKXqCu9z5nl 29dPXtAhezwIab0YAX19TBmRDOwvgP7G2CkUrJus3oightzWHdaejpVdZGSB30U1zA/p5H LX+/Ve5rLndr1sqEW3bXY2NeIgPAlfwcpVi+ku8GBk1LScpkBQs0K+tgSK9LCshV1Cierq 1cWeHEVT9VYBU8gXyI0gnblnlw2U3HkTNs6z5Cj+b3dI/yRp8SPb4Qx296eE5w== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:05:56 +0200 Subject: [PATCH v2 2/9] media: synopsys: hdmirx: add media entity for video capture device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-2-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=3301; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=E5oEDquafxhjhoyW8XKX219aNRI+JsAYY0MoDfrT+1M=; b=xoMR6gm2bgiz3yI0FwRL8wkwVA++BSdSk505hNq+Fqie5U9uGtxWBe9ZPEPObsnQAJLxn6qDP iOsU14MgErCAdknReVZoBaVktEipJtKaoV5S6KqjBqtd+d4eqEz5Pgi X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= From: Gerald Loacker Register the video device as a media entity with a sink pad to integrate it into the media controller topology. This allows the capture device to be properly represented in the media graph and enables userspace to discover the device capabilities through the MC API. The sink pad indicates that this entity receives data (HDMI video stream) which is then made available through the V4L2 video capture interface. Initialize the pad before registering the video device. The previous patch gave v4l2_dev an mdev, so video_register_device() already registers the entity, and doing it the other way round would hand media_device_register_entity() an entity with no pads yet. Signed-off-by: Gerald Loacker Signed-off-by: Sascha Hauer --- .../media/platform/synopsys/hdmirx/snps_hdmirx.c | 26 ++++++++++++++++++= ++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index f51a1619b71ec..11a9b16586a57 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -125,6 +125,7 @@ struct snps_hdmirx_dev { struct hdmirx_stream stream; struct v4l2_device v4l2_dev; struct media_device mdev; + struct media_pad pad; struct v4l2_ctrl_handler hdl; struct v4l2_ctrl *detect_tx_5v_ctrl; struct v4l2_ctrl *rgb_range; @@ -2751,15 +2752,29 @@ static int hdmirx_probe(struct platform_device *pde= v) =20 stream =3D &hdmirx_dev->stream; stream->hdmirx_dev =3D hdmirx_dev; + + hdmirx_dev->pad.flags =3D MEDIA_PAD_FL_SINK; + ret =3D media_entity_pads_init(&stream->vdev.entity, 1, &hdmirx_dev->pad); + if (ret) { + dev_err_probe(dev, ret, "media entity pads initialization failed\n"); + goto err_unreg_v4l2_dev; + } + ret =3D hdmirx_register_stream_vdev(stream); if (ret < 0) { dev_err_probe(dev, ret, "video device registration failed\n"); - goto err_unreg_v4l2_dev; + goto err_cleanup_entity; + } + + ret =3D media_device_register(&hdmirx_dev->mdev); + if (ret) { + dev_err_probe(dev, ret, "media device registration failed\n"); + goto err_unreg_video_dev; } =20 ret =3D hdmirx_register_cec(hdmirx_dev, pdev); if (ret) - goto err_unreg_video_dev; + goto err_unreg_media; =20 hdmirx_load_default_edid(hdmirx_dev); =20 @@ -2774,8 +2789,12 @@ static int hdmirx_probe(struct platform_device *pdev) =20 return 0; =20 +err_unreg_media: + media_device_unregister(&hdmirx_dev->mdev); err_unreg_video_dev: vb2_video_unregister_device(&hdmirx_dev->stream.vdev); +err_cleanup_entity: + media_entity_cleanup(&hdmirx_dev->stream.vdev.entity); err_unreg_v4l2_dev: v4l2_device_unregister(&hdmirx_dev->v4l2_dev); media_device_cleanup(&hdmirx_dev->mdev); @@ -2799,7 +2818,10 @@ static void hdmirx_remove(struct platform_device *pd= ev) =20 hdmirx_disable_irq(dev); =20 + media_device_unregister(&hdmirx_dev->mdev); + vb2_video_unregister_device(&hdmirx_dev->stream.vdev); + media_entity_cleanup(&hdmirx_dev->stream.vdev.entity); v4l2_ctrl_handler_free(&hdmirx_dev->hdl); v4l2_device_unregister(&hdmirx_dev->v4l2_dev); media_device_cleanup(&hdmirx_dev->mdev); --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1B163C9ED5; Thu, 24 Sep 2026 12:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251569; cv=pass; b=B8IgU+xxUyNcuFyH/XtMW9eYVsI2XCA5gIm2kncTrSpEHdYAlaWtArpuvA2GFDf/0qL7SWYgSNQUAjDsmnAkep0EucnDzkDxFvR9K5tC8ZLehOUqI4XygO29VN/bQs18ddxAs6QR3y2O8TvcDEYG69PVhlDTgmcGKYYgZUDZkMY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251569; c=relaxed/simple; bh=jflGn9UAu1atXtnUCOpvKTObJfAaNkB9QIEiBBsQnNo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZXcIhN0t0S/ygmS+NvJWZecyW8Vjjz7Ln1z5+sempmRnikWa21qwd0zv1v14Ek07AbsRiui93mNVLQPvrJf07alfRKKmnSvcyrQwT2AHgyLvv5CfjqVifA1a9PsggjEN5MvVqkFixS5fYRhQ2/fPkGZWEoB5wyqEPoh1OQezHMI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=PVXQDCSD; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="PVXQDCSD" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 1CC5C202136; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O3UODHRra9NS+sV3IX2ewvjZ5b9Vkt7WDALjDMrncgs=; b=PVXQDCSDaY/rj7f38h1W1IyR+wwmdk08VobPyLiZlN+yKe9SklnzXXEsjBOVHfzVq3QQzr fZdIXxxp1Vwm8KgT6Nsqv/12qFbyuYT9JbN57hpwOorfSBXy6sHRQ/61LwMmmt24o3sIVe KHG5cy7D3WtzBgVuBXuVaQg84CLQa7ckGTMVshSLdJ8ZuNfuTaooS5Yo1ohaeVU9zNQD8F AGan96Qzfq41zk19CNlIahSWUYjMfOLMWs4rE4ZbChhzsZpVG42eZcJ3dkvkDFm2mpY4Sb Bbs7AmJ75ZdJXcGotH0X48gwEF4uX6AwEGl9gnbjuKT+Wob3kkr2VgSwWetv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O3UODHRra9NS+sV3IX2ewvjZ5b9Vkt7WDALjDMrncgs=; b=gwzKRBp2brirg/67YqgiHStxFkNKt3yZn7i2L7Nzz4/lRGyjPXVJ7WshRNzn3E187gkbzb f4hvvCz7LOITzefhMUe/oRIblP8RrGoCaP3G4pF0vg3EZV2uPhmfe702AmZu/8ZJvopNBH yTiTvmIn/xvdx1EKLjy2aSQHyofzEdQ7nlENAuFDlPH7Sv4+kYmq1Hy72rFoxEslQp91RD CKLnlbulBIJBm8GDfgOvlTw3nb70V0KdSgn1L2UjlQQCk1FFJbAXVAKFEUHscTuS7kRurl uzr/ssUDC4gYTD4xuEDu3H/l2g9nxUw8cGJOUja14DR614NQmkQsSN7bHGo5Xw== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=Dxlrt57ZzcH4Nn4sAyR3XNfcXx6lIF5g0NM0HgsYYSemGcKlqbQaW1XwKdN7E+nk2CvEzc Rf6v7T/mjQm29fraawKLYyqx2Kx9mvPni/IfQrR61r7WaxsEMYEQXZ5e0rDaVMSQGW51TE jpAc1fo51BVg/EtP9J1BGJhtGQE0btn7s14h3qEbc0b/Ma1bSBunK3s1NiaZGMTjVjeErj J/NrRAN7EjOW/HDr+biONuwSZzV2dFmPkvVuyjaDOIysf5lPFPXBDlHBJmzHXahsHXfNOg /kh3ETWves6jIZu5BmYHejx23fB8gySzZ1vH+vHTlTcbR3L5dwldxNUaiAdodw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:05:57 +0200 Subject: [PATCH v2 3/9] dt-bindings: media: snps,dw-hdmi-rx: add a port for a bridge in front Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-3-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=2421; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=jflGn9UAu1atXtnUCOpvKTObJfAaNkB9QIEiBBsQnNo=; b=fTFPtfGqylsNGPa/z4Izv2LBSMPs1lrYnTvXXhgVncAstcLIhI3U4RN+qMa5JDjP3cydRSgrm NC/0J8TEGivDGJX2MHbu4WxGzjf08rZ6ttopIyGYEL+6pvvAIeBieX1 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= Describe the OF graph port connecting the receiver to an HDMI bridge in front of it. The schema sets additionalProperties: false, so without this a device tree carrying the endpoint does not validate at all. hpd-gpios is the +5V line of the HDMI connector, which the source drives to announce itself. On a board whose HDMI connector belongs to such a bridge, that line goes to the bridge and there is nothing for the receiver to sense, so the property cannot be provided. The name is unfortunate: the hot plug detect line the receiver drives back at the source is a controller register, not this GPIO. Describe what it actually carries. A board has either the connector wired to the receiver or a bridge in front of it, so require exactly one of hpd-gpios and port. Assisted-by: Claude:claude-opus-5 Signed-off-by: Sascha Hauer --- .../devicetree/bindings/media/snps,dw-hdmi-rx.yaml | 21 +++++++++++++++++= ++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/media/snps,dw-hdmi-rx.yaml b= /Documentation/devicetree/bindings/media/snps,dw-hdmi-rx.yaml index b7f6c87d0e06a..896f8ffbb5bf9 100644 --- a/Documentation/devicetree/bindings/media/snps,dw-hdmi-rx.yaml +++ b/Documentation/devicetree/bindings/media/snps,dw-hdmi-rx.yaml @@ -63,9 +63,21 @@ properties: maxItems: 1 =20 hpd-gpios: - description: GPIO specifier for HPD. + description: + The +5V line of the HDMI connector, which the source drives to annou= nce + itself. Despite the name this is an input to the receiver; the hot p= lug + detect line the receiver drives back at the source is handled inside= the + controller. Absent when the connector belongs to a bridge in front of + this receiver rather than to the receiver itself. maxItems: 1 =20 + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Connection to the HDMI source. Present when an HDMI bridge sits in + front of this receiver instead of the connector being wired straight + to it. + rockchip,grf: $ref: /schemas/types.yaml#/definitions/phandle description: @@ -88,7 +100,12 @@ required: - power-domains - resets - pinctrl-0 - - hpd-gpios + +oneOf: + - required: + - hpd-gpios + - required: + - port =20 additionalProperties: false =20 --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1D7C47C11A; Thu, 24 Sep 2026 12:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251570; cv=pass; b=h7PjEvFIPF4sdzbBrrgzpwwOU4RjzpMBXmA0ZVXejTyVBWZz64cKbRp/HlJxjAtGvJoTQZooBEuCSguQaEd5AeNNgmOWL4ACcEm48vvTWqlf/DIkBpeMQgzxUmhC0tJGIAHQ4zU20iW/JHiWUsSg+SzdGM6pSqJXwLr0jfY95Aw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251570; c=relaxed/simple; bh=rNaTX5uzB2WDWXh7Qihfo8Z60lZzKBsBUGHdsxOwWFw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kBHCo5Wa5c6d2Nhl/IPRq3Fro6L0ba4PAo5jc3H+Gh9cP0LRuBuGEQH4Va2fPXigjzwKhuBXLTUxr2COtZZRotWdzlcDTPtYKt9sOkaiXWcRuq8uWcHQ2MD7MEnFLxKNolJE7IdTuXpfcyuHF7+iRsCTM4OwvJcLpN1i2bat0Uo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=Uk+i9/6L; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="Uk+i9/6L" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 3384F202139; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TllIFOhlTRpCqGgL8bvy1p78Mt4YEowE9+9V36w22Ag=; b=Uk+i9/6LgOLl/USfeAKxUaO9j65pLLVyYpDEW3sfcQxg/v6JD9fNmYZg+Dfep6a8AP2U2w QjX3k/YCb4W4o42XDVgL6bapvRg1xx0/oXxFPMTSl+SezNA726rOZZ4sANbBrqQpy8NUaF d71GNFA4K2NhymgYOmu+TyXxDdmisrZiBBZZCyOJbJbQfoTwxe4qpbY8qPlu0qgr31cp/B D0AstJ4CoeOX3yspho48j+64BdcMZWS2VUJ039tc9HjtC5PLKh+PrQ/NdDvEDrHfF8G0Rf MN07hwMbe1fvkSpR2UEuEKQa9S7jSrMRAHJq5W1+Z/VMpHjQ5oK3PWlUolABbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TllIFOhlTRpCqGgL8bvy1p78Mt4YEowE9+9V36w22Ag=; b=a87NmgQcq1+vc+/ZXr4/ZbzKlM2PumEXF/Or/Mo4/8dZ2wcM7JtJjf7/scFbt44YMiI5Uw PTmS+TbmgJ5DrXIzJdbys3X9F2BEkwJTD8fgwvj7rq3CNjdGwQ5dfqfRTaGsYBtXFEknxc Nc2erRGbcmElZkxirdwQsZs2zFUbJ6pYtMy1dJBFAonXvKmxCUvMcHeBylLp1fvNDw9rkA vq82arzvm2lRRr3/rgxDVztLEPFio3mf2LgmOcj3FWwejgPOWJC7Jloy697JYnnMuW+Zh2 WoIl2kcUz2tAqmr17EwI2/yax+RiNoy75e9yF6/uvb4/4LcwfDtUN+8wunc8vw== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=W8lVOy4N4UU9NdawwNzxy0555dq6CP0KI+x3Y1qP5s89yoIGUmX3vmqHSX2+493lkN5hvi +RTM9YNAQfU/6+ujeZ+Gqk9qkVvUWjJi1z0yeh2n8Aaugrqm0ZibZgNxNyCjUUPhgpFyqO n9pQKHBnCvsvdiBlJswJeFfaaxx2OYJLBbCLgLy+IVdWWfrDiw8zkme8Kuh8LoSzwBB/U2 Z28XFNf9xbd6E4mxxhd4qGgbATCyU3PqTLTAEjXW6qWEDBmEHS3bIWVVI9ZfmLuhv2oInY 88/UrdwCncsD7K7nh/1Il6ubz4T+bFsWaZ5LvVXtYebKWFkJoOaNRnK2D2u5JQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:05:58 +0200 Subject: [PATCH v2 4/9] media: synopsys: hdmirx: add async subdevice support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-4-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=7607; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=I5rDqCsdIlWcC/BzfHxOFLjRGQS/2NPRXQhUfqv/HLk=; b=iHWBkiuZfMK7eyfTMVZKWR8/681G4Hfg2CqMbNucEaNNcvvFIP8sr5Lzc2RXgfI+h1XkZobPf 1skpcVP5hdNBAvmQ7b+wRBHVYglAk50W08W40wtWDHliDvwYPqQAz57 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= From: Gerald Loacker Add V4L2 async notifier support to enable dynamic binding of connected subdevices in the video pipeline. The driver parses device-tree endpoints to discover and register video bridge subdevices. When a subdevice is bound, a media link is created between its output pad and the HDMI RX sink pad. Subdevice nodes are registered once binding completes, making them accessible from userspace. If no endpoint is defined in the device tree, the driver operates in standalone mode and registers its subdevice nodes directly, maintaining backward compatibility with simpler configurations. The notifier itself is unregistered on the way out whether or not a subdevice ever bound. Only v4l2_async_nf_unregister() takes the notifier off the global list, so cleaning up without it would leave an entry pointing into memory devres is about to free. Both calls are no-ops when there was no endpoint to watch. Ask the bound subdevice which of its pads faces us rather than assuming the second one. media_create_pad_link() warns and fails on an index the entity does not have, which a bridge with a single pad would hit. V4L2_ASYNC has to be selected now that the driver calls the notifier helpers. v4l2-async.h has no stubs for them, and nothing else the driver already selects pulls the symbol in. The media device is already registered when the subdevice binds, so userspace can be walking the graph under graph_mutex while the link is added. media_create_pad_link() does not take the lock itself; take it around the call. Signed-off-by: Gerald Loacker Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Sascha Hauer --- drivers/media/platform/synopsys/hdmirx/Kconfig | 1 + .../media/platform/synopsys/hdmirx/snps_hdmirx.c | 92 ++++++++++++++++++= +++- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/synopsys/hdmirx/Kconfig b/drivers/media= /platform/synopsys/hdmirx/Kconfig index 4321f985f6320..598c303eba8d0 100644 --- a/drivers/media/platform/synopsys/hdmirx/Kconfig +++ b/drivers/media/platform/synopsys/hdmirx/Kconfig @@ -5,6 +5,7 @@ config VIDEO_SYNOPSYS_HDMIRX depends on ARCH_ROCKCHIP || COMPILE_TEST depends on VIDEO_DEV select MEDIA_CONTROLLER + select V4L2_ASYNC select VIDEO_V4L2_SUBDEV_API select VIDEOBUF2_DMA_CONTIG select CEC_CORE diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index 11a9b16586a57..d80143347fe0c 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -32,12 +33,14 @@ =20 #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -126,6 +129,7 @@ struct snps_hdmirx_dev { struct v4l2_device v4l2_dev; struct media_device mdev; struct media_pad pad; + struct v4l2_async_notifier notifier; struct v4l2_ctrl_handler hdl; struct v4l2_ctrl *detect_tx_5v_ctrl; struct v4l2_ctrl *rgb_range; @@ -2649,6 +2653,50 @@ static int hdmirx_register_cec(struct snps_hdmirx_de= v *hdmirx_dev, return 0; } =20 +static int hdmirx_fwnode_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *subdev, + struct v4l2_async_connection *asc) +{ + struct snps_hdmirx_dev *hdmirx_dev =3D + container_of(notifier, struct snps_hdmirx_dev, notifier); + int source_pad; + int ret; + + source_pad =3D media_entity_get_fwnode_pad(&subdev->entity, + asc->match.fwnode, + MEDIA_PAD_FL_SOURCE); + if (source_pad < 0) { + dev_err(hdmirx_dev->dev, "%s has no source pad for %pfw: %d\n", + subdev->name, asc->match.fwnode, source_pad); + return source_pad; + } + + mutex_lock(&hdmirx_dev->mdev.graph_mutex); + ret =3D media_create_pad_link(&subdev->entity, source_pad, + &hdmirx_dev->stream.vdev.entity, 0, + MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE); + mutex_unlock(&hdmirx_dev->mdev.graph_mutex); + if (ret) { + dev_err(hdmirx_dev->dev, "Failed to create media link: %d\n", ret); + return ret; + } + + return 0; +} + +static int hdmirx_fwnode_complete(struct v4l2_async_notifier *notifier) +{ + struct snps_hdmirx_dev *hdmirx_dev =3D + container_of(notifier, struct snps_hdmirx_dev, notifier); + + return v4l2_device_register_subdev_nodes(&hdmirx_dev->v4l2_dev); +} + +static const struct v4l2_async_notifier_operations hdmirx_async_ops =3D { + .bound =3D hdmirx_fwnode_bound, + .complete =3D hdmirx_fwnode_complete, +}; + static int hdmirx_probe(struct platform_device *pdev) { struct snps_hdmirx_dev *hdmirx_dev; @@ -2656,6 +2704,8 @@ static int hdmirx_probe(struct platform_device *pdev) struct v4l2_ctrl_handler *hdl; struct hdmirx_stream *stream; struct v4l2_device *v4l2_dev; + struct device_node *ep_node; + struct v4l2_async_connection *asc; int ret; =20 hdmirx_dev =3D devm_kzalloc(dev, sizeof(*hdmirx_dev), GFP_KERNEL); @@ -2772,9 +2822,38 @@ static int hdmirx_probe(struct platform_device *pdev) goto err_unreg_video_dev; } =20 + ep_node =3D of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); + if (ep_node) { + v4l2_async_nf_init(&hdmirx_dev->notifier, &hdmirx_dev->v4l2_dev); + hdmirx_dev->notifier.ops =3D &hdmirx_async_ops; + + asc =3D v4l2_async_nf_add_fwnode_remote(&hdmirx_dev->notifier, + of_fwnode_handle(ep_node), + struct v4l2_async_connection); + of_node_put(ep_node); + + if (IS_ERR(asc)) { + ret =3D PTR_ERR(asc); + dev_err_probe(dev, ret, "Failed to add remote fwnode\n"); + goto err_unreg_media; + } + + ret =3D v4l2_async_nf_register(&hdmirx_dev->notifier); + if (ret) { + dev_err_probe(dev, ret, "Failed to register async notifier\n"); + goto err_cleanup_notifier; + } + } else { + ret =3D v4l2_device_register_subdev_nodes(&hdmirx_dev->v4l2_dev); + if (ret) { + dev_err_probe(dev, ret, "Failed to register subdev nodes\n"); + goto err_unreg_media; + } + } + ret =3D hdmirx_register_cec(hdmirx_dev, pdev); if (ret) - goto err_unreg_media; + goto err_unreg_notifier; =20 hdmirx_load_default_edid(hdmirx_dev); =20 @@ -2789,6 +2868,10 @@ static int hdmirx_probe(struct platform_device *pdev) =20 return 0; =20 +err_unreg_notifier: + v4l2_async_nf_unregister(&hdmirx_dev->notifier); +err_cleanup_notifier: + v4l2_async_nf_cleanup(&hdmirx_dev->notifier); err_unreg_media: media_device_unregister(&hdmirx_dev->mdev); err_unreg_video_dev: @@ -2818,6 +2901,13 @@ static void hdmirx_remove(struct platform_device *pd= ev) =20 hdmirx_disable_irq(dev); =20 + /* + * Both are no-ops when there was no endpoint to watch: the notifier is + * zeroed and neither v4l2_dev nor waiting_list is set. + */ + v4l2_async_nf_unregister(&hdmirx_dev->notifier); + v4l2_async_nf_cleanup(&hdmirx_dev->notifier); + media_device_unregister(&hdmirx_dev->mdev); =20 vb2_video_unregister_device(&hdmirx_dev->stream.vdev); --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B44ED47F3CE; Thu, 24 Sep 2026 12:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251573; cv=pass; b=n0UXZm/8TgELz2rufdKJKEmlUCyCyPQevcb4WnD6Y2ktLHyFDb58DoaW5nC0opDLSGnAM6UPijkPE+Ljca2cvFBWBPCrtzc7bhqWtQBIK40bcSntSFSWlHfyihKjyR9G1BJA9wZeGZJoWpdErjpS+6jucbdVw6o9a7GHKd7KIZw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251573; c=relaxed/simple; bh=d8mkg5xHqBVJd/+OAcCCmrGfIWtwBQsBozU015Qzeis=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XPC/lCALeBkvh9GJBLosbujHoPd5G+dYJ8EoZSvFBbTPbIK9CduVULOTTDKsvMrmY7ygUy7sRLhPL8TDktTTm/4o/PiM9S9Ch981BbR6FI/DIPv+GLGzhxa9sn/6DViwh6bp98pY2SfCEiOGwdPOfxszgNp3ECnOpBGhNoU00yY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=KuofrP7P; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="KuofrP7P" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 493D8202146; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OEJ46ggGZWe0oK3mgVswoMNXQd3lYnmiKqKpdz18DF0=; b=KuofrP7P/LYm+qp2dHicW0mfuqSV9qtUFePorYaRn+gwTFtzvAgC2yMk5a+FxYmuE1gsEB 2ZV+knn1nDg9VMV50HPW0ItQB338ompWtzfMXljNh4SLMyqTkWcuPKou1QNJNy5keqeZc/ nUecSQdRDLpiGDpBbG7D9Csg5xYo0f9yL9enPSMXk82AUFpfuPWA1ndGgQhOeRuWhh7tFI pDIzEePl2iY/bU8sWitjdOuP2Sww9N9H/tBayCbBrFHKaTo7eT9+CWeFiP5mHcEz6vtnpk V6O0eQJ6O3R5UiqmMgBS3v8RExuA32JfIODZ7e8eKcB8vpUhFjwrcY4qlBDRkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OEJ46ggGZWe0oK3mgVswoMNXQd3lYnmiKqKpdz18DF0=; b=D3n0ivvZ3B0J90AM2uVLT2EQQWKMt4ljPzRdfhMzmGqIXevZbo1OvyU3i/XRzcwteVAx7F 3I4z7tp1aWeFyOFhzuTLSNMYnayy4Fz4h9PwZBCDSeB4s+b6jdZ6nxRwk27zX7SSDeuvCo rvZx5gsduaU6ivcoDdyCi0qlEyfXjbNVEuv6HnWW4ep6/TXpMORL7WnxVQkJxDLJDz2zSj AxfKs4jgHyvdQHLEcLmekqSmUTWMgQbBc9abdRYV6ev5LNqJe18/ACmQUe7adrPrgdZYsX 7dBYKeOUdab7l8qp9ddxzGpfSqtWQFPpM8aZuvillWwsQsLGNRoQelGZLLlHug== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=Frtvpck3tfE6bOlQx8S6kDFarE/HTC0dNZXlfGTFsc8OIdNdw7QQ22uXjGq06JUeLp1+kF b1X5CWkz/EnB43ykizN4W289bacKQ8xMOPPGlSz0H3qarpik0EgSxpyrpBr0OSjP8rfjWl JB9K95H7OHVtDbePnfqPvIFKYoyCToU0Xsz1Dud1ON1LjSQaP6J3CvydXD6LJqiMnFYuQ8 p4KetEKO/vqwuATfzg32VzUTjIpIkqaALs/0p2PHkweWlUBzD9Hgph8pMJ8ZH05lPTYQ2J d/1Ybk4ABrdiVoEgmdyA+PiJWPFD87SxbPihnvFpILNNOiufr8+IIRg1ovUsrQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:05:59 +0200 Subject: [PATCH v2 5/9] media: synopsys: hdmirx: give the signal lock wait a real timeout Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-5-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=3970; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=0hHdQ+VWpFV0ycvFYU3V1hB2DnTx7fiQV8RNjs7P0AA=; b=xjYzqQq5Dw1gWPZ7BY4AGLJSuJacJsq0DmrUIMiNV6ykipyrFE2bbnZgxCLJtIuBwPqh05aAa uO7mJxmOyGLA4I7+rkSIhBJzVOw50qdUSCw++Fnn1FUtVZbfhgkvkaQ X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= From: Gerald Loacker hdmirx_wait_signal_lock() bounded itself by a count of 300 iterations. How long that came to depended on the debounce inside tx_5v_power_present(), which the loop calls once per iteration and which sleeps about 7ms of it, so the effective timeout was around two seconds by accident rather than by design. That accident is about to go away. A later patch in this series takes the 5V state from an upstream subdev where the board has no hpd-gpios, which leaves tx_5v_power_present() a plain read of a flag costing microseconds. The same 300 iterations would then be over in a few milliseconds and the wait would give up almost immediately. Poll on a fixed 10ms interval against an explicit three second deadline. Check the deadline after the 5V test so a disconnect is still reported as -ENOLINK rather than a timeout, and report the timeout as -ETIMEDOUT; the sole caller only tests for non-zero, so neither is a change in behaviour. Assisted-by: Claude:claude-opus-5 Signed-off-by: Gerald Loacker Signed-off-by: Sascha Hauer --- .../media/platform/synopsys/hdmirx/snps_hdmirx.c | 40 +++++++++++++++---= ---- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index d80143347fe0c..9af1e71afb4e5 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -2133,13 +2133,25 @@ static irqreturn_t hdmirx_dma_irq_handler(int irq, = void *dev_id) return IRQ_HANDLED; } =20 +/* + * Wait for the HDMI signal to lock: TMDS clock detection and ratio + * configuration, then PHY and CMU lock, then DMA lock. + * + * The wait used to be bounded by a count of 300 iterations. What that came + * to in wall clock time was decided by the debounce inside + * tx_5v_power_present(), which is called once per iteration and sleeps + * about 7ms of it, so the real timeout was an accident of how 5V happens = to + * be sensed. Poll on a fixed interval against an explicit deadline instea= d. + */ static int hdmirx_wait_signal_lock(struct snps_hdmirx_dev *hdmirx_dev) { struct v4l2_device *v4l2_dev =3D &hdmirx_dev->v4l2_dev; u32 mu_status, scdc_status, dma_st10, cmu_st; - u32 i; + unsigned long timeout; + + timeout =3D jiffies + msecs_to_jiffies(3000); =20 - for (i =3D 0; i < 300; i++) { + for (;;) { mu_status =3D hdmirx_readl(hdmirx_dev, MAINUNIT_STATUS); scdc_status =3D hdmirx_readl(hdmirx_dev, SCDC_REGBANK_STATUS3); dma_st10 =3D hdmirx_readl(hdmirx_dev, DMA_STATUS10); @@ -2153,21 +2165,25 @@ static int hdmirx_wait_signal_lock(struct snps_hdmi= rx_dev *hdmirx_dev) if (!tx_5v_power_present(hdmirx_dev)) { v4l2_dbg(1, debug, v4l2_dev, "%s: HDMI pull out, return\n", __func__); - return -1; + return -ENOLINK; } =20 - hdmirx_tmds_clk_ratio_config(hdmirx_dev); - } + if (time_after(jiffies, timeout)) { + v4l2_err(v4l2_dev, + "%s: signal not lock, tmds_clk_ratio:%d\n", + __func__, hdmirx_dev->tmds_clk_ratio); + v4l2_err(v4l2_dev, + "%s: mu_st:%#x, scdc_st:%#x, dma_st10:%#x, cmu_st:%#x\n", + __func__, mu_status, scdc_status, dma_st10, + cmu_st); + return -ETIMEDOUT; + } =20 - if (i =3D=3D 300) { - v4l2_err(v4l2_dev, "%s: signal not lock, tmds_clk_ratio:%d\n", - __func__, hdmirx_dev->tmds_clk_ratio); - v4l2_err(v4l2_dev, "%s: mu_st:%#x, scdc_st:%#x, dma_st10:%#x\n", - __func__, mu_status, scdc_status, dma_st10); - return -1; + hdmirx_tmds_clk_ratio_config(hdmirx_dev); + usleep_range(10000, 11000); } =20 - v4l2_dbg(1, debug, v4l2_dev, "%s: signal lock ok, i:%d\n", __func__, i); + v4l2_dbg(1, debug, v4l2_dev, "%s: signal lock ok\n", __func__); hdmirx_writel(hdmirx_dev, GLOBAL_SWRESET_REQUEST, DATAPATH_SWRESETREQ); =20 reinit_completion(&hdmirx_dev->avi_pkt_rcv); --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B246247F3BD; Thu, 24 Sep 2026 12:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251573; cv=pass; b=gmpyEpqSgW0rHSPRAqNaPAhxpXDBe035Fr51BPN5IVYzdexHHYT+7mBfD4LD2VIDFK42yfafVtA2mjt9N//zl/Sbqj3113XjONqlcta3dUqeOwbO5qLr4fqDiF78ZqVCtQatG+/pDiG+ICXFzL/0ZaVQZ7KHO4tOpoxNDHoOhAY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251573; c=relaxed/simple; bh=5n6MC8OCutxNNqzW0IJ1YtGCXB2tAZC79xrRknihPBE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GfFgZY/arSNHzM8RomXBwajO2HNnmrNex8ceHxjuLgduJp2QblyWgtiATyFmBF0JI3DFTWLFtM8A3K+zLMXoY3guQHNeFHf1jFQ/lc9GauMfu+9eEyjXJj9LFDOcZl4AREJ44bfYCygbe+b3k0eZS+rUwJ+YvMKHoOsql1wHwmE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=C5QmBehn; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="C5QmBehn" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 5D002202148; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y2IJ1FOgva1rI7Yw1jUWrpI2Sl1miEz2GupOamZThWs=; b=C5QmBehneQ9t8miIBtfHFq9l2PyzvXq8X0tvgd9woJMS+XX685ET8SgYQwvUzuMpp3m4Vx simnHXUPEd9skUTO1u5iIiz//BZjmd7lboHoZ535FM12EawXS4uRs681HOmOUydY4qzSFS En4qoWrHX4A6g28KouSPLejytE4tGXB9MIR1JTqoDHcX/lWN+nSo/EzANh3SpW0/wdOVO7 5T8y3pTf0nK5IAZZQ12B6fpzqHunQwSaue437ScN4cTvTvpL/xjyCNg5Mm8Ha861Ac9H0p XOj649zfb/mjldy0tLLLk4huntPOQCoQWKEVKEmT9kPuZ0U60r70EmzmCftDWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y2IJ1FOgva1rI7Yw1jUWrpI2Sl1miEz2GupOamZThWs=; b=caxzu/W2a9eZ1qhCMohtH27eWO99xtEFvSjYka6daNSfdd7C5UITuIlmoCeQbXn4iX07Ha GmFLf3liqdE3hTsSKzSbiEUb7sxW1qAkc6fVpnGJnmLQu6YycTyu/giSfXoVkMSbW956ez SGkCrVWIm2i9QolCpAEAMbXMTp7DvSQDbNJByA/MuXnb5sA11KOcCiGi5lDo/keQevnHgQ AJUfbWNZlViD5+uhQBe2QSNXvEt/i7NNaygZiiCtCof2Lp1Zo0USYiiGBuhvxqZE3Tw8zx Va01/oOqhFuSeSvqmdXXe1ykrf6zbTqpdnPnw5GHSmxQhnmsD8nAq54kbDxSSQ== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=Tnr+ivCFRbr5qt3cA18bb03Z2M5hMjzq/5e6PydxC5K+f/hzVsQlbppfnFdWXI4KImC6jw eE95omQ80tr1j8ZcKQ7l9+Nivbl4GlleyCKBDKt5+BbjluAX0bg27zWLgmpBl37HQeEGJi v/KnRmbJWmEeZFRH2ZN5+39aD8OKoqUosp4Kp3CmjbknNl3eLrLKgUi5j/V6xkvGQbK3Xv OCxhqQ6g/zReWJJadlkGjSsTcHap7IDCjloO2BbkprmMWlWvTtMEFxkeNbdvK8lZaBtmQ+ 46Mn0ilCHOREmSja2wtc9Nwvpz7WHPdIv2WU/w7qXx9Cggjtnj+qRPKVvV38Kw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:06:00 +0200 Subject: [PATCH v2 6/9] media: synopsys: hdmirx: skip the 5V detect interrupt without a GPIO Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-6-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=3146; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=3NO0zESYj/3ElTwx0ZVhOFTkcHedyRyzVM26Lv3Soks=; b=a6QlpgCxbOiX8edP/2OZPqQD2MyYJK2Mt2SMSTYxkycHvc/W79qQrC+Z+dTpOFuzX8u/Wscgy hW3vy4b9IDBCZkhMArnphW2Zme9EK8DRHSlNce8AJbQ7XvLcOO2vMUV X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= From: Gerald Loacker The hpd GPIO is fetched with devm_gpiod_get_optional(), so a board that does not wire 5V detect to the receiver leaves detect_5v_gpio NULL. hdmirx_setup_irq() then calls gpiod_to_irq() on it anyway, which returns -EINVAL for a NULL descriptor, and probe fails. The GPIO is only optional as far as the fetch goes. Set the interrupt up only when the GPIO is there. det_irq then keeps the zero devm_kzalloc() gave it, so hdmirx_enable_irq() and hdmirx_disable_irq() skip it as well. Nothing else has to change for such a board to probe: 5V is then never reported as present, which is what gpiod_get_value_cansleep() on a NULL descriptor already returns. Getting the state from somewhere else is a separate matter. Assisted-by: Claude:claude-opus-5 Signed-off-by: Gerald Loacker Signed-off-by: Sascha Hauer --- .../media/platform/synopsys/hdmirx/snps_hdmirx.c | 34 ++++++++++++------= ---- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index 9af1e71afb4e5..4b94e35c912c1 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -2525,7 +2525,8 @@ static void hdmirx_disable_irq(struct device *dev) { struct snps_hdmirx_dev *hdmirx_dev =3D dev_get_drvdata(dev); =20 - disable_irq(hdmirx_dev->det_irq); + if (hdmirx_dev->det_irq > 0) + disable_irq(hdmirx_dev->det_irq); disable_irq(hdmirx_dev->dma_irq); disable_irq(hdmirx_dev->hdmi_irq); =20 @@ -2539,7 +2540,8 @@ static void hdmirx_enable_irq(struct device *dev) =20 enable_irq(hdmirx_dev->hdmi_irq); enable_irq(hdmirx_dev->dma_irq); - enable_irq(hdmirx_dev->det_irq); + if (hdmirx_dev->det_irq > 0) + enable_irq(hdmirx_dev->det_irq); =20 queue_delayed_work(system_dfl_wq, &hdmirx_dev->delayed_work_hotplug, @@ -2623,21 +2625,23 @@ static int hdmirx_setup_irq(struct snps_hdmirx_dev = *hdmirx_dev, return ret; } =20 - irq =3D gpiod_to_irq(hdmirx_dev->detect_5v_gpio); - if (irq < 0) { - dev_err_probe(dev, irq, "failed to get hdmirx-5v irq\n"); - return irq; - } + if (hdmirx_dev->detect_5v_gpio) { + irq =3D gpiod_to_irq(hdmirx_dev->detect_5v_gpio); + if (irq < 0) { + dev_err_probe(dev, irq, "failed to get hdmirx-5v irq\n"); + return irq; + } =20 - irq_set_status_flags(irq, IRQ_NOAUTOEN); + irq_set_status_flags(irq, IRQ_NOAUTOEN); =20 - hdmirx_dev->det_irq =3D irq; - ret =3D devm_request_irq(dev, irq, hdmirx_5v_det_irq_handler, - IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, - "rk_hdmirx-5v", hdmirx_dev); - if (ret) { - dev_err_probe(dev, ret, "failed to request hdmirx-5v irq\n"); - return ret; + hdmirx_dev->det_irq =3D irq; + ret =3D devm_request_irq(dev, irq, hdmirx_5v_det_irq_handler, + IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, + "rk_hdmirx-5v", hdmirx_dev); + if (ret) { + dev_err_probe(dev, ret, "failed to request hdmirx-5v irq\n"); + return ret; + } } =20 return 0; --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B350647F3C9; Thu, 24 Sep 2026 12:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251573; cv=pass; b=M5JpJo+o+CH1CayXhjnrytT+vqSpYouv/WTq+Hw2dAsFXJM5eCdH60CrShj3uBgYfu8lJ9EUGM7fyDkr+287Y4fhAZ+nQM8DCU7CDZSnIug5Jg7zRSRa3uePWh4vaOs0eQYY8pALu4w6TJHnQGPLt8Hy7mlERt4CCryz6OUg2bY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251573; c=relaxed/simple; bh=XP3zumD/L1QQpquR189fzAX3qTcEJxNHjGTIGMrIrfQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PMonX2OOySbFS3wfQaZFRKV6GHpyc/WjTXuRIbqABYLMM+X+CJzD6aqWMVlr/syVn23rD7W27l/PZhjT1hs00tSngV4F6qaCcsGFrEJEsILIlRhcYo1rVZDPjrjuA2hD0nmCTRz8vzdmMp0iu36giuSIOA4s25AsM3v7kk3PlTE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=IqTAQ5vx; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="IqTAQ5vx" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 7180F20216B; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p7PtOpKLfrElEMFnnpHNPtWOSa+HXAudL+cApfGFjcg=; b=IqTAQ5vxJ3fTb+roTTdR+vKvY1dGMFXoB+sGhNRGEbc2209YgckNjka70W6EpCXAX5GlH6 /ECiBcqzCaDbH+o1K0FSRzyIoOj+YypIlQ9HdlJOV1dhINUt8n+LPFEmjpzu0ucyiCRiEo KNTodTr9WnjjFT3922xb5eMyHmjqFWy0cDoRMlXIWfuuXk2ITO1vX+HqpKQJ4YP5rmZ1/H a6+S2nctOV/jvohqXyzfxFQp2kp0rjtYQJmdkApUrtGnKQGSNwzADDZo5M8KGb8j3I4QSv QhhnAioBF7/DyapuvU/roXwyTsggbkKT67GC1jIws+YuKm+43jOryPe0ss+Wfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p7PtOpKLfrElEMFnnpHNPtWOSa+HXAudL+cApfGFjcg=; b=BPllabdC1n/4NT+mILuN91SSk9WNQp2iPkXvrV0ipLiZlYKCjMFZb4nWrVcHt1q9jAdcy4 sFvmscIY5z7I37CDrYDWkpmlschundhNEhJdQxwQFCeapIO/gbmT7iFNOy+LdVL6SXHCas fVG3trHmMw/j0hFBeu2MPIVZjULclDS+OkUfJGX1oG1UvtF2jOWrguS2nQ/BxRQynV3E43 tIltZNlPCpF+g7CVlJZ/KFbz2xJroINUtUU05Ep/v3pDZ/xAoxiZSsLnYQfGIn4pHXsJPt tv2m+kiPsyJMML+33pn90zyxs7HhuoW58xMBSfktWjW+bPSENriMTHOseGCq1A== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=AjDdXKHL+mXlCBOy4s7m+e7xuTrFvyGxANOEPNchYroXNxuN8A6Vzs2+2iFRwKe+9gexKa yViRlrRwahyvZD45Eyf5wgIEqCSI7LBUNVoj48CsGcUZ/O3qPmaOlxBT9m34YNRW+KCDKe sNm+8ks2xEHLyylVGRGGR9gqJzde3g/yIZepJmelsty3HSYsGNS72zOFt7AgFxXQSgU1/9 AB50/oWZH4ccT/UMMJuJaLSFIEmJRrrkrHiyg/86TaQK1jJWUJAxkMadMBPZKZMlKZdUJz Iwps0IWi7JoEplJANyfBpBcmaeJWd8xfWbGKGky6TTfbldNPRUZi5eXa0Ll8kQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:06:01 +0200 Subject: [PATCH v2 7/9] media: v4l2-device: wait for notifications when unregistering a subdev Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-7-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=9082; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=XP3zumD/L1QQpquR189fzAX3qTcEJxNHjGTIGMrIrfQ=; b=DLz2CsTO6MN7LSYkoaB4fo43jDNDrlEQ/84JnMz7eKKNytkkrRZZWvwbkTs8HbNT/WrFeLAEv QBa5Yk2NcoeADDP2ZK4FTmKjFOp3y5Ec1e0MZoGRpFYDvM1jZ9JXnip X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= v4l2_subdev_notify() reads sd->v4l2_dev without synchronizing with v4l2_device_unregister_subdev(), which clears it. A subdev notifies from its own interrupt handler or work item, and when it is bound asynchronously that runs independently of the bridge driver, which can unbind it at any time. A notification racing with the unbind then either dereferences a NULL v4l2_dev, since the inline helper reloads it after its check and nearly every notify callback reloads it once more for container_of(), or calls into a bridge that has already torn down. adv7180, tc358743 and lt6911uxe send V4L2_EVENT_SOURCE_CHANGE this way to rcar-vin and rp1-cfe, both of which install a notify callback. Protect the call with SRCU. A plain RCU read side will not do because some callbacks sleep, such as cobalt's, which takes a mutex, while other notifications come from hard interrupt context, cx23885 IR and imx-media-fim among them. SRCU allows both. The callbacks read sd->v4l2_dev themselves, so clearing it and then waiting is not enough. Add sd->notify_enabled, clear that first, wait for the readers, and only then let v4l2_device_unregister_subdev() go on to clear v4l2_dev. The registration error path does the same. The grace period is only waited for when the v4l2_device has a notify callback, which few do. The callback runs under the read side while the unregistering side waits, so it must not wait for anything the unregistering thread may hold: a mutex held by the caller of v4l2_device_unregister_subdev(), the driver core's device lock, or v4l2-async's list_lock, which is held across unbinding. Only sleeping locks matter, as a spinlock cannot be held across the wait. The only existing callbacks that take one are cobalt's, which takes pci_lock around a register update, and cx23885's, which for the cx25840 IR block runs the IR work handler directly and ends up in cx25840's rx_params_lock. Neither lock is held across subdev unregistration. Lockdep models the SRCU read side and synchronize_srcu(), so a callback breaking the rule is reported. Document the rule, and bring the notify description in v4l2-subdev.rst up to date: the helper has not been a macro returning an error for a long time. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Sascha Hauer --- Documentation/driver-api/media/v4l2-subdev.rst | 8 +++-- drivers/media/v4l2-core/v4l2-device.c | 43 ++++++++++++++++++++++= ++++ include/media/v4l2-device.h | 15 +++++---- include/media/v4l2-subdev.h | 4 +++ 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation= /driver-api/media/v4l2-subdev.rst index 13aec460e802f..2e8ced276d212 100644 --- a/Documentation/driver-api/media/v4l2-subdev.rst +++ b/Documentation/driver-api/media/v4l2-subdev.rst @@ -345,9 +345,11 @@ e.g. AUDIO_CONTROLLER and specify that as the group ID= value when calling that needs it. =20 If the sub-device needs to notify its v4l2_device parent of an event, then -it can call ``v4l2_subdev_notify(sd, notification, arg)``. This macro chec= ks -whether there is a ``notify()`` callback defined and returns ``-ENODEV`` i= f not. -Otherwise the result of the ``notify()`` call is returned. +it can call ``v4l2_subdev_notify(sd, notification, arg)``. This calls the +``notify()`` callback of the v4l2_device the sub-device is registered with= , if +there is one, and does nothing otherwise. Once +``v4l2_device_unregister_subdev()`` returns, the callback is no longer run= ning +for that sub-device and will not be called for it again. =20 V4L2 sub-device userspace API ----------------------------- diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-cor= e/v4l2-device.c index 67e3073de1321..5d7b7badaf2d0 100644 --- a/drivers/media/v4l2-core/v4l2-device.c +++ b/drivers/media/v4l2-core/v4l2-device.c @@ -10,10 +10,17 @@ #include #include #include +#include #include #include #include =20 +/* + * Subdevs notify from their own context, unsynchronized with the bridge + * unregistering them. Readers hold this while calling into the bridge. + */ +DEFINE_STATIC_SRCU(v4l2_subdev_notify_srcu); + int v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev) { if (v4l2_dev =3D=3D NULL) @@ -108,6 +115,17 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_d= ev) } EXPORT_SYMBOL_GPL(v4l2_device_unregister); =20 +/* + * Stop notifications to sd->v4l2_dev and wait for those in progress. + * Callbacks read sd->v4l2_dev, so it must stay set until this returns. + */ +static void v4l2_subdev_disable_notify(struct v4l2_subdev *sd) +{ + WRITE_ONCE(sd->notify_enabled, false); + if (sd->v4l2_dev->notify) + synchronize_srcu(&v4l2_subdev_notify_srcu); +} + int __v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, struct v4l2_subdev *sd, struct module *module) { @@ -131,6 +149,8 @@ int __v4l2_device_register_subdev(struct v4l2_device *v= 4l2_dev, return -ENODEV; =20 sd->v4l2_dev =3D v4l2_dev; + /* Pairs with smp_load_acquire() in v4l2_subdev_notify() */ + smp_store_release(&sd->notify_enabled, true); /* This just returns 0 if either of the two args is NULL */ err =3D v4l2_ctrl_add_handler(v4l2_dev->ctrl_handler, sd->ctrl_handler, NULL, true); @@ -165,6 +185,7 @@ int __v4l2_device_register_subdev(struct v4l2_device *v= 4l2_dev, media_device_unregister_entity(&sd->entity); #endif error_module: + v4l2_subdev_disable_notify(sd); if (!sd->owner_v4l2_dev) module_put(sd->owner); sd->v4l2_dev =3D NULL; @@ -274,6 +295,8 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *= sd) list_del(&sd->list); spin_unlock(&v4l2_dev->lock); =20 + v4l2_subdev_disable_notify(sd); + if (sd->internal_ops && sd->internal_ops->unregistered) sd->internal_ops->unregistered(sd); sd->v4l2_dev =3D NULL; @@ -293,3 +316,23 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev = *sd) v4l2_subdev_release(sd); } EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev); + +void v4l2_subdev_notify(struct v4l2_subdev *sd, unsigned int notification, + void *arg) +{ + struct v4l2_device *v4l2_dev; + int idx; + + if (!sd) + return; + + idx =3D srcu_read_lock(&v4l2_subdev_notify_srcu); + /* Pairs with smp_store_release() in __v4l2_device_register_subdev() */ + if (smp_load_acquire(&sd->notify_enabled)) { + v4l2_dev =3D sd->v4l2_dev; + if (v4l2_dev->notify) + v4l2_dev->notify(sd, notification, arg); + } + srcu_read_unlock(&v4l2_subdev_notify_srcu, idx); +} +EXPORT_SYMBOL_GPL(v4l2_subdev_notify); diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 25f69b1b8db03..cd3883e911840 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h @@ -234,13 +234,16 @@ v4l2_device_register_ro_subdev_nodes(struct v4l2_devi= ce *v4l2_dev) * type is driver-specific. * @arg: arguments for the notification. Those are specific to each * notification type. + * + * May be called from any context, including hard interrupts; the + * &v4l2_device.notify callback has to cope with the caller's context. + * Unregistering @sd waits for callbacks already running. The callback must + * therefore not wait for anything the unregistering thread may hold, such + * as a mutex held by the caller of v4l2_device_unregister_subdev() or the + * v4l2-async notifier lock. */ -static inline void v4l2_subdev_notify(struct v4l2_subdev *sd, - unsigned int notification, void *arg) -{ - if (sd && sd->v4l2_dev && sd->v4l2_dev->notify) - sd->v4l2_dev->notify(sd, notification, arg); -} +void v4l2_subdev_notify(struct v4l2_subdev *sd, unsigned int notification, + void *arg); =20 /** * v4l2_device_supports_requests - Test if requests are supported. diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d256b7ec8f848..c1483a85d0c72 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -997,6 +997,9 @@ struct v4l2_subdev_platform_data { * @owner: The owner is the same as the driver's &struct device owner. * @owner_v4l2_dev: true if the &sd->owner matches the owner of @v4l2_dev-= >dev * owner. Initialized by v4l2_device_register_subdev(). + * @notify_enabled: v4l2_subdev_notify() reaches @v4l2_dev. Set on + * registration and cleared before @v4l2_dev is, see + * v4l2_device_unregister_subdev(). * @flags: subdev flags. Can be: * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device; * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device; @@ -1054,6 +1057,7 @@ struct v4l2_subdev { struct list_head list; struct module *owner; bool owner_v4l2_dev; + bool notify_enabled; u32 flags; struct v4l2_device *v4l2_dev; const struct v4l2_subdev_ops *ops; --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B22EA47F3BC; Thu, 24 Sep 2026 12:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251574; cv=pass; b=HuGAgpctXnOw+VGTZzZ4JQ5lqOxju8bKocWzDruR6G4Go0KyeZK1T7JG+injaLY4qbnOMMxzJCM+vnCyiHaCOU747q/LkcTW6itqmVTUbZKwHz1fNzNbnt1YvvEMc30xQO4Ae47XwSWSX0SOmApnb9tWdcUCyJ2y+6P3I3NuKtA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251574; c=relaxed/simple; bh=zlHKYXV6eg+nZRJeH3ASdrT6tot/dPOLzqS/ejv3caw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pL0HeLiHZPND2AIsvM8FXg+x6QWmeSBKxNZPEF6GUZ9jajDccn1s/A5yLtM3y2UoSo1DG++ch4qrJmt3HOusP9FLw1aFQ76oWS6hWGXAy5VT1JgFIEMImqHhWl5DIPWF94MzKhAEJ03XDMtlcBV0jhu3ioMcyfJR4c3qw1KUPoY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=Kq/Y1Pnd; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="Kq/Y1Pnd" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 870FD2021BD; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uyBGmoaLN6ssFVm9eDEEPBERfFfq/uzBQ9ZE0rd0deg=; b=Kq/Y1Pnd2XVmrYqIN5yWPR+hgZsT8+3T1rWcbhq31gKaSo3z8TimGMsBnEhPlUTm3MrtII xzROmSSc9T0mLo9rmyCP/dplxWSvzqTMaasC1w3nrZ33C12S5y9a7wDzgiDcCX0URVzKrf F/z8+8lSCig0JyDNqCGcNnfhkQ4TgjgP1EVeNEGJ+YVy7wHzgK9FsteaWBclNoFhh7Dv4O TzxRoOc0irS5ZVb2ShgGu76ebc5Auz6KIHiv1L2fwvHaln6R/J1WabQbjtY1tXZ7rTggcC WrYi3BAvFdRcwSK4ZCl0Zc49oPpLg+IechLhhFpWEGhvEnbONyfJDcYlFBgX3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uyBGmoaLN6ssFVm9eDEEPBERfFfq/uzBQ9ZE0rd0deg=; b=AQIu/ywHR9doPXm+6puyh1iZPTI9/P4eaELiZh54DZj1QsDaT4hxjEipdvBFS2TjCEdcjn Rv3/XJ9qq8Y4Y8vrjQwoer7j5/BpoT166hjTRSpJvRB+6OwPKeWXoYPSAbDJXlZeLv3YvK 1MdvJSuXRNPcgxt+nveWnxcUFP9sTjaCpPv9IdqNm26ZsSoXJJ3/bT7PVALaot186GmAXF vZKuVwrcaLW0XGMMANNljUVBKU4UbCk7Q1pkaGhKcr90oefoYO5rqDq157/O2TW5DpcAdO l6WOMFU6CVfVmvKbPMa1k/7kiRRljz4OVGwaWOptq3RlLFNGWQ+DQwdtQq+R4A== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=d2zAy4Q1JflBJ94Ga90XTphjSG83C84dxoGUu+VhOpKKxSDj7sUvhWHs/SaQjOAhO1NVa/ 821VYtkTDk2EU4yP68/UeMWNTZ/YyF4BWhiNsp84UXhxVZ/nST+EFv7CQwSYIWxEK12vDM EksxBzxnxLAbzoeFGvNFt5wK8skCcNwJlR0dvCW0+++3AqaSOofC0zkeZRz3ngzIIBNyz1 0/MugvZeFqbyJcwdWzKE3aQLLT/HwwbuT20tq5jwEvMNaJq0bdSBxT5152UdGO/NBgo0UI 6Jhea4di77vk0m3XFMfxDv6Lfcfj7Wmt5c0I8CpbHwyZJ7fI97EHVQdGacK8dw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:06:02 +0200 Subject: [PATCH v2 8/9] media: v4l2-subdev: notify the bridge when the source power changes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-8-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=1765; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=zlHKYXV6eg+nZRJeH3ASdrT6tot/dPOLzqS/ejv3caw=; b=fRV+JTnr8ujfPaAlekJpYydXYXnFWyj+m9iPagHAkXk7a4/fCQaB/C7EVjRBRcilLEucJ31zC Q4+9fopCb1LCitt1QGIL5c1HrKBvkNu65POey6ZzeOs+BHzTWZ2fZ3W X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= Whether a source is driving the connector's +5V line is published as V4L2_CID_DV_RX_POWER_PRESENT and nowhere else. adv7604, adv7842, tc358743 and tda1997x all set that control from their cable detect interrupt and stop there, so a driver that has to act on the change in hardware, rather than hand the value to userspace, has nothing to hook. The in-kernel channel already exists for the neighbouring events. A format change goes out through v4l2_subdev_notify_event() as V4L2_EVENT_SOURCE_CHANGE, and adv7604 sends a private ADV76XX_HOTPLUG when the bridge has to drive HPD back out at the connector, which cobalt consumes. Only the source power state is missing. Add a generic notification for it. The argument carries the same per-input mask as the control, so a device in front of a receiver can pass on what it sees without the receiver having to reach into its control handler. Assisted-by: Claude:claude-opus-5 Signed-off-by: Sascha Hauer --- include/media/v4l2-subdev.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index c1483a85d0c72..a3ee4866cce69 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -29,6 +29,14 @@ =20 #define V4L2_DEVICE_NOTIFY_EVENT _IOW('v', 2, struct v4l2_event) =20 +/* + * The source power state a receiver publishes as + * V4L2_CID_DV_RX_POWER_PRESENT has changed. The argument points at an + * unsigned int holding the same per-input mask as that control, so zero + * means no input sees a source. + */ +#define V4L2_DEVICE_NOTIFY_RX_POWER_PRESENT _IOW('v', 3, unsigned int) + struct v4l2_device; struct v4l2_ctrl_handler; struct v4l2_event; --=20 2.47.3 From nobody Thu Sep 24 13:33:45 2026 Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B9F947D92F; Thu, 24 Sep 2026 12:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.203.200.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251574; cv=pass; b=npgTG/gYtp05qrt/CXgd5Wt/qkTwQCA8IpVtKFnzAI3WbfyzhGqz/zRMvAlnUOMJQ/6CIskrOP8WwhG3OaB8JhuxZrwx5k8IOtwwoqhZt8eCV3yiFe4FkZc1VcF4kggcnz6CfsNR9bD55+UT5AuwVmiTYfG3jBBFflAbBTUmhrU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790251574; c=relaxed/simple; bh=cGN+WU0I3reho3kwl+fCXa0kKZOO9SIk0zhR+yI6nn0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vr/UN/kSncck28lZP1cHlk17kdposYwmU52k/sVyo4ivz8r7TEoLBy2w6gXvatr4b1KV7lALprwxqxQme7k4hRmiOPYOL/IKbX9s9578KauLKBvmvYXrw0JoP0W1np6J2xyEqCRF+Kt9nlE/AM3EmQ9y9M3g6zx+C+JBA95RdjA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b=Op9iAaOM; arc=pass smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.b="Op9iAaOM" Received: from [127.0.1.1] (unknown [IPv6:2a02:560:5dd5:4b00:9ebf:dff:fe00:fdb5]) (Authenticated sender: sha@pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 9BC902021EE; Thu, 24 Sep 2026 14:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUzcFRKj9DJPCYjequouHSPjsyvnJK72nltLRSdS4p0=; b=Op9iAaOMVIxpsbjUfnwZwlbwo1NpNMQl7SvMsgEvZVcE7SMQGbR91ZrDnSn4WIOJZBvu3L GCPDM5A2vZ3wyHSh3+tWbpokAY/EVMyWGi/Dhlx6G1Q+ob78y1+lH0RHdtofoI0N3gcPMb 0KPJiA56Cw/EnQR2Vjh7C30c6sGaC0TKyr1nV69/kHTe87Q29gtUO3dw2qbIv7Z2x1GMKp Wd1IHRAVHP39lWOJlpJVa79bvBYVDI/1X/TjbavLh3ce+zU51j2ov10z1DqF+ltlR+x258 HLSjUU8iCPwRHDbDgQdRYPjMa7jz2Zucf2K5G6KRQeteDoFIs+F80akCc3cVuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1790251558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUzcFRKj9DJPCYjequouHSPjsyvnJK72nltLRSdS4p0=; b=dIzwn9EOaL5odsqZFY9fztqgMXr1YhiFIR68+islNr+5RyQAfpqYfA4JBOjcqZGxVPzEKx 0R81sMM1rOi8NAqm7Duwe/KMpAM39nJ1b3dciWB0JSz2LjUG/NbsFYCoWf/O0n0xKtKnWw JaEN1m02pRR4OHZnOG8WEX3oWVhlfq8gono4bY/AlwNIfGMkjOmPZUxzLoWOlqowVL02ZU P+SEKsazL+fIz41GgotCjYcHPf6hpcwJKw6edfJB321hpWaBHNnT+0xW3MrFWPD6XFwkff Lo5sET0z7SFikznVJvWT4lU13FP+9qUjaDlRJoGYVEEttBX/XaDzhvH5c7CUlQ== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1790251558; a=rsa-sha256; cv=none; b=d59rCVB1hUhinAB1edzsMSVZd+Lv3P7AASXS7D7vPkGbbx4kQYK9wKOghB+XH4CxDtEed4 LnlQFds91jjleBtilHNQo6GLH/neu799dp8oAW2ucn6mAjazBaCgZqozPX8I41HzeLpnvW qkyt+cH/twKYA2Gr9tHxGnqln/pj9XJE+EsssQB90s3dxiEh/y2QrXYLRWJDNKiJ+8AN5T o/riD9VxBpTyJUliYvUD1ToIpzEHN/ZyS3+8uaPMmDJPC8IfIP7aL48v079ZEyZ2YybFcH 8+KWB5TyzgODBXt2C1r5RZu4mGSyCdZ9KZHFh1owgu72cfRqQIc6iEefSfbfXw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sha@pengutronix.de smtp.mailfrom=s.hauer@pengutronix.de From: Sascha Hauer Date: Thu, 24 Sep 2026 14:06:03 +0200 Subject: [PATCH v2 9/9] media: synopsys: hdmirx: get the 5V state from the upstream subdev Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260924-hdmirx-media-v2-9-c12f641d8b0f@pengutronix.de> References: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> In-Reply-To: <20260924-hdmirx-media-v2-0-c12f641d8b0f@pengutronix.de> To: Dmitry Osipenko , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Gerald Loacker , Lucas Sinn , linux-media@vger.kernel.org, devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Sascha Hauer X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790251557; l=9494; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=7vgYjlZk+zyMuHHoBQ2ouObNEqPLiyaQgI1U5UGXSm0=; b=HmJYZL5vvlNpY5jmsqjgDVk+IfhcgKoxI8RdnMADiO1FfkqIVOaZQunXxzEFBoF7HXBO+KZhJ UwZoQ8BLGDjATzSQ4rYPDT/wNq7qSiUQ70fBspiRZCffFSPQ9dZxifR X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= From: Gerald Loacker On a board whose HDMI connector belongs to a device in front of this receiver, the connector's +5V line goes to that device and hpd-gpios is absent. tx_5v_power_present() then reads a NULL descriptor, which gpiod_get_value_cansleep() reports as zero, so the receiver never sees a source and hdmirx_plugin() never runs. Ask the device in front instead. Remember the subdev bound through our async notifier in source_sd, and without a GPIO of our own have tx_5v_power_present() call its g_input_status(), taking V4L2_IN_ST_NO_POWER as "no 5V". There is nothing to debounce here; the subdev does that on its side of the connector. A subdev without that op is bound anyway, with a warning: a receiver that sees no source beats one that refuses to probe. Changes reach us the way they do on the GPIO path, as an edge that makes the hotplug worker look again. Once the subdev is bound its sd->v4l2_dev is ours, so v4l2_subdev_notify() lands in the callback installed here, and V4L2_DEVICE_NOTIFY_RX_POWER_PRESENT stands in for the 5V interrupt this board does not have. The value the notification carries is not used. The worker asks the subdev itself, so nothing is cached that could go stale against bind, unbind, or a notification that arrives early or late. Bind and unbind queue the work as well, for a source that was connected all along and for one that leaves with the subdev. With a GPIO of our own, notifications are ignored. source_sd is set and cleared under work_lock. Every caller of tx_5v_power_present() already holds it except port_no_link(), which VIDIOC_QUERY_DV_TIMINGS reaches without it; take it there. hdmirx_notify() reads sd->v4l2_dev, which relies on v4l2_device_unregister_subdev() waiting for running callbacks before it clears the pointer, see "media: v4l2-device: wait for notifications when unregistering a subdev". Without a det_irq there is nothing to disable_irq() across the cancel in hdmirx_disable_irq(), so a notification could queue the hotplug work right afterwards - including from hdmirx_suspend(), on its way to gating the clocks. Disable the work items instead of cancelling them. disable_delayed_work_sync() also turns every later attempt to queue them into a no-op, whoever makes it, and hdmirx_enable_irq() enables them again. They start out disabled at probe, which keeps the worker queued by hdmirx_fwnode_bound() off the hardware before the EDID is written. It also covers the way out: hdmirx_fwnode_unbind() queues the work from inside v4l2_async_nf_unregister(), in hdmirx_remove() and on the probe error path, just before the devm allocated hdmirx_dev goes away, and that queue is now ignored. Assisted-by: Claude:claude-opus-5 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Gerald Loacker Signed-off-by: Sascha Hauer --- .../media/platform/synopsys/hdmirx/snps_hdmirx.c | 101 +++++++++++++++++= ++-- 1 file changed, 95 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index 4b94e35c912c1..5fa276706a6e6 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -142,6 +142,7 @@ struct snps_hdmirx_dev { struct mutex phy_rw_lock; /* to protect phy r/w configuration */ struct mutex stream_lock; /* to lock video stream capture */ struct mutex work_lock; /* to lock the critical section of hotplug event = */ + struct v4l2_subdev *source_sd; /* under work_lock: 5V without hpd-gpios */ struct reset_control_bulk_data resets[HDMIRX_NUM_RST]; struct clk_bulk_data *clks; struct regmap *grf; @@ -237,6 +238,23 @@ static bool tx_5v_power_present(struct snps_hdmirx_dev= *hdmirx_dev) int val, i, cnt =3D 0; bool ret; =20 + /* + * Without a GPIO of our own the connector belongs to the subdev in + * front of us. Ask it; it debounces on its side of the connector. + */ + if (!hdmirx_dev->detect_5v_gpio) { + u32 status; + + lockdep_assert_held(&hdmirx_dev->work_lock); + + if (!hdmirx_dev->source_sd || + v4l2_subdev_call(hdmirx_dev->source_sd, video, + g_input_status, &status)) + return false; + + return !(status & V4L2_IN_ST_NO_POWER); + } + for (i =3D 0; i < 10; i++) { usleep_range(1000, 1100); val =3D gpiod_get_value_cansleep(hdmirx_dev->detect_5v_gpio); @@ -465,7 +483,13 @@ static int hdmirx_get_detected_timings(struct snps_hdm= irx_dev *hdmirx_dev, =20 static bool port_no_link(struct snps_hdmirx_dev *hdmirx_dev) { - return !tx_5v_power_present(hdmirx_dev); + bool present; + + mutex_lock(&hdmirx_dev->work_lock); + present =3D tx_5v_power_present(hdmirx_dev); + mutex_unlock(&hdmirx_dev->work_lock); + + return !present; } =20 static int hdmirx_query_dv_timings(struct file *file, void *priv, @@ -2272,13 +2296,22 @@ static void hdmirx_delayed_work_res_change(struct w= ork_struct *work) mutex_unlock(&hdmirx_dev->work_lock); } =20 -static irqreturn_t hdmirx_5v_det_irq_handler(int irq, void *dev_id) +/* + * A 5V edge. Neither source of one says more than "look again": the + * hotplug worker samples tx_5v_power_present() and acts on what it finds. + */ +static void hdmirx_5v_edge(struct snps_hdmirx_dev *hdmirx_dev) { - struct snps_hdmirx_dev *hdmirx_dev =3D dev_id; - queue_delayed_work(system_dfl_wq, &hdmirx_dev->delayed_work_hotplug, msecs_to_jiffies(10)); +} + +static irqreturn_t hdmirx_5v_det_irq_handler(int irq, void *dev_id) +{ + struct snps_hdmirx_dev *hdmirx_dev =3D dev_id; + + hdmirx_5v_edge(hdmirx_dev); =20 return IRQ_HANDLED; } @@ -2530,14 +2563,18 @@ static void hdmirx_disable_irq(struct device *dev) disable_irq(hdmirx_dev->dma_irq); disable_irq(hdmirx_dev->hdmi_irq); =20 - cancel_delayed_work_sync(&hdmirx_dev->delayed_work_hotplug); - cancel_delayed_work_sync(&hdmirx_dev->delayed_work_res_change); + /* A subdev in front of us can still notify, keep it from queueing. */ + disable_delayed_work_sync(&hdmirx_dev->delayed_work_hotplug); + disable_delayed_work_sync(&hdmirx_dev->delayed_work_res_change); } =20 static void hdmirx_enable_irq(struct device *dev) { struct snps_hdmirx_dev *hdmirx_dev =3D dev_get_drvdata(dev); =20 + enable_delayed_work(&hdmirx_dev->delayed_work_hotplug); + enable_delayed_work(&hdmirx_dev->delayed_work_res_change); + enable_irq(hdmirx_dev->hdmi_irq); enable_irq(hdmirx_dev->dma_irq); if (hdmirx_dev->det_irq > 0) @@ -2673,6 +2710,19 @@ static int hdmirx_register_cec(struct snps_hdmirx_de= v *hdmirx_dev, return 0; } =20 +static void hdmirx_notify(struct v4l2_subdev *sd, unsigned int notificatio= n, + void *arg) +{ + struct snps_hdmirx_dev *hdmirx_dev =3D + container_of(sd->v4l2_dev, struct snps_hdmirx_dev, v4l2_dev); + + if (notification !=3D V4L2_DEVICE_NOTIFY_RX_POWER_PRESENT || + hdmirx_dev->detect_5v_gpio) + return; + + hdmirx_5v_edge(hdmirx_dev); +} + static int hdmirx_fwnode_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *subdev, struct v4l2_async_connection *asc) @@ -2701,6 +2751,21 @@ static int hdmirx_fwnode_bound(struct v4l2_async_not= ifier *notifier, return ret; } =20 + if (hdmirx_dev->detect_5v_gpio) + return 0; + + if (!v4l2_subdev_has_op(subdev, video, g_input_status)) + dev_warn(hdmirx_dev->dev, + "%s cannot report 5V and there is no hpd-gpios, no source will be dete= cted\n", + subdev->name); + + mutex_lock(&hdmirx_dev->work_lock); + hdmirx_dev->source_sd =3D subdev; + mutex_unlock(&hdmirx_dev->work_lock); + + /* The source may have been connected all along. */ + hdmirx_5v_edge(hdmirx_dev); + return 0; } =20 @@ -2712,8 +2777,28 @@ static int hdmirx_fwnode_complete(struct v4l2_async_= notifier *notifier) return v4l2_device_register_subdev_nodes(&hdmirx_dev->v4l2_dev); } =20 +static void hdmirx_fwnode_unbind(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *subdev, + struct v4l2_async_connection *asc) +{ + struct snps_hdmirx_dev *hdmirx_dev =3D + container_of(notifier, struct snps_hdmirx_dev, notifier); + + /* With a GPIO of our own the connector is ours and stays put. */ + if (hdmirx_dev->detect_5v_gpio) + return; + + mutex_lock(&hdmirx_dev->work_lock); + hdmirx_dev->source_sd =3D NULL; + mutex_unlock(&hdmirx_dev->work_lock); + + /* The source went with it. */ + hdmirx_5v_edge(hdmirx_dev); +} + static const struct v4l2_async_notifier_operations hdmirx_async_ops =3D { .bound =3D hdmirx_fwnode_bound, + .unbind =3D hdmirx_fwnode_unbind, .complete =3D hdmirx_fwnode_complete, }; =20 @@ -2770,6 +2855,9 @@ static int hdmirx_probe(struct platform_device *pdev) hdmirx_delayed_work_hotplug); INIT_DELAYED_WORK(&hdmirx_dev->delayed_work_res_change, hdmirx_delayed_work_res_change); + /* Until hdmirx_enable_irq(), after the EDID is written. */ + disable_delayed_work(&hdmirx_dev->delayed_work_hotplug); + disable_delayed_work(&hdmirx_dev->delayed_work_res_change); =20 hdmirx_dev->cur_fmt_fourcc =3D V4L2_PIX_FMT_BGR24; hdmirx_dev->timings =3D cea640x480; @@ -2808,6 +2896,7 @@ static int hdmirx_probe(struct platform_device *pdev) goto err_pm; } hdmirx_dev->v4l2_dev.ctrl_handler =3D hdl; + hdmirx_dev->v4l2_dev.notify =3D hdmirx_notify; =20 ret =3D v4l2_device_register(dev, &hdmirx_dev->v4l2_dev); if (ret < 0) { --=20 2.47.3