mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
FROMGIT: 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.
Change-Id: Id25cc522885c8e5d18a7735eafd7fbd7acd12c50
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>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit d1d11dd130
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
This commit is contained in:
@@ -961,6 +961,14 @@ static void f_audio_disable(struct usb_function *f)
|
||||
usb_ep_disable(uac1->int_ep);
|
||||
}
|
||||
|
||||
static void
|
||||
f_audio_suspend(struct usb_function *f)
|
||||
{
|
||||
struct f_uac1 *uac1 = func_to_uac1(f);
|
||||
|
||||
u_audio_suspend(&uac1->g_audio);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
static struct uac_feature_unit_descriptor *build_fu_desc(int chmask)
|
||||
{
|
||||
@@ -1691,6 +1699,7 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi)
|
||||
uac1->g_audio.func.get_alt = f_audio_get_alt;
|
||||
uac1->g_audio.func.setup = f_audio_setup;
|
||||
uac1->g_audio.func.disable = f_audio_disable;
|
||||
uac1->g_audio.func.suspend = f_audio_suspend;
|
||||
uac1->g_audio.func.free_func = f_audio_free;
|
||||
|
||||
return &uac1->g_audio.func;
|
||||
|
||||
Reference in New Issue
Block a user