From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795975667; b=XX6ZIaOXhu9IBzavLIpm/ZAe85zjxryqxTpFeb2jZmNjUXwohWDwO0S4SH7crpDA1seu QDFKZBvMtFRwxuUhoOJRl5Ytz3aw4sdwqqXGYJ8FRd8dGns3HGlvUUeWbhlEmzSoggmcD 6C6nHlSb7aSvEdtpfz9GyQ7c1hZEz1z6PPAirCPmVljtK1rbdE2I58S5rc2qdLswNtega mVsmp3Ok7LCjyqZwYqNwL650v8fXasumzcvLgrx7HphRkJdqo6U5/gmyr9OpxLlYFoDvw avjjlBTbMg1nLndAJ3WAl9hdUSEhnFjvHJcaBL/SHf1H/BYilqlDlhZTn9m1eMU6GLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795975667; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=f/HOt5e/K2+JUqZL/yvHjm3Mj3awp5vr0sICnmHbLxA=; b=GusJ2OWRcnYiLf193Lr5xVRVndymqVd6HDUQ/jjD9MS5Z4Ug69SCgjjTqpUCcjsEGQ6N Y/nGo+KtZzzZ6Tkop5ipt9/yc2owHTuX1hsEh4IcCxrwAXQDn968hYLLTyFBQckhJl2M7 WhKwbxZhVWe8eV0LmEbIIbP4TjwzMXLrAgjQ4Ozx4Vha3gf4SqIW8H08xAiP083VshL8K T6wMvaMgxos50vdNzuGi5EuUPoxX17KYK9qgxcKmlXgA5geNI+vVKRphgxUrKwEQ9MpGs IG9Z31rqsWsDbTLIzsV1gc10lTY08lrlXBLn53F8qiABSRzc8L2RRRglwFuxaBRBDLg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=nW+4llOj; arc=none smtp.remote-ip=209.85.218.51 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62BD6606A689 for ; Sun, 29 Nov 2026 18:07:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 62BD6606A689 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=nW+4llOj Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-c50e26763a4so645400766b.1 for ; Sun, 29 Nov 2026 10:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795975665; x=1796580465; darn=vger.kernel.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:content-type; bh=f/HOt5e/K2+JUqZL/yvHjm3Mj3awp5vr0sICnmHbLxA=; b=nW+4llOjmx4bDy9lGsQQye5Xd8bhVj0Yue0sHhSl88g6b9jxsieOR3xF6BKzYsgRdQ ZnqAzSW4eRKdzulHH4IpMBLfjtznWycPV8zKUt2kCPaw0yxjg1/d/fFIb/G2zjiVg84e hH9CM9ZB2MSvFjU7L4CDO2RIjPCz/k2elgJaBzGTsRdbX2zeEULG4KBqqBwt5UV9/aVq kuLjD1zv6pl5WglVY3h8fleQ8i9WEzZYG53N21U+btIMqrNp2apxfJyq93CYcmYTFg4v LFo2DD87zdPFY7FOtvQWs+KFEthOihdnf7cbfrexwjFolocc+xPuc+EkVPPkr/8OuIFx 8HoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795975665; x=1796580465; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=f/HOt5e/K2+JUqZL/yvHjm3Mj3awp5vr0sICnmHbLxA=; b=TnZaKVsib2/d0pWq7vtSuvs3XSi08jQTkyrrKGinseM+DiZ93hpeVCLo5mAxISgL/K NTtzX3iA+Knqyz+euFl0pVLd8S4UG6VRyLbbuC5hsC20DtcTgrbn0dRyJAHiJsPRl4zK duxJ7y4VszLVzwJtJBun8LKTQGZC9OG/r2kcmGPyA1gmINxO2A4N/8FAaEewtYjtQOvI f7fLjK903a4wmb4xbtITuD6u+RjrODzBoXbOdmV9r+rjv3sSgGdmH3Cyzyn4jjUipsJE T53a9UgI2gshS8Pty+AZbFFdjo0oKIEejSzOwzXHY+7h5B7IywYPhRdrVf/KSOuY3a9U FhVw== X-Gm-Message-State: APuU4Z/hJ74ToCiGPfj+ZsZ43T7VMc8ZbBsykRg7ubcLvVUR/IJQ9AyL LeI36CLNmgrE8oD0WrAZYthlH8t7IFYTg0SeKAze6liO/mby/CIZKzm3 X-Gm-Gg: AZFdTZesPpkhzhwbiINw9YcZCBOydNsSLOd4bAklNcILU/o8SiQR6UKf6guvc2rv+uz hnnVUluGJwAJcGk2fdD/8K2FDO3gFvNO85D+CCFDUdPwHACvTjO7p6e89+hQW7mSfuMi5x+EBbz +I1C2G13Rc2x7RrgV0jpeV0+HFOt/t+K6xyR6DXwEK1tm7CgJM9/JFwTfub+2Ei02Ic3sDFeqAa gM3BnEPd9QL9Q4Cu2sffEHEgW7JlUvNuz8EcexA4DgHBWHKLno5JaBSWplhzKYcTi4+xkmYmn2P zbcAdJ8tW4B/JaVoqnBekeRpc1AG5OE6aIpmBrFfHgo4R7jNRoCsZSNTbIvhG1RXODY9pNr4rVz wFNfwHgrhz4XaxlWMeu8piFFdg1SUd2qMPkMV2n5F4UP7B6rkNh8QLDIYTuV6cNSud4LH2aTc22 6/hxRLBpuYW/lRBTNoAqqQRUGR5jGOsqD62A8Yu9rVh/8X3L8TK4LvA05rf+w8ctkdYexXFHs9W Vvh5FRSArUZq8aHg5fQdoIxxaoOJ3FDkl1y3pNysPSbjWqq3CcgnPxFhQTa/s/JbMMhwx6I1z8M NuSnjSBWCmtVLrct7UutVefLpBOg63KCsRfD/af9FOWGBlBlMhHMVLLbtiR4R1ZNxUEaIXHnjob WLDmDvq3ErA== X-Received: by 2002:a17:907:1301:b0:c50:5005:8ed0 with SMTP id a640c23a62f3a-c513a9997acmr1850697066b.13.1795975664653; Sun, 29 Nov 2026 10:07:44 -0800 (PST) Received: from xeon ([188.163.112.54]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513ae8ce16sm1061518266b.37.2026.11.29.10.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 10:07:44 -0800 (PST) From: Svyatoslav Ryhel To: Mauro Carvalho Chehab , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Greg Kroah-Hartman , Svyatoslav Ryhel , Hans Verkuil , Mikko Perttunen Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 03/15] media: tegra-video: vi: Expose all sub-devices in the pipeline Date: Sun, 29 Nov 2026 20:07:10 +0200 Message-ID: <20261129180722.142186-4-clamor95@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261129180722.142186-1-clamor95@gmail.com> References: <20261129180722.142186-1-clamor95@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add support for exposing /dev/v4l-subdev* nodes for the CSI and VIP bridge sub-devices to userspace by setting V4L2_SUBDEV_FL_HAS_DEVNODE flag. Call v4l2_device_register_subdev_nodes() in the async complete notifier callback to expose all devices in the pipeline, including auxiliary ones. Signed-off-by: Svyatoslav Ryhel --- drivers/media/platform/nvidia/tegra-video/Kconfig | 1 + drivers/media/platform/nvidia/tegra-video/csi.c | 1 + drivers/media/platform/nvidia/tegra-video/vi.c | 14 ++++++++++++++ drivers/media/platform/nvidia/tegra-video/vip.c | 1 + 4 files changed, 17 insertions(+) diff --git a/drivers/media/platform/nvidia/tegra-video/Kconfig b/drivers/media/platform/nvidia/tegra-video/Kconfig index c53441822fdf2..d6cfbbb3870e1 100644 --- a/drivers/media/platform/nvidia/tegra-video/Kconfig +++ b/drivers/media/platform/nvidia/tegra-video/Kconfig @@ -5,6 +5,7 @@ config VIDEO_TEGRA depends on VIDEO_DEV select MEDIA_CONTROLLER select VIDEOBUF2_DMA_CONTIG + select VIDEO_V4L2_SUBDEV_API select V4L2_FWNODE help Choose this option if you have an NVIDIA Tegra SoC. diff --git a/drivers/media/platform/nvidia/tegra-video/csi.c b/drivers/media/platform/nvidia/tegra-video/csi.c index 44bd53dbbf7fd..add526de536f9 100644 --- a/drivers/media/platform/nvidia/tegra-video/csi.c +++ b/drivers/media/platform/nvidia/tegra-video/csi.c @@ -680,6 +680,7 @@ static int tegra_csi_channel_init(struct tegra_csi_channel *chan) v4l2_set_subdevdata(subdev, chan); subdev->fwnode = of_fwnode_handle(chan->of_node); subdev->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; + subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; /* initialize media entity pads */ ret = media_entity_pads_init(&subdev->entity, chan->numpads, diff --git a/drivers/media/platform/nvidia/tegra-video/vi.c b/drivers/media/platform/nvidia/tegra-video/vi.c index 71921931457be..1df4700ab35d6 100644 --- a/drivers/media/platform/nvidia/tegra-video/vi.c +++ b/drivers/media/platform/nvidia/tegra-video/vi.c @@ -1392,6 +1392,12 @@ int tegra_v4l2_nodes_setup_tpg(struct tegra_video_device *vid) csi_chan = list_next_entry(csi_chan, list); } + ret = v4l2_device_register_subdev_nodes(&vid->v4l2_dev); + if (ret) { + dev_err(vi->dev, "failed to register subdev nodes\n"); + goto cleanup; + } + return 0; cleanup: @@ -1548,12 +1554,14 @@ static int tegra_vi_graph_notify_complete(struct v4l2_async_notifier *notifier) struct tegra_vi_graph_entity *entity; struct v4l2_async_connection *asd; struct v4l2_subdev *subdev; + struct tegra_video_device *vid; struct tegra_vi_channel *chan; struct tegra_vi *vi; int ret; chan = container_of(notifier, struct tegra_vi_channel, notifier); vi = chan->vi; + vid = dev_get_drvdata(vi->client.host); dev_dbg(vi->dev, "notify complete, all subdevs registered\n"); @@ -1610,6 +1618,12 @@ static int tegra_vi_graph_notify_complete(struct v4l2_async_notifier *notifier) subdev = tegra_channel_get_remote_source_subdev(chan); v4l2_set_subdev_hostdata(subdev, chan); + ret = v4l2_device_register_subdev_nodes(&vid->v4l2_dev); + if (ret) { + dev_err(vi->dev, "failed to register subdev nodes\n"); + goto unregister_video; + } + return 0; unregister_video: diff --git a/drivers/media/platform/nvidia/tegra-video/vip.c b/drivers/media/platform/nvidia/tegra-video/vip.c index b73ba0eab5573..040776775aacc 100644 --- a/drivers/media/platform/nvidia/tegra-video/vip.c +++ b/drivers/media/platform/nvidia/tegra-video/vip.c @@ -165,6 +165,7 @@ static int tegra_vip_channel_init(struct tegra_vip *vip) v4l2_set_subdevdata(subdev, &vip->chan); subdev->fwnode = of_fwnode_handle(vip->chan.of_node); subdev->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; + subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; err = media_entity_pads_init(&subdev->entity, TEGRA_VIP_PADS_NUM, vip->chan.pads); if (err) -- 2.53.0