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

usb: gadget: f_uac1: Add suspend callback

Add suspend callback to f_uac1 function, calling corresponding method
of u_audio in order to stop the respective PCM streams and to notify
subscribed clients about the stop.

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

authored by

Pavel Hofman and committed by
Greg Kroah-Hartman
d1d11dd1 7ff4a3b5

+9
+9
drivers/usb/gadget/function/f_uac1.c
··· 961 961 usb_ep_disable(uac1->int_ep); 962 962 } 963 963 964 + static void 965 + f_audio_suspend(struct usb_function *f) 966 + { 967 + struct f_uac1 *uac1 = func_to_uac1(f); 968 + 969 + u_audio_suspend(&uac1->g_audio); 970 + } 971 + 964 972 /*-------------------------------------------------------------------------*/ 965 973 static struct uac_feature_unit_descriptor *build_fu_desc(int chmask) 966 974 { ··· 1699 1691 uac1->g_audio.func.get_alt = f_audio_get_alt; 1700 1692 uac1->g_audio.func.setup = f_audio_setup; 1701 1693 uac1->g_audio.func.disable = f_audio_disable; 1694 + uac1->g_audio.func.suspend = f_audio_suspend; 1702 1695 uac1->g_audio.func.free_func = f_audio_free; 1703 1696 1704 1697 return &uac1->g_audio.func;