Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720062

Re: [PATCH v2 1/3] media: open.rst: better document device node naming

Path csiph.com!news.mixmin.net!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news.panservice.it!bofh.it!news.nic.it!robomod
From Hans Verkuil <hverkuil@xs4all.nl>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/3] media: open.rst: better document device node naming
Date Fri, 25 Aug 2017 15:40:02 +0200
Message-ID <uin06-4CU-25@gated-at.bofh.it> (permalink)
References <uimnn-4aL-1@gated-at.bofh.it> <uimno-4aL-13@gated-at.bofh.it>
X-Original-To Mauro Carvalho Chehab <mchehab@s-opensource.com>, Linux Doc Mailing List <linux-doc@vger.kernel.org>, Linux Media Mailing List <linux-media@vger.kernel.org>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Cmae-Envelope MS4wfJwS4jktZzJYA+OD9ZbOYC/9tOWqXL2UIdYW4OICD+tAFZoXUVcnflsrM7Em4/skHdYAzCa1jGwBQFYMw3BlkNxcBbTZsgljmF9W/cZRhxRGhrrAbNre akELIejVpx3dghYPalplw2qmCJjInqUCTni8rBavKIjpxTK9tMIlUTzQCb0U+vE35X9yK1tVgfxSoSC+NHjCMkJT67mQJ6A5HneiHTEzlr2VUyxKTt61RA8H DIBji0A58+OlTf/pbGghgfkUS/gK0DuMzRg5W6m3WtCfNSLnpFaA60JBOK8tpOBAlNa9Jpn16jjBIJ2JhqNjdG15Vy+7jtXFnJ3W5Tbh7jsMPaKvexQUow9d bRQQGpyC
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 93
Organization linux.* mail to news gateway
X-Original-Cc Mauro Carvalho Chehab <mchehab@infradead.org>, linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
X-Original-Date Fri, 25 Aug 2017 15:31:27 +0200
X-Original-Message-ID <1c670bfe-aedf-3b3a-5fe6-ed224fd85496@xs4all.nl>
X-Original-References <cover.1503665390.git.mchehab@s-opensource.com> <65c6702e967614245c261b54d9f3fb0e69ec93d0.1503665390.git.mchehab@s-opensource.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1720062

Show key headers only | View raw


On 25/08/17 14:52, Mauro Carvalho Chehab wrote:
> 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.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
>  Documentation/media/uapi/v4l/open.rst | 40 ++++++++++++++++++++++++++++++-----
>  1 file changed, 35 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/media/uapi/v4l/open.rst b/Documentation/media/uapi/v4l/open.rst
> index afd116edb40d..9b98d10d5153 100644
> --- a/Documentation/media/uapi/v4l/open.rst
> +++ b/Documentation/media/uapi/v4l/open.rst
> @@ -7,12 +7,12 @@ Opening and Closing Devices
>  ***************************
>  
>  
> -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.
>  
> @@ -20,8 +20,38 @@ Each driver thus loaded registers one or more device nodes with major
>  number 81 and a minor number between 0 and 255. Minor numbers are
>  allocated dynamically unless the kernel is compiled with the kernel
>  option CONFIG_VIDEO_FIXED_MINOR_RANGES. In that case minor numbers
> -are allocated in ranges depending on the device node type (video, radio,
> -etc.).
> +are allocated in ranges depending on the device node type.
> +
> +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

add: and modulators.

> +``/dev/swradioX``	 Software Defined Radio tuners

Ditto.

> +``/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's not warranty that ``X`` will remain the same for the same

"There is no"

> +      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/`` that can use to uniquelly

      ``/dev/v4l/by-id/`` and ``/dev/v4l/by-path/`` directories containing links
	that be can used to uniquely

> +      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
> 

With these changes:

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Thanks!

	Hans

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] document types of hardware control for V4L2 Mauro Carvalho Chehab <mchehab@s-opensource.com> - 2017-08-25 15:00 +0200
  [PATCH v2 2/3] media: open.rst: document devnode-centric and mc-centric types Mauro Carvalho Chehab <mchehab@s-opensource.com> - 2017-08-25 15:00 +0200
    Re: [PATCH v2 2/3] media: open.rst: document devnode-centric and  mc-centric types Hans Verkuil <hverkuil@xs4all.nl> - 2017-08-25 15:50 +0200
      Re: [PATCH v2 2/3] media: open.rst: document devnode-centric and  mc-centric types Mauro Carvalho Chehab <mchehab@s-opensource.com> - 2017-08-26 13:00 +0200
  Re: [PATCH v2 1/3] media: open.rst: better document device node  naming Mauro Carvalho Chehab <mchehab@s-opensource.com> - 2017-08-25 15:00 +0200
  [PATCH v2 1/3] media: open.rst: better document device node naming Mauro Carvalho Chehab <mchehab@s-opensource.com> - 2017-08-25 15:00 +0200
    Re: [PATCH v2 1/3] media: open.rst: better document device node  naming Hans Verkuil <hverkuil@xs4all.nl> - 2017-08-25 15:40 +0200
  [PATCH v2 3/3] media: videodev2: add a flag for MC-centric devices Mauro Carvalho Chehab <mchehab@s-opensource.com> - 2017-08-25 15:00 +0200

csiph-web