From 8e151019a32b733420e2eb3006a5edaac5bc9589 Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Wed, 3 Apr 2019 17:41:32 +1100 Subject: Introduce 'unconfigure' callback The 'unconfigure' callback can be used to clean up the 'configured' state of an Audio Path, for when it is desired to reset the streams, and/or reload a different stream configuration. To destroy the streams, we must attempt to force their PCMs closed. Take note though, that if a PCM is being written to when an unconfigure command is issued, system instability may occur. Signed-off-by: Mark Farrugia --- sound/avirt.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound/avirt.h') diff --git a/sound/avirt.h b/sound/avirt.h index 9259d83..46756b3 100644 --- a/sound/avirt.h +++ b/sound/avirt.h @@ -36,6 +36,8 @@ struct snd_avirt_stream_array; /* Forward declaration */ typedef int (*snd_avirt_audiopath_configure)( struct snd_card *card, struct snd_avirt_stream_array *stream_array); +typedef int (*snd_avirt_audiopath_unconfigure)(void); + typedef void (*snd_avirt_pcm_exttrigger)(void); /** @@ -79,6 +81,7 @@ struct snd_avirt_audiopath { const struct snd_pcm_ops *pcm_playback_ops; /* ALSA PCM playback ops */ const struct snd_pcm_ops *pcm_capture_ops; /* ALSA PCM capture ops */ snd_avirt_audiopath_configure configure; /* Config callback function */ + snd_avirt_audiopath_unconfigure unconfigure; /* Unconfig cb function */ snd_avirt_pcm_exttrigger pcm_exttrigger; /* External trigger callback */ void *context; }; -- cgit 1.2.3-korg