aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-03-01 17:32:37 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-03-05 10:33:28 +1100
commitda4c2a5619c60cd4dab733bb23a33ed373c78c77 (patch)
treeadcddd53e1981b5a31aa721b8fb98d24ec4d5958 /sound
parentdda7b36122998602a11462398fc0072c0f418bd5 (diff)
Add ability to route audio between audio paths
Configfs interface for adding 'routes' is added, and allows two audio paths to chain together particular inputs/outputs, allowing for multistage audio driver handling. A particular use-case is that of an ADSP driver. We can feed in audio to it, and capture the processed, and/or mixed, audio at it's output, and direct to another audio path driver, such as the UNICENS audio driver. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'sound')
-rw-r--r--sound/avirt.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/sound/avirt.h b/sound/avirt.h
index cb9a61e..138d0ca 100644
--- a/sound/avirt.h
+++ b/sound/avirt.h
@@ -36,9 +36,12 @@ 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 void (*snd_avirt_pcm_exttrigger)(void);
+
/**
* AVIRT Audio Path info
*/
+typedef struct snd_avirt_audiopath snd_avirt_audiopath;
struct snd_avirt_audiopath {
const char *uid; /* Unique identifier */
const char *name; /* Pretty name */
@@ -47,8 +50,24 @@ 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_pcm_exttrigger pcm_exttrigger;
void *context;
+
+ // MUST be at the end
+ struct snd_avirt_audiopath *route_from_ap;
+ struct snd_avirt_audiopath *route_to_ap;
+};
+
+/**
+ * Audio routing
+ */
+struct snd_avirt_route {
+ char name[MAX_NAME_LEN];
+ unsigned int channels;
+ unsigned int direction;
+ struct snd_avirt_audiopath *from_ap;
+ struct snd_avirt_audiopath *to_ap;
+ struct config_item item;
};
/**