]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: f_uac2: Optionally determine bInterval for HS and SS
authorPavel Hofman <pavel.hofman@ivitera.com>
Thu, 27 Jan 2022 11:43:30 +0000 (12:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Jan 2022 13:26:18 +0000 (14:26 +0100)
commitbb715502766b3ad31d34dcef1230fcc9bd3f4d4e
treefc5817c40e6af899aa9e80aac2fab28da2176f3b
parentdee5a5d8d8fbdf2c293908f528c9777287aac8f9
usb: gadget: f_uac2: Optionally determine bInterval for HS and SS

Allow setting configfs params p_hs_bint/c_hs_bint to 0. If they are set
to 0, determine the largest bInterval (4 to 1) for which the required
bandwidth of the max samplerate fits the max allowed packet size. If the
required bandwidth exceeds max bandwidth for single-packet mode
(ep->mc=1), keep bInterval at 1.

The FS speed is left at fixed bInterval=1.

If for any speed the required bandwidth exceeds the max bandwidth
corresponding to the selected/determined bInterval, print a warning.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220127114331.41367-4-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/configfs-usb-gadget-uac2
Documentation/usb/gadget-testing.rst
drivers/usb/gadget/function/f_uac2.c
drivers/usb/gadget/function/u_uac2.h