From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30409EE3698 for ; Thu, 12 Feb 2026 16:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Agv8b2pAGWA3vLEQ2eCKVx10DjeNpyX0EOfs/+D4m5A=; b=C6qlwXBLtivVuY KMwYn5dSm/QlfcxRvKipVL3N6GJyb2wF1Cssvb+w2oW1JnXzoBmqe4+wrs0Z+tAtHgZ/FdHlj7wQY njmCPW5UEkimsLrqi2fKzsg/PZKh2X9n9SeOEP5EOaok+My2vy63nWH3HcSu7mT3brOkxi+P9iZ2u /DFdNBrldJyFUBcOOt4XXG6tNw2yqDOPpOHSDLJi9b+DTN5jmyV++uE9dxctawb4tRvuxQEbpd29t fRJfpvYIL0gqsLrzmIJB5OE9T9VDh2GcwRT9Okq+Zx+FG01E0OdBIvMG52Dqrj3gOjzZBmbB//FcG nJRs3kqV04BtLQ8Zu/Zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vqZUL-00000002Lp3-0qS7; Thu, 12 Feb 2026 16:24:21 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vqZUD-00000002LbD-0m74; Thu, 12 Feb 2026 16:24:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1770913450; bh=QqdFH7NwWvtYWHLyq+m7eMuRIfxQNi+SYpkiFhBYq0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cok2o3Kp51uFVv6QQ39FMI4NKGjrhEy+cnMLl7ot0lK58VFt+tmroIqj+40Exikk2 FgqoPFHg0rOlBAFxrY6xEJC36RaWyJme7Q73SbtfOB2yjk9IvYEsxVE29mFu9O/fk0 FC1zbEuT1MalSrHk5/RnGout1FWR955jxNALOtfRIbm9uVwO2ETJ3fAeQmE6QQjIvh CXdLlHjCN2f2FLmpbr7w9CeC5NZW2L+YmNlNqQstw4kthTi522jzvDhfgW9KtRD0bB Ym0H1KUZeNNb546vikIyZCfAva7KPcdYNEPS9SFZWIE24LTyMccW4rBg+cMR6DBG0u odbtFrThFdERw== Received: from trenzalore (modemcable014.2-22-96.mc.videotron.ca [96.22.2.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by bali.collaboradmins.com (Postfix) with ESMTPSA id 2B6DE17E1144; Thu, 12 Feb 2026 17:24:07 +0100 (CET) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Nicolas Dufresne , Benjamin Gaignard , Philipp Zabel , Mauro Carvalho Chehab , Heiko Stuebner , Daniel Almeida , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Hans Verkuil , Laurent Pinchart , Ricardo Ribalda , Yunke Cao , Detlev Casanova , Sakari Ailus , Pavan Bobba , James Cowgill , Ma Ke , Jacopo Mondi , Daniel Scally , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-trace-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH 10/11] media: v4l2: Add callback for show_fdinfo Date: Thu, 12 Feb 2026 11:23:27 -0500 Message-ID: <20260212162328.192217-11-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260212162328.192217-1-detlev.casanova@collabora.com> References: <20260212162328.192217-1-detlev.casanova@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260212_082413_445287_8B258A62 X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Allow v4l2 drivers to add information in the fdinfo file matching the opened /dev/videoX file. Signed-off-by: Detlev Casanova --- drivers/media/v4l2-core/v4l2-dev.c | 10 ++++++++++ include/media/v4l2-dev.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 10a126e50c1c..29c04f5f4c59 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -481,6 +481,15 @@ static int v4l2_release(struct inode *inode, struct file *filp) return ret; } +/* Override for the show_fdinfo function */ +static void v4l2_show_fdinfo(struct seq_file *m, struct file *filp) +{ + struct video_device *vdev = video_devdata(filp); + + if (vdev->fops->show_fdinfo) + vdev->fops->show_fdinfo(m, filp); +} + static const struct file_operations v4l2_fops = { .owner = THIS_MODULE, .read = v4l2_read, @@ -494,6 +503,7 @@ static const struct file_operations v4l2_fops = { #endif .release = v4l2_release, .poll = v4l2_poll, + .show_fdinfo = v4l2_show_fdinfo, }; /** diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 2e0f6d2e6a78..1635ab186f21 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -212,6 +212,7 @@ struct v4l2_file_operations { int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct file *); int (*release) (struct file *); + void (*show_fdinfo)(struct seq_file *, struct file *); }; /* -- 2.53.0 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip