usb: gadget: f_fs: expose ready state in configfs
authorPeter Korsgaard <peter@korsgaard.com>
Fri, 26 Jan 2024 20:32:08 +0000 (21:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:39:21 +0000 (17:39 -0800)
commit43a029724d1c8219cc4e58e9fafbeedd1bc283fa
treee833ba14810af81519f5804792420f2f8baa4553
parent2d2a3349521de1757b685b664af849b0824c205d
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>
Documentation/ABI/testing/configfs-usb-gadget-ffs
Documentation/usb/gadget-testing.rst
drivers/usb/gadget/function/f_fs.c