diff options
author | Peter Korsgaard <peter@korsgaard.com> | 2024-01-26 23:32:08 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-28 04:39:21 +0300 |
commit | 43a029724d1c8219cc4e58e9fafbeedd1bc283fa (patch) | |
tree | e833ba14810af81519f5804792420f2f8baa4553 /Documentation/usb | |
parent | 2d2a3349521de1757b685b664af849b0824c205d (diff) | |
download | linux-43a029724d1c8219cc4e58e9fafbeedd1bc283fa.tar.xz |
usb: gadget: f_fs: expose ready state in configfs
When a USB gadget is configured through configfs with 1 or more f_fs
functions, then the logic setting up the gadget configuration has to wait
until the user space code (typically separate applications) responsible for
those functions have written their descriptors before the gadget can be
activated.
The f_fs instance already knows if this has been done, so expose it through
a "ready" attribute in configfs for easier synchronization.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://lore.kernel.org/r/20240126203208.2482573-1-peter@korsgaard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/usb')
-rw-r--r-- | Documentation/usb/gadget-testing.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/usb/gadget-testing.rst b/Documentation/usb/gadget-testing.rst index 8cd62c466d20..4ec6b775ebba 100644 --- a/Documentation/usb/gadget-testing.rst +++ b/Documentation/usb/gadget-testing.rst @@ -206,6 +206,14 @@ the standard procedure for using FunctionFS (mount it, run the userspace process which implements the function proper). The gadget should be enabled by writing a suitable string to usb_gadget/<gadget>/UDC. +The FFS function provides just one attribute in its function directory: + + ready + +The attribute is read-only and signals if the function is ready (1) to be +used, E.G. if userspace has written descriptors and strings to ep0, so +the gadget can be enabled. + Testing the FFS function ------------------------ |