UPSTREAM: 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>
Bug: 235196743
(cherry picked from commit 62385cf158a7e65b5f347590521d02ee75dc8518)
Change-Id: I064ae3c92aaeec52a3f484665b89ee31132e5053
Signed-off-by: Luiz Matheus <luizmmat@motorola.com>
This commit is contained in:
Pavel Hofman
2022-01-21 16:53:06 +01:00
committed by Treehugger Robot
parent 17643c1fdd
commit 31e6d620c1
2 changed files with 11 additions and 0 deletions

View File

@@ -757,6 +757,15 @@ void u_audio_stop_playback(struct g_audio *audio_dev)
} }
EXPORT_SYMBOL_GPL(u_audio_stop_playback); EXPORT_SYMBOL_GPL(u_audio_stop_playback);
void u_audio_suspend(struct g_audio *audio_dev)
{
struct snd_uac_chip *uac = audio_dev->uac;
set_active(&uac->p_prm, false);
set_active(&uac->c_prm, false);
}
EXPORT_SYMBOL_GPL(u_audio_suspend);
int u_audio_get_volume(struct g_audio *audio_dev, int playback, s16 *val) int u_audio_get_volume(struct g_audio *audio_dev, int playback, s16 *val)
{ {
struct snd_uac_chip *uac = audio_dev->uac; struct snd_uac_chip *uac = audio_dev->uac;

View File

@@ -130,4 +130,6 @@ int u_audio_set_volume(struct g_audio *g_audio, int playback, s16 val);
int u_audio_get_mute(struct g_audio *g_audio, int playback, int *val); int u_audio_get_mute(struct g_audio *g_audio, int playback, int *val);
int u_audio_set_mute(struct g_audio *g_audio, int playback, int val); int u_audio_set_mute(struct g_audio *g_audio, int playback, int val);
void u_audio_suspend(struct g_audio *g_audio);
#endif /* __U_AUDIO_H */ #endif /* __U_AUDIO_H */