From patchwork Tue Sep 25 12:06:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10613895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 131B614DA for ; Tue, 25 Sep 2018 12:07:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 052C1297C6 for ; Tue, 25 Sep 2018 12:07:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDA0E2973F; Tue, 25 Sep 2018 12:07:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B5D297C6 for ; Tue, 25 Sep 2018 12:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728773AbeIYSOc (ORCPT ); Tue, 25 Sep 2018 14:14:32 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60080 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbeIYSOc (ORCPT ); Tue, 25 Sep 2018 14:14:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:MIME-Version: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-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XCwhHIvWgIr1BJKVuYbLkushvzVTW06wIyUNMaFcG6U=; b=mmUT43s1qHs1jIYVawUQO6jo3c OOF5UtUkMfssdfoBWxpKUOV3n3kOVVIToytXybUQq6NHKdShECNXe7Tn5IV5w2dz1lHz4VYnXCxre Iy7inqTdN8gXxZggj1I7czBISvrrFMJX0Yrsn1AFaYLrzP2VAgMvBZMc56nqGWdoVXl2N/GtBo1um Y/EVb1I4vG/fWfWCsa+HsNANZ1xaXq0zsO8EXf2EIWcIytB1uTJxaH7ZESsW843eyw2vtwuio+CS6 Fd6Rd22CQEpA+BTDuZb2DiCIqwFBOh8vsRn7KwXRW4kh5pX7OA7ItdtVsxgQPfQJaf2+jarwzjC89 JAgv0nSA==; Received: from 177.43.23.201.dynamic.adsl.gvt.net.br ([177.43.23.201] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4m7F-0002Q3-P2; Tue, 25 Sep 2018 12:07:17 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1g4m7D-0006s2-2R; Tue, 25 Sep 2018 09:06:55 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 2/3] media: open.rst: better document device node naming Date: Tue, 25 Sep 2018 09:06:52 -0300 Message-Id: <0938dc20b6496789bf7c36f0f0162c5b62a2663c.1537876293.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mauro Carvalho Chehab Right now, only kAPI documentation describes the device naming. However, such description is needed at the uAPI too. Add it, and describe how to get an unique identify for a given device. Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/media/uapi/v4l/open.rst | 44 +++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/Documentation/media/uapi/v4l/open.rst b/Documentation/media/uapi/v4l/open.rst index afd116edb40d..7e7aad784388 100644 --- a/Documentation/media/uapi/v4l/open.rst +++ b/Documentation/media/uapi/v4l/open.rst @@ -7,12 +7,14 @@ Opening and Closing Devices *************************** -Device Naming -============= +.. _v4l2_device_naming: + +V4L2 Device Node Naming +======================= V4L2 drivers are implemented as kernel modules, loaded manually by the system administrator or automatically when a device is first discovered. -The driver modules plug into the "videodev" kernel module. It provides +The driver modules plug into the ``videodev`` kernel module. It provides helper functions and a common application interface specified in this document. @@ -23,6 +25,42 @@ option CONFIG_VIDEO_FIXED_MINOR_RANGES. In that case minor numbers are allocated in ranges depending on the device node type (video, radio, etc.). +The existing V4L2 device node types are: + +======================== ====================================================== +Default device node name Usage +======================== ====================================================== +``/dev/videoX`` Video input/output devices +``/dev/vbiX`` Vertical blank data (i.e. closed captions, teletext) +``/dev/radioX`` Radio tuners and modulators +``/dev/swradioX`` Software Defined Radio tuners and modulators +``/dev/v4l-touchX`` Touch sensors +======================== ====================================================== + +Where ``X`` is a non-negative number. + +.. note:: + + 1. The actual device node name is system-dependent, as udev rules may apply. + 2. There is no guarantee that ``X`` will remain the same for the same + device, as the number depends on the device driver's probe order. + If you need an unique name, udev default rules produce + ``/dev/v4l/by-id/`` and ``/dev/v4l/by-path/`` directories containing + links that can be used uniquely to identify a V4L2 device node:: + + $ tree /dev/v4l + /dev/v4l + ├── by-id + │   └── usb-OmniVision._USB_Camera-B4.04.27.1-video-index0 -> ../../video0 + └── by-path + └── pci-0000:00:14.0-usb-0:2:1.0-video-index0 -> ../../video0 + + 3. **V4L2 sub-device nodes** (e. g. ``/dev/v4l-sudevX``) provide a + different API and aren't considered as V4L2 device nodes. + + They are covered at :ref:`subdev`. + + Many drivers support "video_nr", "radio_nr" or "vbi_nr" module options to select specific video/radio/vbi node numbers. This allows the user to request that the device node is named e.g. /dev/video5 instead