linux/drivers/usb/gadget/function
Andrzej Pietrasiewicz f1fd91a092 usb: gadget: webcam: Make g_webcam loadable again
commit 588b9e8560 ("usb: gadget: uvc: add v4l2 enumeration api calls")
has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e8560 ("usb: gadget: uvc: add v4l2 enumeration api calls")
Link: https://lore.kernel.org/r/20231215131614.29132-1-andrzej.p@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-15 18:27:38 +01:00
..
f_acm.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_ecm.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_eem.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_fs.c usb: gadget: f_fs: fix fortify warning 2023-12-15 13:55:45 +01:00
f_hid.c usb: gadget: f_hid: fix report descriptor allocation 2023-12-07 10:12:05 +09:00
f_loopback.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_mass_storage.c USB: gadget: f_mass_storage: Fix unused variable warning 2023-08-12 10:06:12 +02:00
f_mass_storage.h
f_midi.c usb: gadget: f_midi: Replace strlcpy() with strscpy() 2023-11-22 12:02:53 +00:00
f_midi2.c usb: gadget: unconditionally allocate hs/ss descriptor in bind operation 2023-08-22 14:48:33 +02:00
f_ncm.c usb: gadget: f_ncm: Always set current gadget in ncm_bind() 2023-10-21 12:54:53 +02:00
f_obex.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_phonet.c
f_printer.c USB: gadget: f_printer: make usb_gadget_class a static const structure 2023-06-20 16:20:47 +02:00
f_rndis.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_serial.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_sourcesink.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_subset.c usb: gadget: remove max support speed info in bind operation 2023-08-22 14:48:33 +02:00
f_tcm.c usb: gadget: f_tcm: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2023-12-04 22:25:17 +09:00
f_uac1.c usb: gadget: f_uac1: Replace snprintf() with the safer scnprintf() variant 2023-12-15 13:55:29 +01:00
f_uac1_legacy.c
f_uac2.c usb: gadget: f_uac2: Replace snprintf() with the safer scnprintf() variant 2023-12-15 13:55:29 +01:00
f_uvc.c usb: gadget: webcam: Make g_webcam loadable again 2023-12-15 18:27:38 +01:00
f_uvc.h usb: gadget: uvc: prevent use of disabled endpoint 2023-11-23 12:32:44 +00:00
g_zero.h
Makefile usb: gadget: Add support for USB MIDI 2.0 function driver 2023-07-26 06:38:14 +02:00
ndis.h
rndis.c usb: gadget: function: rndis: limit # of RNDIS instances to 1000 2022-08-31 09:07:52 +02:00
rndis.h usb: gadget: rndis: add spinlock for rndis response list 2022-02-24 11:16:57 +01:00
storage_common.c usb: gadget: Use kstrtobool() instead of strtobool() 2022-11-03 23:46:01 +09:00
storage_common.h usb: gadget: f_mass_storage: forced_eject attribute 2022-07-14 16:06:42 +02:00
tcm.h
u_audio.c usb: gadget: u_audio: don't let userspace block driver unbind 2023-03-09 14:56:32 +01:00
u_audio.h
u_ecm.h
u_eem.h
u_ether.c usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach 2023-10-08 07:50:36 +02:00
u_ether.h usb: gadget: add a inline function gether_bitrate() 2023-08-22 14:48:33 +02:00
u_ether_configfs.h
u_fs.h usb: gadget: ffs: remove ENTER() macro 2023-03-29 08:55:58 +02:00
u_gether.h
u_hid.h
u_midi.h
u_midi2.h usb: gadget: midi2: More flexible MIDI 1.0 configuration 2023-07-26 06:38:14 +02:00
u_ncm.h
u_phonet.h usb: gadget: function: Remove unused declarations 2023-08-22 14:45:29 +02:00
u_printer.h
u_rndis.h
u_serial.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
u_serial.h usb: gadget: function: Remove unused declarations 2023-08-22 14:45:29 +02:00
u_tcm.h
u_uac1.h usb: gadget: f_uac1: allow changing interface name via configfs 2022-01-26 14:10:40 +01:00
u_uac1_legacy.c usb: gadget: Replace runtime->status->state reference to runtime->state 2022-09-27 08:49:52 +02:00
u_uac1_legacy.h
u_uac2.h usb: gadget: f_uac2: allow changing terminal types through configfs 2023-10-05 09:35:43 +02:00
u_uvc.h usb: gadget: webcam: Make g_webcam loadable again 2023-12-15 18:27:38 +01:00
uac_common.h
uvc.h usb:gadget:uvc Do not use worker thread to pump isoc usb requests 2023-11-23 12:32:44 +00:00
uvc_configfs.c usb: gadget: uvc: Replace snprintf() with the safer scnprintf() variant 2023-12-15 13:55:29 +01:00
uvc_configfs.h usb: gadget: uvc: Allow linking XUs to string descriptors 2023-02-07 08:46:37 +01:00
uvc_queue.c Revert "usb: gadget: uvc: limit isoc_sg to super speed gadgets" 2022-10-26 14:09:06 +02:00
uvc_queue.h usb: gadget: uvc: rework uvcg_queue_next_buffer to uvcg_complete_buffer 2022-04-21 18:15:33 +02:00
uvc_v4l2.c usb: gadget: uvc: Fix use-after-free for inflight usb_requests 2023-11-23 12:32:44 +00:00
uvc_v4l2.h
uvc_video.c usb:gadget:uvc Do not use worker thread to pump isoc usb requests 2023-11-23 12:32:44 +00:00
uvc_video.h usb: gadget: uvc: move video disable logic to its own function 2023-11-23 12:32:44 +00:00