diff options
author | Daniel Scally <dan.scally@ideasonboard.com> | 2023-03-09 11:58:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-29 08:51:26 +0200 |
commit | 7bf1c56a90decd3bec4d49815289d2e40bb771ae (patch) | |
tree | 01169e55e10ac21de4210df15b7836603cb4cd1a /Documentation/usb/gadget_uvc.rst | |
parent | usb: typec: tps6598x: Add support for polling interrupts status (diff) | |
download | linux-7bf1c56a90decd3bec4d49815289d2e40bb771ae.tar.xz linux-7bf1c56a90decd3bec4d49815289d2e40bb771ae.zip |
usb: gadget: uvc: Make bmControls attr read/write
For the Processing Unit and Camera Terminal descriptors defined in
the UVC Gadget we currently hard-code values into their bmControls
fields, which enumerates which controls the gadget is able to
support. This isn't appropriate since only the userspace companion
program to the kernel driver will know which controls are supported.
Make the configfs attributes that point to those fields read/write
so userspace can set them to appropriate values.
Document the new behaviour at the same time so the functionality is
clear.
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Link: https://lore.kernel.org/r/20230309105825.216745-1-dan.scally@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/usb/gadget_uvc.rst')
-rw-r--r-- | Documentation/usb/gadget_uvc.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/usb/gadget_uvc.rst b/Documentation/usb/gadget_uvc.rst index 6d22faceb1a0..62bd81ba3dd1 100644 --- a/Documentation/usb/gadget_uvc.rst +++ b/Documentation/usb/gadget_uvc.rst @@ -275,6 +275,34 @@ out with 0x00, for example: bNrInPins and baSourceID function in the same way. +Configuring Supported Controls for Camera Terminal and Processing Unit +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Camera Terminal and Processing Units in the UVC chain also have bmControls +attributes which function similarly to the same field in an Extension Unit. +Unlike XUs however, the meaning of the bitflag for these units is defined in +the UVC specification; you should consult the "Camera Terminal Descriptor" and +"Processing Unit Descriptor" sections for an enumeration of the flags. + +.. code-block:: bash + + # Set the Processing Unit's bmControls, flagging Brightness, Contrast + # and Hue as available controls: + echo 0x05 > $FUNCTION/control/processing/default/bmControls + + # Set the Camera Terminal's bmControls, flagging Focus Absolute and + # Focus Relative as available controls: + echo 0x60 > $FUNCTION/control/terminal/camera/default/bmControls + +If you do not set these fields then by default the Auto-Exposure Mode control +for the Camera Terminal and the Brightness control for the Processing Unit will +be flagged as available; if they are not supported you should set the field to +0x00. + +Note that the size of the bmControls field for a Camera Terminal or Processing +Unit is fixed by the UVC specification, and so the bControlSize attribute is +read-only here. + Custom Strings Support ~~~~~~~~~~~~~~~~~~~~~~ |