Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: u_audio: Add suspend call

Add exported method u_audio_suspend which sets stream status to
inactive and sends notifications. The method does not free any
resources.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-9-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Pavel Hofman and committed by
Greg Kroah-Hartman
62385cf1 8fe9a03f

+11
+9
drivers/usb/gadget/function/u_audio.c
··· 757 757 } 758 758 EXPORT_SYMBOL_GPL(u_audio_stop_playback); 759 759 760 + void u_audio_suspend(struct g_audio *audio_dev) 761 + { 762 + struct snd_uac_chip *uac = audio_dev->uac; 763 + 764 + set_active(&uac->p_prm, false); 765 + set_active(&uac->c_prm, false); 766 + } 767 + EXPORT_SYMBOL_GPL(u_audio_suspend); 768 + 760 769 int u_audio_get_volume(struct g_audio *audio_dev, int playback, s16 *val) 761 770 { 762 771 struct snd_uac_chip *uac = audio_dev->uac;
+2
drivers/usb/gadget/function/u_audio.h
··· 130 130 int u_audio_get_mute(struct g_audio *g_audio, int playback, int *val); 131 131 int u_audio_set_mute(struct g_audio *g_audio, int playback, int val); 132 132 133 + void u_audio_suspend(struct g_audio *g_audio); 134 + 133 135 #endif /* __U_AUDIO_H */