]> Git Repo - J-linux.git/commitdiff
usb: gadget: f_uac1: Add suspend callback
authorPavel Hofman <[email protected]>
Fri, 21 Jan 2022 15:53:08 +0000 (16:53 +0100)
committerGreg Kroah-Hartman <[email protected]>
Wed, 26 Jan 2022 13:06:09 +0000 (14:06 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/usb/gadget/function/f_uac1.c

index 73df76a6fbe036b2d7772a2b034e903e21669b3a..1484e5c231d33893a01940311139cfa3afcb676e 100644 (file)
@@ -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;
This page took 0.051839 seconds and 4 git commands to generate.