diff options
Diffstat (limited to 'Documentation/video4linux/v4l2-framework.txt')
-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 |