All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: [PATCH v5 2/7] media: open.rst: better document device node naming
Date: Mon, 28 Aug 2017 09:53:56 -0300	[thread overview]
Message-ID: <f63c7412638307f3f58dc114b64339755741feb6.1503924361.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1503924361.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1503924361.git.mchehab@s-opensource.com>

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 <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/media/uapi/v4l/open.rst | 39 ++++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/Documentation/media/uapi/v4l/open.rst b/Documentation/media/uapi/v4l/open.rst
index afd116edb40d..fc0037091814 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,37 @@ 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 warranty 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/`` directoiries 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
+
+
 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
-- 
2.13.5

  parent reply	other threads:[~2017-08-28 12:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 12:53 [PATCH v5 0/7] document types of hardware control for V4L2 Mauro Carvalho Chehab
2017-08-28 12:53 ` [PATCH v5 1/7] media: add glossary.rst with a glossary of terms used at V4L2 spec Mauro Carvalho Chehab
2017-08-29  7:47   ` Sakari Ailus
2017-08-29 13:07     ` Mauro Carvalho Chehab
2017-10-05  8:21       ` Sakari Ailus
2017-10-05 12:26         ` Mauro Carvalho Chehab
2017-10-06  8:15           ` Sakari Ailus
2017-10-05 18:39         ` Mauro Carvalho Chehab
2017-10-06  8:05           ` Sakari Ailus
2017-08-28 12:53 ` Mauro Carvalho Chehab [this message]
2017-08-29  8:34   ` [PATCH v5 2/7] media: open.rst: better document device node naming Sakari Ailus
2017-08-29  9:07     ` Mauro Carvalho Chehab
2017-08-28 12:53 ` [PATCH v5 3/7] media: open.rst: remove the minor number range Mauro Carvalho Chehab
2017-08-29  8:34   ` Sakari Ailus
2017-08-28 12:53 ` [PATCH v5 4/7] media: open.rst: document devnode-centric and mc-centric types Mauro Carvalho Chehab
2017-08-28 12:53 ` [PATCH v5 5/7] media: open.rst: Adjust some terms to match the glossary Mauro Carvalho Chehab
2017-08-28 12:54 ` [PATCH v5 6/7] media: videodev2: add a flag for MC-centric devices Mauro Carvalho Chehab
2017-08-28 12:54 ` [PATCH v5 7/7] media: open.rst: add a notice about subdev-API on vdev-centric Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f63c7412638307f3f58dc114b64339755741feb6.1503924361.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.