Skip to content

Commit eb9fecb

Browse files
rbilovolFelipe Balbi
authored andcommitted
usb: gadget: f_uac2: split out audio core
Abstract the peripheral side ALSA sound card code from the f_uac2 function into a component that can be called by various functions, so the various flavors can be split apart and selectively reused. Visible changes: - add uac_params structure to pass audio paramteres for g_audio_setup - make ALSA sound card's name configurable - add [in/out]_ep_maxpsize - allocate snd_uac_chip structure during g_audio_setup - add u_audio_[start/stop]_[capture/playback] functions Signed-off-by: Ruslan Bilovol <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 7158b57 commit eb9fecb

File tree

6 files changed

+845
-636
lines changed

6 files changed

+845
-636
lines changed

drivers/usb/gadget/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ config USB_U_SERIAL
158158
config USB_U_ETHER
159159
tristate
160160

161+
config USB_U_AUDIO
162+
tristate
163+
161164
config USB_F_SERIAL
162165
tristate
163166

@@ -381,6 +384,7 @@ config USB_CONFIGFS_F_UAC2
381384
depends on SND
382385
select USB_LIBCOMPOSITE
383386
select SND_PCM
387+
select USB_U_AUDIO
384388
select USB_F_UAC2
385389
help
386390
This Audio function is compatible with USB Audio Class

drivers/usb/gadget/function/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ usb_f_mass_storage-y := f_mass_storage.o storage_common.o
3232
obj-$(CONFIG_USB_F_MASS_STORAGE)+= usb_f_mass_storage.o
3333
usb_f_fs-y := f_fs.o
3434
obj-$(CONFIG_USB_F_FS) += usb_f_fs.o
35+
obj-$(CONFIG_USB_U_AUDIO) += u_audio.o
3536
usb_f_uac1-y := f_uac1.o u_uac1.o
3637
obj-$(CONFIG_USB_F_UAC1) += usb_f_uac1.o
3738
usb_f_uac2-y := f_uac2.o

0 commit comments

Comments
 (0)