diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-09-06 06:54:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:19:34 -0400 |
commit | 6b5270d21202fcf6ae16a6266fed83a30ccece7a (patch) | |
tree | 54036a74de819e7d6a63f7572ecf37b0a00ac94c /Documentation/video4linux | |
parent | 5062cb70c828bd7b2a8223390ae836c5baa250b9 (diff) |
V4L/DVB (12725): v4l: warn when desired devnodenr is in use & add _no_warn function
Warn when the desired device node number is already in use, except when
the new video_register_device_no_warn function is called since in some
use-cases that warning is not relevant.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index 38b3716d8643..b806edaf3e75 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -486,17 +486,27 @@ VFL_TYPE_RADIO: radioX for radio tuners | |||
486 | VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use) | 486 | VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use) |
487 | 487 | ||
488 | The last argument gives you a certain amount of control over the device | 488 | The last argument gives you a certain amount of control over the device |
489 | device node number used (i.e. the X in videoX). Normally you will pass -1 to | 489 | device node number used (i.e. the X in videoX). Normally you will pass -1 |
490 | let the v4l2 framework pick the first free number. But if a driver creates | 490 | to let the v4l2 framework pick the first free number. But sometimes users |
491 | many devices, then it can be useful to have different video devices in | 491 | want to select a specific node number. It is common that drivers allow |
492 | separate ranges. For example, video capture devices start at 0, video | 492 | the user to select a specific device node number through a driver module |
493 | output devices start at 16. | 493 | option. That number is then passed to this function and video_register_device |
494 | 494 | will attempt to select that device node number. If that number was already | |
495 | in use, then the next free device node number will be selected and it | ||
496 | will send a warning to the kernel log. | ||
497 | |||
498 | Another use-case is if a driver creates many devices. In that case it can | ||
499 | be useful to place different video devices in separate ranges. For example, | ||
500 | video capture devices start at 0, video output devices start at 16. | ||
495 | So you can use the last argument to specify a minimum device node number | 501 | So you can use the last argument to specify a minimum device node number |
496 | and the v4l2 framework will try to pick the first free number that is equal | 502 | and the v4l2 framework will try to pick the first free number that is equal |
497 | or higher to what you passed. If that fails, then it will just pick the | 503 | or higher to what you passed. If that fails, then it will just pick the |
498 | first free number. | 504 | first free number. |
499 | 505 | ||
506 | Since in this case you do not care about a warning about not being able | ||
507 | to select the specified device node number, you can call the function | ||
508 | video_register_device_no_warn() instead. | ||
509 | |||
500 | Whenever a device node is created some attributes are also created for you. | 510 | Whenever a device node is created some attributes are also created for you. |
501 | If you look in /sys/class/video4linux you see the devices. Go into e.g. | 511 | If you look in /sys/class/video4linux you see the devices. Go into e.g. |
502 | video0 and you will see 'name' and 'index' attributes. The 'name' attribute | 512 | video0 and you will see 'name' and 'index' attributes. The 'name' attribute |